[Bug target/37390] wrong-code on i486-linux-gnu with -O[12], -O0 works

niklaus at gmail dot com gcc-bugzilla@gcc.gnu.org
Sat Sep 6 21:25:00 GMT 2008



------- Comment #10 from niklaus at gmail dot com  2008-09-06 21:23 -------
(In reply to comment #8)
> (In reply to comment #7)
> > Does increasing bits cause floating point errors. How could 64 bit precison
> > give correct result where as 80 bit give incorrect one.
> 
> You can have rounding errors whether you increase the precision or not. In
> particular, in practice, function pow() is not correctly rounded, and worse,
> the error may be quite high. So, I'd say that whatever the choice made by
> Linux, your code may be regarded as wrong (and I think this bug is just
> invalid, as you could have similar problems with SSE2).

The funny thing is that this only happens with -O2 or -O1 but not with -O0 ie
no optimization it is all correct , when we optimize the results start varying.

> 
> > junk@edubuntu:~/prog/tju$ gcc -O2 -mfpmath=sse bug_short.c -lm
> > bug_short.c:1: warning: SSE instruction set disabled, using 387 arithmetics
> 
> You probably need another compilation flag, like -march=pentium4.
> 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37390



More information about the Gcc-bugs mailing list