match.pd: Fold x == ~x to false [PR96782]
authorJakub Jelinek <jakub@redhat.com>
Mon, 4 Jan 2021 09:37:12 +0000 (10:37 +0100)
committerJakub Jelinek <jakub@redhat.com>
Mon, 4 Jan 2021 09:37:12 +0000 (10:37 +0100)
commitad64e807ffca93e927b68f1aa0cea54dacbe9afd
treedf2024baac99aadb23527ff59bd90a761609faaa
parent99dee82307f1e163e150c9c810452979994047ce
match.pd: Fold x == ~x to false [PR96782]

x is never equal to ~x, so we can fold such comparisons to constants.

2021-01-04  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/96782
* match.pd (x == ~x -> false, x != ~x -> true): New simplifications.

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