Question on g++ compile options / numerical differences

Sun May 19 18:37:00 GMT 2002

I have something that is probably some mistake on my part,
but might be an issue with g++ with different compile options
giving different results.  I am running a code which performs
scene generation.  When I compile with the following

-O3 -g -w -mcpu=pentium3 -march=pentium3

I get results that agree well with the 2.95.3 which is the
baseline gcc for Cygwin.  If I add to the above options the

-funroll-all-loops -fomit-frame-pointer -ffast-math

I get scenes that differ by a couple of factors of 10.  I am
running with Windows XP-Pro on a a Pentium 3 laptop.  I have
built gcc-3.1 in Cygwin as a separate set of compilers (C,C++,f77)
from the base Cygwin.  I installed them in their own path,
/mygcc.  I am running with the current Cygwin.

Now, maybe I am running into a problem with the two versions
of gcc running side by side.  The only specific link in the
makefile that I run for 3.1 is that I include a -L/mygcc/lib.

Is there something transparently stupid in the additional
options above that might lead to numerical calculations going
bad?  Does it require something else besides the gcc/lib be linked?
Am I just an illiterate moron?

Wayne Keen

More information about the Gcc-help mailing list