Simplify x >> x to 0. This fixes PR96701.
authorEugene Rozenfeld <erozen@microsoft.com>
Fri, 6 Nov 2020 03:35:45 +0000 (20:35 -0700)
committerJeff Law <law@redhat.com>
Fri, 6 Nov 2020 03:35:45 +0000 (20:35 -0700)
commit6483f05989ef31ebf2583deeb4753211ca2b7e17
tree8c0622b9a031143be1cf642c310c5af5788b9080
parent56ecdc2f02bfa69021003d7ac267dc65f385902f
Simplify x >> x to 0. This fixes PR96701.

gcc/
* match.pd (x >> x): New pattern.

gcc/testsuite

* gcc.dg/self-right-shift.c: New test.
gcc/match.pd
gcc/testsuite/gcc.dg/self-right-shift.c [new file with mode: 0644]