[PATCH] Fix debug info when compiling preprocessed fortran sources (.F, .F90, .F95)

Tobias Schlüter tobias.schlueter@physik.uni-muenchen.de
Sat Dec 31 13:12:00 GMT 2005


Hi Jakub,

Jakub Jelinek wrote:
> https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=175071
> Given say
> echo '      END' > D.F
> gfortran -g -dA -S -o D.s D.F
> gfortran outputs incorrect debug info, referencing the temporary
> preprocessed source as the actual source file rather than the original
> file.  This patch changes specs so that when preprocessing a Fortran
> source, new -fpreprocessed flag is passed to f951 and f951 then immitates
> what libcpp's cpp_read_main_file and read_original_filename do, i.e.
> in post_options lang hook read the original filename and current directory
> from the preprocessed Fortran source.

Wouldn't it be more robust (and possibly simpler) to use libcpp inside the
Fortran frontend, and to thus do away completely with the need for a temporary
file?  I think this would be a preferable solution, but I'm sure you had
reasons to do it this way.

- Tobi



More information about the Gcc-patches mailing list