This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: gcc optimizer problem
- To: Claus Kleinwort <kleinwrt at mail dot desy dot de>
- Subject: Re: gcc optimizer problem
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- Date: Tue, 7 Apr 98 19:52:51 +0200
- Cc: egcs-bugs at cygnus dot com, bernd-wilhelm dot hellwig at desy dot de
- Organization: Moene Computational Physics, Maartensdijk, The Netherlands
- References: <Pine.SOL.3.95.980406182534.22504D-100000@amrum.desy.de>
> I'm a member of a large collaboration performing research
> in high energy physics (http://www-h1.desy.de) and I have
> a problem with the GCC optimizer for some Fortran code
> on a PC running Linux. The code performs only correct
> without optimization (-O0).
> The compiler options used are:
> g77 -c -w -fno-automatic -finit-local-zero -O2
> -fno-second-underscore
> -fno-backslash gcc -c -w -ansi -O2
*
* isolated maximum found,check it
*
* worse isolation?
FRAC=FLOAT(MT)/FLOAT(NTOT)
CHK the magic print statement
C PRINT *, ' IXCLU1- '
CHK
IF (FRAC.LT.FRACX) GOTO 500
^^^^^^^^^^^^^
Could you try this routine compiled with the additional flag
-ffloat-store ? I bet the "adding this print solves the problem" is
a dead give-away that FRAC normally is kept in a register, which
gives it a slightly different value from when it has to be stored
(which is the case around the calls resulting from the print
statement).
Grrrr, don't you love the ix86 architecture :-(
HTH,
Toon.