------- 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
