This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: FAIL: gfortran.dg/bounds_check_10.f90
- From: dominiq at lps dot ens dot fr (Dominique Dhumieres)
- To: fortran at gcc dot gnu dot org
- Date: 2007年10月14日 10:54:59 +0200
- Subject: Re: FAIL: gfortran.dg/bounds_check_10.f90
> Anyone else seeing this?
I did not regtested this part yet, but I get:
[karma] f90/bug% gfc /opt/gcc/_gcc-clean/gcc/testsuite/gfortran.dg/bounds_check_10.f90
/opt/gcc/_gcc-clean/gcc/testsuite/gfortran.dg/bounds_check_10.f90:11.1:
z = [y(1:1), x(1:len(trim(x)))] ! should work
1
Error: Different shape for array assignment at (1) on dimension 1 (3 and 2)
This is due to
character (len=2) :: z(3)
If I replace the faulty line by
z = [y(1:len(trim(x))), y(1:1), x(1:len(trim(x)))] ! should work
the test compiles and run, giving a runtime error with -fbounds-check.
Now I see another problem with the original test for pr33727: it does
not give a runtime error even with -fbounds-check:
[karma] f90/bug% cat pr33727.f90
program array_char
implicit none
character (len=2) :: x, y
character (len=2) :: z(2)
x = "a "
y = "cd"
z = [y(1:len(trim(y))), x(1:1)] ! causes segfault
end program array_char
[karma] f90/bug% gfc -fbounds-check pr33727.f90
[karma] f90/bug% a.out
[karma] f90/bug%
Does anyone also see that (I tried 32 and 64 bit modes)?
Dominique