This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/42286] October 23rd change to tree-ssa-pre.c breaks calculix on powerpc with -ffast-math
- From: "segher at kernel dot crashing dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Jan 2010 16:42:06 -0000
- Subject: [Bug tree-optimization/42286] October 23rd change to tree-ssa-pre.c breaks calculix on powerpc with -ffast-math
- References: <bug-42286-15150@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #10 from segher at kernel dot crashing dot org 2010-01-05 16:42 -------
(In reply to comment #9)
> Right. Just it might be simpler with -fno-signed-zeros to
> transform a-b*c to 0 + -(b*c-a).
a-b*c is two machine instructions; -(b*c-a) is one. Adding
zero again makes it two, no good :-(
> Of course if the result was -0
> before then it will be +0 after either variant (and the atan2
> discontinuity would still happen even with your fix).
Sure, it's not a fix, more a band-aid: it will produce more
intuitive results when -fno-signed-zeroes is in effect, since
atan2() does care about the sign of zero, and that compiler
flag says we do not want that.
> Thus whatever "fix" the underlying problem is surely that calculix
> is not really -fno-signed-zeros safe.
Yes, certainly. It seems to me this will happen with more sloppy
code though, not just calculix.
> Can't we get lucky again
> as before by trying to recover the PRE code change?
Well, the code change actually improved the generated code
here, do we want to undo that?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42286