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  <rguent...@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

Reply via email to