[Bug fortran/82215] Feature request to better support two pass compiling with gfortran

busby1 at llnl dot gov gcc-bugzilla@gcc.gnu.org
Fri Sep 15 16:35:00 GMT 2017


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

--- Comment #5 from Lee Busby <busby1 at llnl dot gov> ---
Thank you very much for reading my report, Mr. Koenig.  I probably should have
pulled out footnote #6 as an explicit comment here, as it comes closest to my
own first guess at a "feature request".

As you have seen, the "feature request", such as it is, is pretty simple. 
Gfortran already has all the capabilities needed -- indeed, my report
demonstrates a working production scale system, so why is anything needed at
all?

The only irreplaceable component of the two pass system is the -fsyntax-only
flag.  That allows us to build all the dependencies quickly, then do the heavy
work (code generation) in parallel.  So at a bare minimum, my "feature request"
would be to add a note to the documentation that -fsyntax-only also, as a side
effect, generates the .mod files.  There is no need to say anything about two
pass compiling.

Going on to add -fmodule-files=no would be a nice step that makes the user's
intention more obvious, and it might avoid the temporary subdirectory that I
resort to in the current pass2.  If you did add that option, then also adding
-fobject-files=no as, basically, a synonym for -fsyntax-only might be an
orthogonal addition to the command line interface.

On the third point, putting the source file path into the module file, I agree
that it could well be problematic, and perhaps best left alone.  There are
several ways for practical build systems to match an object file with its
proper source file.

Basically, that's it.  I'm not trying to promote two pass compiling as an
alternative to any other uses of the language or compiler.  My technical report
surprised me, to tell the truth.  It was very easy to set up the two pass
system  for Miranda, and it is extraordinarily effective.  The key mental shift
for me was to see that a fortran compiler is a tool for making module files and
object files: Usually that happens both at once, but in some situations, it can
be much better to do them one at a time.

I would therefore like to see (all) fortran compilers gain the flexibility to
generate modules and objects one at a time.  I consider the gfortran team to be
something of a thought leader in showing how the tool can be used, so I am
grateful for your ideas and insights about which, if any, new features might be
best.

Thank you.


More information about the Gcc-bugs mailing list