Simplification for right shift.
authorAndrew MacLeod <amacleod@redhat.com>
Thu, 14 Oct 2021 14:43:58 +0000 (10:43 -0400)
committerAndrew MacLeod <amacleod@redhat.com>
Thu, 14 Oct 2021 17:56:37 +0000 (13:56 -0400)
commitf0b7d4cc49ddb1c2c7474cc3f61e260aa93a96c0
tree71c7d4f4e47be4d9c5dd632be114c68d99fc8091
parent2c4666fb0686a8f5a55821f1527351dc71c018b4
Simplification for right shift.

When the first operand of a signed right shift is zero or negative one, the
RHS doesn't matter and the shift can be converted to a copy.

PR tree-optimization/102738
gcc/
* vr-values.c (simplify_using_ranges::simplify): Handle RSHIFT_EXPR.

gcc/testsuite
* gcc.dg/pr102738.c: New.
gcc/testsuite/gcc.dg/pr102738.c [new file with mode: 0644]
gcc/vr-values.c