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