> Canonicalizes (signed x << c) >> c into the lowest > precision(type) - c bits of x IF those bits have a mode precision or a > precision of 1. Also combines this rule with (unsigned x << c) >> c -> x & > ((unsigned)-1 >> c) to prevent duplicate pattern. Tested successfully on > x86_64 and x86 targets. > > PR middle-end/101955 > > gcc/ChangeLog: > > * match.pd ((signed x << c) >> c): New canonicalization. > > gcc/testsuite/ChangeLog: > > * gcc.dg/pr101955.c: New test.
LGTM, I've committed this one for you. Jakub