re PR middle-end/82853 (Optimize x % 3 == 0 without modulo)
authorJakub Jelinek <jakub@redhat.com>
Wed, 12 Sep 2018 18:28:20 +0000 (20:28 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 12 Sep 2018 18:28:20 +0000 (20:28 +0200)
commitc0cbe5260fab673f7cd755df2226422b88b28837
tree80f2a40dc45418305b5aabf0aed406735df224de
parent8e36332cf65b4ec5a1ea6b4b3a6ae8cb6ed9f455
re PR middle-end/82853 (Optimize x % 3 == 0 without modulo)

PR middle-end/82853
* expr.h (maybe_optimize_mod_cmp): Declare.
* expr.c (mod_inv): New function.
(maybe_optimize_mod_cmp): New function.
(do_store_flag): Use it.
* cfgexpand.c (expand_gimple_cond): Likewise.

* gcc.target/i386/pr82853-1.c: New test.
* gcc.target/i386/pr82853-2.c: New test.

From-SVN: r264248
gcc/ChangeLog
gcc/cfgexpand.c
gcc/expr.c
gcc/expr.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr82853-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr82853-2.c [new file with mode: 0644]