https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81615

Rimvydas (RJ) <rimvydas.jas at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rimvydas.jas at gmail dot com

--- Comment #16 from Rimvydas (RJ) <rimvydas.jas at gmail dot com> ---
Created attachment 54063
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54063&action=edit
rename intermediate extensions to .fi or .fii

Emitting intermediate files using plain foo.f90 form is a very annoying issue
when trying to modernize archaic codebases to be used in current projects and
it really helps when intermediate files could be saved without disturbing used
native build system habitat.  Consider the following:
$ cat bar.F
       SUBROUTINEABINIT PART 2( ARGU
     x                          MENT)
       E N D S   U   B   R   O   U   T   I   N  E
$ gfortran --save-temps -c bar.F
$ gfortran -c bar.s
$ gfortran -c bar.f90
bar.F:1:8:

    1 |        SUBROUTINEABINIT PART 2( ARGU
      |        1
Error: Unclassifiable statement at (1)

This shows that intermediate Fortran source produced cannot be used again
because of fixed/free form differences while assembly file is fine.  There are
N+K build system variants that do crazy and wonderful things like
filtering/substituting flags, redirecting STDERR/STDOUT for cleaner warning
messages, silently moving sources and objects with strange rules, hiding
compilation lines in python scripts, substituting symbol names in assembly
files and even substituting names in source code on the fly to solve symbol
conflicts between contrib codebases using sed(1) or heavy cpp(1).  So sometimes
it is simply easier to modify the compiler and recompile (after all it does not
take long for gcc).
Attached is a simple diff variant that uses F77/F90+ to emit .fi/.fii
intermediate source files accordingly (inspired by what ObjC/ObjC++ do with
intermediates .mi/.mii files).  Such small change really helped to
double/triple crosscheck very complicated project with mixed F77/F90 using
sometimes crazy cpp(1) macros for the "hooks".  Using .fii extension for all
sources of .F90/.F95/.F03/.F08/.Fyz seems like a logical solution.

Reply via email to