PR middle-end/62263
commit9317336c706d2a8d73c882e909e5e796b6200fa5
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 14 Oct 2017 18:47:14 +0000 (14 18:47 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 14 Oct 2017 18:47:14 +0000 (14 18:47 +0000)
treeb18c1cc33cf45585ac6de0923741e82e5015179b
parent0bc087fa0e59ada43dccbcc09ed2d4b405a15b18
PR middle-end/62263
PR middle-end/82498
* tree-ssa-forwprop.c (simplify_rotate): Allow def_arg1[N]
to be any operand_equal_p operands.  For & (B - 1) require
B to be power of 2.  Recognize
(X << (Y & (B - 1))) | (X >> ((-Y) & (B - 1))) and similar patterns.

* c-c++-common/rotate-5.c (f2): New function.  Move old
function to ...
(f4): ... this.  Use 127 instead of 128.
(f3, f5, f6): New functions.
(main): Test all f[1-6] functions, with both 0 and 1 as
second arguments.
* c-c++-common/rotate-6.c: New test.
* c-c++-common/rotate-6a.c: New test.
* c-c++-common/rotate-7.c: New test.
* c-c++-common/rotate-7a.c: New test.
* c-c++-common/rotate-8.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@253760 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/rotate-5.c
gcc/testsuite/c-c++-common/rotate-6.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/rotate-6a.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/rotate-7.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/rotate-7a.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/rotate-8.c [new file with mode: 0644]
gcc/tree-ssa-forwprop.c