I am compiling a Fortran 77 program with gfortran 4.0.2 and the -fbounds-check flag. When the program runs, I get a message "Fortran runtime error: Array reference out of bounds". The same program runs just fine when compiled with either g77 3.x or g95 4.x and the -fbounds-check flag. The gist of the problem is that the runtime system is reporting an out-of-bounds error when accessing an element of a character string array within a subroutine. The character string array is declared in the main program to contain 80 strings, each of length 80 characters. The array is received in the subroutine as an arbitrary length array, using the asterisk notation. I will attach a simple program that illustrates the problem.
-- Summary: improper runtime bounds check error when using arbitrary length arrays Product: gcc Version: 4.0.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: cummings at cacr dot caltech dot edu GCC build triplet: x86_64-unknown-linux-gnu GCC host triplet: x86_64-unknown-linux-gnu GCC target triplet: x86_64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25401