This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: why -fno-globals at -O3 with g77
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- To: Jack Howarth <howarth at nitro dot med dot uc dot edu>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 20 Nov 2003 00:13:44 +0100
- Subject: Re: why -fno-globals at -O3 with g77
- Organization: Moene Computational Physics, Maartensdijk, The Netherlands
- References: <200311191842.NAA62163@nitro.med.uc.edu>
Jack Howarth wrote:
A molecular dynamics package, which extensively uses
shared libs and COMMON blocks, has apparently needed to
compile certain files with -fno-globals to build at -O3
with g77 for sometime now. The current g77 3.4 snapshot
of 101503 seems to reduce these down to about 6 fortran
source files. These files will only compile at -O3
when -fno-globals is used.
I haven't seen this issue mentioned and was wondering
what the origin of it typically was and if there was
an easy way to avoid tickling this glitch. I ask because
when I removed -fno-globals from all the uneffected source
file compilations the resulting binaries ran about 10%
faster than before.
Thanks in advance for any insights into this issue.
Until now, I was mostly silent on your bug reports, because I didn't
understand most of them (OS X, Apple version of gcc/binutils - lets face
it: Debian runs quite well on Apple hardware).
However, this one I think I have a handle on: If you need -fno-globals
it means that you are trying to inline routines that have arguments that
differ (in type) between the call and the definition site.
This often happens if you have a "generic container" which is INTEGER in
the routine itself, but in the call might be REAL or DOUBLE PRECISION or
even COMPLEX if space allows.
There's no easy solution here, because Fortran 77 doesn't allow you to
write generic routines to handle different type arguments - you need
Fortran 90/95 for this.
Unfortunately, g95 (see my signature) isn't ready yet ...
--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
GNU Fortran 95: http://gcc.gnu.org/fortran/ (under construction)