match.pd: Simplify unsigned A - B - 1 >= A to B >= A [PR94913]
authorJakub Jelinek <jakub@redhat.com>
Fri, 8 May 2020 07:32:20 +0000 (09:32 +0200)
committerJakub Jelinek <jakub@redhat.com>
Fri, 8 May 2020 07:32:20 +0000 (09:32 +0200)
commitff33680165346cb291667f38dd2e9f25a74cc3c3
tree357d4e2d6b76e6805659de387b7d161523eaceae
parentaf1634f1b555004753a22d1124dbb8419ee095cb
match.pd: Simplify unsigned A - B - 1 >= A to B >= A [PR94913]

Implemented thusly.  The TYPE_OVERFLOW_WRAPS is there just because the
pattern above it has it too, if you want, I can throw it away from both.

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

PR tree-optimization/94913
* match.pd (A - B + -1 >= A to B >= A): New simplification.
(A - B > A to A < B): Don't test TYPE_OVERFLOW_WRAPS which is always
true for TYPE_UNSIGNED integral types.

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