[PATCH] Fix PR77407

Marc Glisse marc.glisse@inria.fr
Fri Oct 28 18:12:00 GMT 2016


On Wed, 28 Sep 2016, Richard Biener wrote:

> The following patch implements patterns to catch x / abs (x)
> and x / -x, taking advantage of undefinedness at x == 0 as
> opposed to the PR having testcases with explicit != 0 checks.
>
> Bootstrap / regtest pending on x86_64-unknown-linux-gnu.
>
> Richard.
>
> 2016-09-28  Richard Biener  <rguenther@suse.de>
>
> 	PR middle-end/77407
> 	* match.pd: Add X / abs (X) -> X < 0 ? -1 : 1 and
> 	X / -X -> -1 simplifications.

I notice that we still have the following comment a few lines above:

/* Make sure to preserve divisions by zero.  This is the reason why
    we don't simplify x / x to 1 or 0 / x to 0.  */

Did we give up on preserving divisions by 0? Can we now do the 2 
simplifications listed by the comment?

-- 
Marc Glisse



More information about the Gcc-patches mailing list