https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30802
anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |anlauf at gcc dot gnu.org See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=97039 --- Comment #9 from anlauf at gcc dot gnu.org --- (In reply to markeggleston from comment #8) > Changing to allocated arrays and bounds checking does not work at compile > time but does at runtime: > > program test > real, allocatable :: x(:) > allocate(x(10)) > x = 0.0 > print *, x(0) > deallocate(x) > end program test > > $ gfortran -fbounds-check pr30802.f90 > $ ./a.out > > At line 5 of file pr30802.f90 > Fortran runtime error: Index '0' of dimension 1 of array 'x' below lower > bound of 1 > > Error termination. Backtrace: > #0 0x400ea1 in ??? > #1 0x400f6d in ??? > #2 0x4380b2 in ??? > #3 0x438471 in ??? > #4 0x400c69 in ??? I think the point is that bounds-checking does not work for sections of rank-2 arrays. See also PR97039. This is not I/O specific, but what Thomas said in comment#3.