This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: egcs 1.0.1 and fortran optimization
- To: egcs at cygnus dot com
- Subject: Re: egcs 1.0.1 and fortran optimization
- From: Vladimir Eltsov <ve at boojum dot hut dot fi>
- Date: Wed, 21 Jan 1998 10:02:49 +0200 (EET)
Thank you for all who replied to my question why egcs f77 compiler
produces slower code on pentiumII than gf77 2.7.2.3.f.1 when c++ compiler
produces much faster code with the same set of compiler options. The most
imperative answer was to always use -malign-double for double precision
fortran programs. So I want to post my experience which contradicts this
conclusion. After playing with various optimization options I found the
best result for one paticular fortran program which solves system of
ODE's using the standard rksuit package (from www.netlib.org). The best
options for egcs are
-O9 -mcpu=pentiumpro -fomit-frame-pointer -ffast-math
-funroll-loops -fforce-mem
while for gnu f77
-O3 -m486 -fomit-frame-pointer -ffast-math -malign-double -funroll-loops
With these options egcs compiled program runs 2.5% faster than gf77
compiled. However, adding -malign-double to egcs options slows down the
resulting program by 17% (-fno-automatic and -fforce-addr also have
negative effects, others mentioned in the g77 manual have no effect). All
real variables in the program are DP and all common blocks are arranged
form longest to shortest.
Best regards,
Vladimir Eltsov