[Bug tree-optimization/42286] October 23rd change to tree-ssa-pre.c breaks calculix on powerpc with -ffast-math

segher at kernel dot crashing dot org gcc-bugzilla@gcc.gnu.org
Tue Jan 5 16:42:00 GMT 2010



------- 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



More information about the Gcc-bugs mailing list