The following code should tell us we have an out-of-bounds access at runtime:
$ cat a.f90
subroutine foo(a)
integer a(*), i
i = 0
a(i) = 42
end subroutine foo
program test
integer x(42)
call foo(x)
end program test
$ gfortran a.f90 -fbounds-check && ./a.out
--
Summary: -bounds-check doesn't check lower bound of assumed-sized
array
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: accepts-invalid, diagnostic
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: fxcoudert at gcc dot gnu dot org
OtherBugsDependingO 27766
nThis:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31627