This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Who should set main_input_filename to "<stdin>"?


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.

Neil.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]