match.pd: Optimize (x < 0) != (y < 0) into (x ^ y) < 0 [PR94718]
authorJakub Jelinek <jakub@redhat.com>
Mon, 4 May 2020 09:03:32 +0000 (11:03 +0200)
committerJakub Jelinek <jakub@redhat.com>
Mon, 4 May 2020 09:03:32 +0000 (11:03 +0200)
commit6b5c7ee0df6b87780f2fd6f2c5759a04e6eed1fe
treead20e71284b9b89bbcf272c547c50ab0d8c754f9
parent496f4f884716ae061f771a62e44868a32dbd502f
match.pd: Optimize (x < 0) != (y < 0) into (x ^ y) < 0 [PR94718]

The following patch (on top of the two other PR94718 patches) performs the
actual optimization requested in the PR.

2020-05-04  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/94718
* match.pd ((X < 0) != (Y < 0) into (X ^ Y) < 0): New simplification.

* gcc.dg/tree-ssa/pr94718-4.c: New test.
* gcc.dg/tree-ssa/pr94718-5.c: New test.
gcc/ChangeLog
gcc/match.pd
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/pr94718-4.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/pr94718-5.c [new file with mode: 0644]