Bug 25303 - [4.0/4.1] -O2 miscompiled eon in SPEC CPU 2K
Summary: [4.0/4.1] -O2 miscompiled eon in SPEC CPU 2K
Status: RESOLVED DUPLICATE of bug 323
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.1.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-07 20:58 UTC by H.J. Lu
Modified: 2005-12-08 01:47 UTC (History)
39 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2005-12-07 20:58:14 UTC
Gcc 4.0 20051113 and 4.120051207 miscompiled eon in SPEC CPU 2K with -O2. I got

Running Benchmarks
  Running 252.eon ref base o2 default
*** Miscompare of pixels_out.kajiya, see /export/spec/src/2000/spec/benchspec/CINT2000/252.eon/run/00000002/pixels_out.kajiya.mis

x86-64 seems OK. Gcc 4.2 20051203 is OK.
Comment 1 Andrew Pinski 2005-12-07 20:59:35 UTC
The last time I looked at eon failing on x86, it was due to excessive precission for fp.  Yes FP in an int test but what ever.
Comment 2 Andrew Pinski 2005-12-07 21:00:51 UTC
Also I should note that it would fail the same way for 3.4, 3.3, and many older compilers.

And if that is the case this is a dup of bug 323.
Comment 3 H.J. Lu 2005-12-07 21:49:47 UTC
It could be. After adding -ffast-math to gcc 4.1, eon is OK.
Comment 4 Andrew Pinski 2005-12-08 00:49:54 UTC
Can you try -ffloat-store or do the following:
On Linux/ix86 we use long double precision for evaluation of floating point variables. This can lead to different values than the expected values. I'm experimenting on the tests for cfg-branch with a small shared library that is preloaded. 

The complete code is below, I compiled it with gcc -Wall -O2 -shared -o libchange-precission.so change-precission.c and set LD_PRELOAD to this library. 

extern void change_precission (void) __attribute__ ((constructor));

void
change_precission (void)
{
  unsigned int cw = 0x27f;

  __asm__ volatile ("fldcw %0" :: "m" (*&cw));
}
Comment 5 H.J. Lu 2005-12-08 01:46:56 UTC
-ffloat-store fixed eon for gcc 4.1.
Comment 6 Andrew Pinski 2005-12-08 01:47:33 UTC
Then this is a dup of 323, closing as such.

*** This bug has been marked as a duplicate of 323 ***