re PR tree-optimization/67351 (Missed optimisation on 64-bit field compared to 32...
authorNaveen H.S <Naveen.Hurugalawadi@caviumnetworks.com>
Thu, 3 Sep 2015 10:20:03 +0000 (10:20 +0000)
committerNaveen H.S <naveenh@gcc.gnu.org>
Thu, 3 Sep 2015 10:20:03 +0000 (10:20 +0000)
commit12085390166594050f02780cbd49a3967ecef882
tree5015382f1627fbd7120f8d8be9eb4c48b0135017
parent27e2bd9f396088dc3642eb7d85eb424cc402c059
re PR tree-optimization/67351 (Missed optimisation on 64-bit field compared to 32-bit)

2015-09-03  Naveen H.S  <Naveen.Hurugalawadi@caviumnetworks.com>

PR middle-end/67351

gcc/ChangeLog:
* fold-const.c (fold_binary_loc) : Move
Transform (x >> c) << c into x & (-1<<c) or
transform (x << c) >> c into x & ((unsigned)-1 >> c) for unsigned
types using simplify and match.
* match.pd (lshift (rshift @0 INTEGER_CST@1) @1) : New simplifier.
(rshift (lshift @0 INTEGER_CST@1) @1) : New Simplifier.

gcc/testsuite/ChangeLog:
* g++.dg/pr66752-2.C: New test.

From-SVN: r227432
gcc/ChangeLog
gcc/fold-const.c
gcc/match.pd
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/pr67351.C [new file with mode: 0644]