re PR target/82498 (Missed optimization for x86 rotate instruction)
authorJakub Jelinek <jakub@redhat.com>
Fri, 13 Oct 2017 07:28:46 +0000 (09:28 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 13 Oct 2017 07:28:46 +0000 (09:28 +0200)
commita0e4174cd80f8a17026d6c13af2802dc8a0146ad
treefb81bdf0ff4f61dd7d46f4bdb4eec0ee5d2404b1
parentef8c92e8e76b51040e0c3a37ff7dd0a3463a727d
re PR target/82498 (Missed optimization for x86 rotate instruction)

PR target/82498
* fold-const.c (fold_binary_loc) <bit_rotate>: Code cleanups,
instead of handling MINUS_EXPR twice (once for each argument),
canonicalize operand order and handle just once, use rtype where
possible.  Handle (A << B) | (A >> (-B & (Z - 1))).

* gcc.dg/tree-ssa/pr82498.c: New test.

From-SVN: r253709
gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/pr82498.c [new file with mode: 0644]