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 array I/O not picked up with -fbounds-check
- From: "tkoenig at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Dec 2007 22:23:12 -0000
- Subject: [Bug fortran/30802] out of bounds error array I/O 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 #3 from tkoenig at gcc dot gnu dot org 2007-12-17 22:23 -------
I think the problem is that we don't insert bounds checking
in gfc_conv_expr_descriptor.
Another test case:
$ cat index.f90
module bar
contains
subroutine foo(a)
real, dimension(:) :: a
a = 3.
end subroutine foo
end module bar
program main
use bar
real, dimension(2,2) :: a
n = 3
call foo(a(n,:))
end program main
$ gfortran index.f90
$ gfortran -fbounds-check index.f90
$ ./a.out
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30802