fortran 4.0 shows perfomance regression (with -O2 option) in comparison with g77 from 3.4.2 on IA32 with attached test. This test is obtained from cpu2000/mgrid test. It consists of calling of two functions: PSINV and RESID. Instrumental control (gprof) shows that most part of time spends in RESID function. There is one strange thing for me. If I remove call of PSINV function test (compiled by g77) became more slowly then it was before (with this call). gfortran from gcc4.0 behave more predictable. It looks like g77 from gcc 3.4.2 does interprocedure optimization for better cache using which can't do gfortran from gcc4.0
You can reproduce my results with attached test. Timing results: With PSINV call g77 sample.f -O2 -static 0m0.693s 0m0.685s 0m0.008s 0m0.694s 0m0.685s 0m0.009s 0m0.690s 0m0.683s 0m0.007s With PSINV call gfortran sample.f -O2 -static 0m1.293s 0m1.279s 0m0.015s 0m1.320s 0m1.306s 0m0.014s 0m1.303s 0m1.294s 0m0.008s Without PSINV call: g77 sample1.f -O2 -static -o z342s time ./z342s 0m0.902s 0m0.893s 0m0.007s 0m0.930s 0m0.923s 0m0.008s 0m0.894s 0m0.889s 0m0.005s Without PSINV call gfortran sample1.f -O2 -static -o z40s time ./z40s 0m0.758s 0m0.752s 0m0.006s 0m0.762s 0m0.758s 0m0.004s 0m0.759s 0m0.757s 0m0.004s cat /proc/cpuinfo: processor : 0 vendor_id : GenuineIntel cpu family : 15 model : 2 model name : Intel(R) Xeon(TM) CPU 2.40GHz stepping : 7 cpu MHz : 2400.858 cache size : 512 KB -- Summary: about 2x perfomance regression in comparision with 3.4.2 Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: denis dot nagorny at intel dot com CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i586-suse-linux GCC host triplet: i586-suse-linux GCC target triplet: i586-suse-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20945