This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/30802] out of bounds error in allocatable array not picked up with -fbounds-check
- From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Aug 2007 21:13:44 -0000
- Subject: [Bug fortran/30802] out of bounds error in allocatable array not picked up with -fbounds-check
- References: <bug-30802-14089@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from fxcoudert at gcc dot gnu dot org 2007-08-06 21:13 -------
It's not about being allocatable, it's the I/O operation that doesn't perform
the necessary check:
$ cat a.f90
real :: x(2,2)
x = 0.
print *, x(5,:)
x(5,:) = 1.
end
$ gfortran -fbounds-check a.f90 && ./a.out
0.000000 5.8787666E-39
At line 4 of file a.f90
Fortran runtime error: Array reference out of bounds for array 'x', upper bound
of dimension 1 exceeded
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30802