This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/32036] Multiple evaluation of array index with bounds checking
- From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 May 2007 12:01:12 -0000
- Subject: [Bug fortran/32036] Multiple evaluation of array index with bounds checking
- References: <bug-32036-10259@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from fxcoudert at gcc dot gnu dot org 2007-05-22 13:01 -------
Another testcase (from gfortran.fortran-torture/execute/der_io.f90), probably
the same bug:
$ cat der_io.f90
type xyz_type
integer :: x
end type xyz_type
type (xyz_type), dimension(3) :: xyz
xyz(1)%x = 11111
xyz(2)%x = 0
xyz(3)%x = 0
write (*, *) xyz(bar())
contains
integer function bar()
integer, save :: i = 1
bar = i
i = i + 1
end function
end
$ gfortran der_io.f90 && ./a.out
11111
$ gfortran der_io.f90 -fbounds-check && ./a.out
0
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32036