Negative line numbers (PR 19195)

Erik Schnetter schnetter@aei.mpg.de
Sat Jun 4 17:31:00 GMT 2005


When gfortran aborts with an error message like

internal compiler error: in final_scan_insn, at final.c:1843,

Andrew Pinski suggested that (see PR 19195)

"We are using the wrong line number for the return statement.
This usually means that cfun->function_end_locus is not set correctly."

I checked a similar case (where the line number is -123), and found that 
the input_location already contains this negative number where gfortran 
assigns

cfun->function_end_locus = input_location;

near line 2423 in file trans-decl.c.  The file name is still correct at 
this place.

Tracking things down further, the error may come from near line 444 in 
trans.c, where input_line is 0, and then decreased by one (but I don't 
know whether that is actually allowed there).

I noticed that the functions gfc_{get,set}_backend_locus are not 
inverses of each other.  One of them decrements the line number, the 
other one does not increment it.  Could this be a problem?

Which piece of code fills input_location or input_line?

-erik

-- 
Erik Schnetter <schnetter@aei.mpg.de>   http://www.aei.mpg.de/~eschnett/

My email is as private as my paper mail.  I therefore support encrypting
and signing email messages.  Get my PGP key from www.keyserver.net.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20050604/d60cadc0/attachment.sig>


More information about the Fortran mailing list