public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Performance loss from RedHat 7.0 to RedHat 9.0
@ 2004-02-11  9:20 Jean-Marc Petit
  2004-02-16 20:38 ` Toon Moene
  0 siblings, 1 reply; 5+ messages in thread
From: Jean-Marc Petit @ 2004-02-11  9:20 UTC (permalink / raw)
  To: gcc-help

Hello,

I just noticed a strong decrease of efficiency in code produced by G77 
when moving from the RedHat 7.0 version (can't recall the version, it's no 
longer on my computer) to RedHat 9.0. In both cases, the program works 
fine, and give the correct result. It has run with G77 on RH70 and RH90, 
f2c on RH70, G77 on Suse 8.0, PGF77 (PGI's Fortran compiler) on Suse 8.0 
and Intel Fortran 8.0 (ifc or now ifort) on RH90. G77 used to give an 
efficient code that was running at speed comparable to commercial Fortran, 
but on the RH90 release, it has slowed by almost a factor of 2.

Hardware: Athlon 1.0GHz, 512 MB RAM

RedHat 7.0:

compiler command: g77 -u -O3 -ffastmath -funroll-loops -m486 -o bench bench.f

result of the "time" command:

real    0m37.415s
user    0m36.890s
sys     0m0.000s


RedHat 9.0:

g77 -v gives: gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)

compiler command: g77 -u -O3 -fno-automatic -funroll-loops -malign-double 
-march=athlon -ffast-math -o bench bench.f

(this is my best case)

result of the "time" comand:

real    1m1.855s
user    1m1.740s
sys     0m0.000s


Is that a known behaviour ? Is there something obvious I can do to make 
things better ? I'd hate to be forced into using Intel Fortran Compiler.

By the way, Interl Fortran Compiler executiion time is:

real    0m26.749s
user    0m26.280s
sys     0m0.010s


Another problem with this version of GCC/G77: I have an old version of f2c 
(VERSION 19990503) that used to work on RedHat 7.0, and complains now on 
RedHat 9.0. I can compile it, and run it, but it can't link the programs, 
complaining about an undefined reference:

undefined reference to `MAIN__'

although my environment variables are (I think) correctly set. Is there 
something new in GCC/G77 that imposes to go to a newer version of f2c ?

Thank you for the time you'll spend on my questions, sincerely,

Jean-Marc Petit


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Performance loss from RedHat 7.0 to RedHat 9.0
  2004-02-11  9:20 Performance loss from RedHat 7.0 to RedHat 9.0 Jean-Marc Petit
@ 2004-02-16 20:38 ` Toon Moene
  2004-02-17  9:35   ` Jean-Marc Petit
  0 siblings, 1 reply; 5+ messages in thread
From: Toon Moene @ 2004-02-16 20:38 UTC (permalink / raw)
  To: Jean-Marc Petit; +Cc: gcc-help

Jean-Marc Petit wrote:

> I just noticed a strong decrease of efficiency in code produced by G77 
> when moving from the RedHat 7.0 version (can't recall the version, it's no 
> longer on my computer) to RedHat 9.0.

> Hardware: Athlon 1.0GHz, 512 MB RAM
> 
> RedHat 7.0:
> 
> compiler command: g77 -u -O3 -ffastmath -funroll-loops -m486 -o bench bench.f
> 
> result of the "time" command:
> 
> real    0m37.415s
> user    0m36.890s
> sys     0m0.000s

but the following is slower:

> RedHat 9.0:
> 
> g77 -v gives: gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
> 
> compiler command: g77 -u -O3 -fno-automatic -funroll-loops -malign-double 
> -march=athlon -ffast-math -o bench bench.f

Note that one of the differences is the -fno-automatic compile time 
option in the latter example.  This might make a large difference, as it 
instructs the compiler to treat all variables (even loop counts) to be 
memory resident, instead of being able to live in registers.

Why do you need -fno-automatic with gcc-3.2.2 but not with the RedHat 
7.0 compiler ?

-- 
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)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Performance loss from RedHat 7.0 to RedHat 9.0
  2004-02-16 20:38 ` Toon Moene
@ 2004-02-17  9:35   ` Jean-Marc Petit
  2004-02-17 23:15     ` Toon Moene
  0 siblings, 1 reply; 5+ messages in thread
From: Jean-Marc Petit @ 2004-02-17  9:35 UTC (permalink / raw)
  To: Toon Moene; +Cc: gcc-help

On Mon, 16 Feb 2004, Toon Moene wrote:

> Jean-Marc Petit wrote:
> 
> > I just noticed a strong decrease of efficiency in code produced by G77 
> > when moving from the RedHat 7.0 version (can't recall the version, it's no 
> > longer on my computer) to RedHat 9.0.
> 
> > Hardware: Athlon 1.0GHz, 512 MB RAM
> > 
> > RedHat 7.0:
> > 
> > compiler command: g77 -u -O3 -ffastmath -funroll-loops -m486 -o bench bench.f
> > 
> > result of the "time" command:
> > 
> > real    0m37.415s
> > user    0m36.890s
> > sys     0m0.000s
> 
> but the following is slower:
> 
> > RedHat 9.0:
> > 
> > g77 -v gives: gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
> > 
> > compiler command: g77 -u -O3 -fno-automatic -funroll-loops -malign-double 
> > -march=athlon -ffast-math -o bench bench.f
> 
> Note that one of the differences is the -fno-automatic compile time 
> option in the latter example.  This might make a large difference, as it 
> instructs the compiler to treat all variables (even loop counts) to be 
> memory resident, instead of being able to live in registers.
> 
> Why do you need -fno-automatic with gcc-3.2.2 but not with the RedHat 
> 7.0 compiler ?
> 
Well, I tried wihtou the "-fno-automatic" option. It's marginally worth:

real    1m4.492s
user    1m4.390s
sys     0m0.000s

The reason I have this option is that I don't want to loose time 
re-creating the variables each time the program enters a subroutine. In 
the present case, I don't really need that, and the result is essentially 
the same. In some cases, I need to have it for the program to work. This 
replace having a SAVE statement in each and every subroutine. For example, 
I need this to compile and link with the PGPLOT library. Anyway, it seems 
this doesn't solve my problem. If you think it's worth it, I can send 
along my progam.

Reagrds, Jean-Marc Petit


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Performance loss from RedHat 7.0 to RedHat 9.0
  2004-02-17  9:35   ` Jean-Marc Petit
@ 2004-02-17 23:15     ` Toon Moene
  2004-02-18  8:20       ` Jean-Marc Petit
  0 siblings, 1 reply; 5+ messages in thread
From: Toon Moene @ 2004-02-17 23:15 UTC (permalink / raw)
  To: Jean-Marc Petit; +Cc: gcc-help

Jean-Marc Petit wrote:

> Well, I tried wihtou the "-fno-automatic" option. It's marginally worth:

Well, unfortunately, the 3.2 compiler sometimes generates worse code 
than the 2.95 one.  You could try the new 3.3.3 one (just released), but 
even better would be the 3.4.0 version (still a couple of months away).

Hope this helps,

-- 
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)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Performance loss from RedHat 7.0 to RedHat 9.0
  2004-02-17 23:15     ` Toon Moene
@ 2004-02-18  8:20       ` Jean-Marc Petit
  0 siblings, 0 replies; 5+ messages in thread
From: Jean-Marc Petit @ 2004-02-18  8:20 UTC (permalink / raw)
  To: Toon Moene; +Cc: gcc-help

On Wed, 18 Feb 2004, Toon Moene wrote:

> Jean-Marc Petit wrote:
> 
> > Well, I tried wihtou the "-fno-automatic" option. It's marginally worth:
> 
> Well, unfortunately, the 3.2 compiler sometimes generates worse code 
> than the 2.95 one.  You could try the new 3.3.3 one (just released), but 
> even better would be the 3.4.0 version (still a couple of months away).
> 
> Hope this helps,
> 
Thanks for all. I think I'll wait for the 3.4.0 version, and hope for the 
best. For the time being, I have the Intel compiler, and I may also try 
the F2C rpm.

Regards, Jean-Marc Petit

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-02-18  8:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-11  9:20 Performance loss from RedHat 7.0 to RedHat 9.0 Jean-Marc Petit
2004-02-16 20:38 ` Toon Moene
2004-02-17  9:35   ` Jean-Marc Petit
2004-02-17 23:15     ` Toon Moene
2004-02-18  8:20       ` Jean-Marc Petit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).