]> gcc.gnu.org Git - gcc.git/commit
match.pd: Canonicalize (signed x << c) >> c [PR101955]
authorDrew Ross <drross@redhat.com>
Fri, 4 Aug 2023 07:08:05 +0000 (09:08 +0200)
committerJakub Jelinek <jakub@redhat.com>
Fri, 4 Aug 2023 07:08:05 +0000 (09:08 +0200)
commit9020da78df2854f14f8b1d38b58a6d3b77a4b731
tree945dddb19a047a8c4211bc57a8cb3a83f70930c8
parent236ec7aac051a062dc961b3c1482925893ee6e21
match.pd: Canonicalize (signed x << c) >> c [PR101955]

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.

PR middle-end/101955
* match.pd ((signed x << c) >> c): New canonicalization.

* gcc.dg/pr101955.c: New test.
gcc/match.pd
gcc/testsuite/gcc.dg/pr101955.c [new file with mode: 0644]
This page took 0.062131 seconds and 5 git commands to generate.