Hi All,

For the following code:
program test
real, allocatable :: pos(:,:)
allocate(pos(2,2))
pos = 0.0
print *,pos(5,:)
deallocate(pos)
end program test

when compiled with:
gfortran -fbounds-check test.f95 

the out of bounds array reference in the print command should be picked up, but
isn't.  

Also fails in the same way using g95.

Replacing pos(5,:) with pos(5,1) is picked up.

Thanks, Gareth


-- 
           Summary: out of bounds error in allocatable array not picked up
                    with -fbounds-check
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: glv at maths dot otago dot ac dot nz
 GCC build triplet: x86_64-redhat-linux
  GCC host triplet: x86_64-redhat-linux
GCC target triplet: x86_64-redhat-linux


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

Reply via email to