------- Comment #5 from jjcogliati-r1 at yahoo dot com 2006-05-24 12:49 ------- (In reply to comment #4) > (In reply to comment #3) > > > 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. > > runtime_error is also called from lots of places from within libgfortran, > and there is currently no way to pass line number information to intrinsics. >
So, make a new function like runtime_error_with_lineinfo, and have that called instead when there is line information. I believe that gfor_fndecl_runtime_error declared in gcc-4.1.0/gcc/fortran/trans-decl.c is only used by trans.c in gfc_trans_runtime_check which always has line number information. So, how to make a patch for this: Create a runtime_error_with_loc in gcc-4.1.0/libgfortran/runtime/error.c that uses the a line number and filename. Change the gfor_fndecl_runtime_error to call runtime_error_with_loc instead of runtime_error in gcc-4.1.0/gcc/fortran/trans-decl.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23375