https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90248
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #5)
> (In reply to Jakub Jelinek from comment #4)
> > Yeah, all those look quite questionable, -fno-signed-zeros doesn't mean 0.0
> > or -0.0 won't appear, just that it shouldn't matter if 0.0 or -0.0 appears.
>
> Yeah, it means that when a is 0. or -0. the behavior can either
> match 0. > 0 ? 1. : -1. or -0. > 0 ? 1. : -1. So probably the
> cases where we negate X are OK-ish in that regard?
Well, AFAIK 0. > 0 is 0 and -0. > 0 is also 0.
And similarly 0.0 >= 0 is 1 and -0.0 >= 0 is also 1. So the a > 0 ? 1.0 : -1.0
expression is completely insensitive to signed zeros and so is a >= 0 ? 1.0 :
-1.0. With the a > 0 ? 1.0 : -1.0 to copysign (1.0, a) transformation it is
also insensitive to sign of zero, but wrong for both -0.0 and 0.0. With the a
>= 0 ? 1.0 : -1.0 to copysign (1.0, a) it is correct for +0.0 and incorrect for
-0.0, so
what has been previously insensitive to the sign of zero is now sensitive to
it.