This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/30802] New: out of bounds error in allocatable array not picked up with -fbounds-check
- From: "glv at maths dot otago dot ac dot nz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Feb 2007 00:28:39 -0000
- Subject: [Bug fortran/30802] New: out of bounds error in allocatable array not picked up with -fbounds-check
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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