This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: SPEC2000 252.eon generates invalid results when compiled -O3 with g++ 3.3


> --- Joe Buck <jbuck at synopsys dot com> wrote:
> > On Thu, Mar 27, 2003 at 01:35:42PM -0800, Casey Leedom wrote:
> > >   I'm trying to track down a patch for what appears to be a g++ 3.3
> > > optimization bug with the SPEC2000 252.eon benchmark.  When I compile this
> > > "-m32 -O0" or "-m64 -O3" I get correct results.  But if I use anything
> > other
> > > than -O0 with -m32 I end up with incorrect results.  Is anyone aware of
> > this
> > > bug and is there a patch available for it?  Thanks!
> > 
> > You don't mention a platform, but since you mention -m64 I guess sparc.
> > Right?  Also, is there a PR for this?
> 
>   Actually this is an Opteron system so I'm using the x86 and x86-64 stuff from
> gcc 3.3 provided by AMD.

The problem actually is that 386 uses x87 for FP operations that does
use 80bit values for temporaries.  The eon depends on roundoff errors
and thus get slightly different results.
The way to fix it is to ldpreload simple constructor that does set
control word to 64bits like windows does.

Honza
> 
>   I've been away from the gcc world for quite some time so I'm not sure how
> problem reports are being handled these days or how to search the database.  (I
> am of course more than willing to learn!)  There is a comment in the
> configuration file for x86 linux that has the following in it:
> 
> -----<BEGIN EXCERPT config/ia32-linux-gcc.cfg>-----
> ...
> 252.eon=default=default=default:
> EXTRA_CXXFLAGS=-DHAS_ERRLIST
> OPTIMIZE=-O0
> # Optimization level -g or -O0 must be used to obtain
> # a valid reference run using the default compilers on
> # the RedHat 5.2 distribution for Intel
> # the RedHat 6.0 distribution for Intel
> # the Suse 6.1 distribution for Intel
> # if GCC 2.95.1 or later is used the the suggested default
> # optimization level of -O3 -fomit-frame-pointer may be used
> # by commenting out the line OPTIMIZE=-O0 in the stanza for 252.eon above.
> ...
> -----<END EXCERPT config/ia32-linux-gcc.cfg>-----
> 
> As I mentioned in my first message, using -O3 -m64 works fine, but I can't use
> anything other than -O0 with -m32.  The code does compile, it just generates
> invalid results.  It looks like some bad floating point optimizations have been
> done.  I'll run this on a different CPU just to be sure.
> 
> Casey
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
> http://platinum.yahoo.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]