re PR middle-end/87290 (Optimize signed x % pow2p == cst)
authorJakub Jelinek <jakub@redhat.com>
Thu, 13 Sep 2018 07:42:55 +0000 (09:42 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 13 Sep 2018 07:42:55 +0000 (09:42 +0200)
commitd51232fb3bd02f8862478fe5f1a7b0fa6751b573
tree76ec1d59f13617c835fa7cd3c63348e8a479f11f
parent392750c53e09334eb509aae4db52a4db18c413be
re PR middle-end/87290 (Optimize signed x % pow2p == cst)

PR middle-end/87290
* expr.c (maybe_optimize_pow2p_mod_cmp): New function.
(maybe_optimize_mod_cmp): Use it if integer_pow2p treeop1.

* gcc.target/i386/pr87290.c: New test.
* gcc.c-torture/execute/pr87290.c: New test.

Co-Authored-By: Kyrylo Tkachov <kyrylo.tkachov@arm.com>
From-SVN: r264261
gcc/ChangeLog
gcc/expr.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr87290.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr87290.c [new file with mode: 0644]