This is the mail archive of the
mailing list for the GCC project.
Re: Who should set main_input_filename to "<stdin>"?
- From: Neil Booth <neil at daikokuya dot co dot uk>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: gcc at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Sun, 28 Sep 2003 10:31:12 +0100
- Subject: Re: Who should set main_input_filename to "<stdin>"?
- References: <Pine.LNX.firstname.lastname@example.org>
Roger Sayle wrote:-
> Whilst debugging in gdb, I accidentally ran the command "jc1 -O2",
> i.e. without a filename, only to discover than jc1 ICEs. Similar
> tests reveal that mainline f771 also ICEs, but neither did back
> in gcc 3.2. I then tried to discover why neither cc1 nor cc1plus
> currently ICE, which revealed that mysteriously for the C-family
> front-ends, main_input_filename gets set to "<stdin>" as an
> undocumented side-effect of linemap_add in linemap.c.
> I was wondering which routine *should* be responsible for setting
> input filename? Should java and fortran be calling linemap earlier?
> Should "default_file_start" in varasm.c call output_file_directive
> when main_input_filename is NULL? Or if so, is it reasonable to
> generate ".file <stdin>" in asm_out_file. Do java_parse_file and
> ffe_parse_file now need to defend against NULL filenames?
> This is one of those pan front-end problems that its difficult to
> file as a f77 or java PR, as neither of them is at fault: something
> else has obviously changed in toplev.c. I'm happy to investigate
> a fix myself, but I don't yet know what the intended behaviour is
> (or should be)?
Maybe Geoff has an opinion. He moved it out of cpplib to linemap.c.