Re: [PATCH] match.pd: Implement missed optimization (x << c) >> c -> -(x & 1) [PR101955]

2023-07-20 Thread Drew Ross via Gcc-bugs
My mailer clipped off the top of the commit message: Simplifies (x << c) >> c where x is a signed integral type of width >= int and c = precision(type) - 1 into -(x & 1). Tested successfully on x86_64 and x86 targets. PR middle-end/101955 gcc/ChangeLog: * match.pd (x << c) >> c

[PATCH] match.pd: Implement missed optimization (x << c) >> c -> -(x & 1) [PR101955]

2023-07-20 Thread Drew Ross via Gcc-bugs
PR middle-end/101955 gcc/ChangeLog: * match.pd (x << c) >> c -> -(x & 1): New simplification. gcc/testsuite/ChangeLog: * gcc.dg/pr101955.c: New test. --- gcc/match.pd| 9 + gcc/testsuite/gcc.dg/pr101955.c | 62 +