This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Whole-file compilation in gfortran
- From: FX Coudert <fxcoudert at gmail dot com>
- To: GNU Fortran <fortran at gcc dot gnu dot org>
- Cc: Michael Matz <matz at suse dot de>
- Date: Tue, 14 Aug 2007 19:08:18 +0100
- Subject: Whole-file compilation in gfortran
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=m3jWr3ZZpve0JYYwrk5lN2vN2C64WGfeVBpvoas1wzmWxKmCuU2pOiwUmT3jY7Qu1E8Tj+z8CkwNrOsp14Z4gfdmd3ztJ9di3cgS2D0a0Lhxvq5HGuZW9Sh7W/6z8Ir47zwIQ3IQOrjN+R+u5aTHU2hwKfJ6oFwEVNwuRpT7ALg=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=IohpmrDynJ67CcodIxgQ7+5XTW15Jt9/0eQNk1Aevl+eF8TN8DoE3kSF1s1bdWOn5VMwzN9tnzFscA9G8+zXWgGq/R/UAFhc4SGVyacrt4EQOpZufFsrzm1m1ptLJ7WfrQ0ah9sWa8z82eTtU5uvnY8+AC6NWJk+5JhXXUNb+r8=
Hi gfortranners, hi Michael,
A short mail about the topic of whole-file compilation. This is not
an urgent mail, I simply thought about it a bit more, and I wanted to
share my impressions, check that I'm not too confused about the goals
and means here, and then share links to two patches ([1] and [2]
below) by Steven Bosscher and Michael Matz aiming at this (I didn't
know about these patches, or forgot, so maybe the notice will be good
for others as well).
As far as I understood, there are 3 different issues to be tackled
that this would help us :
(a) perform better inter-file checking of interfaces,
(b) inline non-contained procedures, and
(c) module loading performance
I will not talk about (a) here, as it's probably the most tricky. As
far as I see, (c) requires us to store modules into memory in
addition to writing them to disk, so that we can load symbols from
them without actually reading/parsing the file back. There might be
more to it, Paul could tell.
Now, I'm kind of puzzled about (b). Following the approach of Michael
Matz at [2], means that every time we would create a function decl,
we start by looking whether there already is one with this name in
the toplevel namespace, and if there is, we use this instead of
creating a new. Michael apparently never follow this patch up, but I
can't think of any fundamental objection to it, of anything that
would make it completely flawed. (The one thing I can think of is
that, without further type-checking of function decls, we might end
up create ICEs on invalid code that the front-end doesn't catch yet,
like mismatching arguments; but we can add type-checking, can't we?
So, I hope my point of view here is not to naïve, but I'd like to
hear your opinions on all this.
FX
[1] http://gcc.gnu.org/ml/gcc/2005-07/msg00863.html
[2] http://gcc.gnu.org/ml/gcc/2005-07/msg00940.html