[Bug fortran/32036] Multiple evaluation of array index with bounds checking
--- Comment #3 from fxcoudert at gcc dot gnu dot org 2007-07-15 00:02 --- Fixed. -- fxcoudert at gcc dot gnu dot org changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32036
[Bug fortran/32036] Multiple evaluation of array index with bounds checking
--- Comment #2 from fxcoudert at gcc dot gnu dot org 2007-07-14 23:59 --- Subject: Bug 32036 Author: fxcoudert Date: Sat Jul 14 23:59:00 2007 New Revision: 126647 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126647 Log: PR fortran/32036 * trans-array.c (gfc_conv_array_ref): Only evaluate index once. * gfortran.dg/bounds_check_8.f90: New test. * gfortran.dg/do_iterator_2.f90: Make code legal Fortran. Added: trunk/gcc/testsuite/gfortran.dg/bounds_check_8.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/trans-array.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gfortran.dg/do_iterator_2.f90 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32036
[Bug fortran/32036] Multiple evaluation of array index with bounds checking
--- 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 = 1 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 1 $ gfortran der_io.f90 -fbounds-check && ./a.out 0 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32036
[Bug fortran/32036] Multiple evaluation of array index with bounds checking
-- fxcoudert at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2007-05-22 12:25:33 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32036