This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/37390] wrong-code on i486-linux-gnu with -O[12], -O0 works
- From: "niklaus at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Sep 2008 21:24:02 -0000
- Subject: [Bug target/37390] wrong-code on i486-linux-gnu with -O[12], -O0 works
- References: <bug-37390-11764@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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