------- 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

Reply via email to