------- Comment #3 from jjcogliati-r1 at yahoo dot com  2006-05-10 13:54 -------
(In reply to comment #1)
> Confirmed.  Though sometimes I wonder if this is an over use of printf style
> debugging.
> 


<rant>Well, I have a fortran program.  It ran fine for the first 10 and a half
hours.  Then it died with the error: "Fortran runtime error: Array reference
out of bounds" Any hints on debugging it?</rant>

The front end seems to support filenames and line numbers. bad_array.f90: 
program bad_array
  integer,dimension(8) :: array  
  array(9) = 123
  array(10) = 321
end program bad_array

gfortran -fdump-tree-all -fbounds-check bad_array.f90
bad_array.f90.t02.original:
MAIN__ ()
{
  int4 array[8];

  _gfortran_set_std (86, 127, 0);
  _gfortran_runtime_error ("Array reference out of bounds", "bad_array.f90",
1);
  array[8] = 123;
  _gfortran_runtime_error ("Array reference out of bounds", "bad_array.f90",
3);
  array[9] = 321;
}


So in GCC 4.1.0, the only problem seems to be that _gfortran_runtime_error is
not printing the filename and the line number and the line number seems to be
the line number of the previous statement, not the one that errors.  


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23375

Reply via email to