[patch] for PR29921

Roger Sayle roger@eyesopen.com
Wed Nov 22 00:00:00 GMT 2006

Hi Zdenek,

On Tue, 21 Nov 2006, Zdenek Dvorak wrote:
> 	PR tree-optimization/29921
> 	* fold-const.c (operand_equal_p): Without HONOR_SIGNED_ZEROS, consider
> 	signed and unsigned zero equal.
> 	* gcc.dg/pr29921.c: New test.

Interesting.  This is OK for mainline.  But I think it would also be
a good idea to attempt to canonicalize -0.0 as 0.0 in the middle-end
when we are not honoring signed zeros.  There are several places
where transformations see that tree arg0 and arg1 are operand_equal_p
and then arbitrarily choose to use arg0 or arg1.  Although, this
shouldn't cause a problem, I think it would be nicer if we could
canonicalize trees such that later optimizers aren't surprised by
them choosing -0.0.  For example, on x87 we could probably also use
fldz to load -0.0 when using -ffast-math.



More information about the Gcc-patches mailing list