http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57721

            Bug ID: 57721
           Summary: wrong error message with bounds checking.
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Joost.VandeVondele at mat dot ethz.ch

The following testcase:

> cat test.f90 
TYPE data
  INTEGER :: x(10)
END TYPE
TYPE data_areas
  TYPE(data) :: y(10)
END TYPE

TYPE(data_areas) :: z(10)

integer, volatile :: i,j,k
i=1 ; j=1 ; k=11

z(i)%y(j)%x(k)=0

END


> gfortran -fbounds-check test.f90 ; ./a.out
At line 13 of file test.f90
Fortran runtime error: Index '11' of dimension 1 of array 'z' above upper bound
of 10


detects the out-of-bounds access, but mentions the incorrect 'z' instead of the
correct 'x'

Reply via email to