On 7/21/23 11:27, Andrew Pinski via Gcc-patches wrote:
On Fri, Jul 21, 2023 at 8:09 AM Drew Ross via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:

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.

Thinking about this some more, I think this should be handled in
expand rather than on the gimple level.
It is very much related to PR 110717 even. We are basically truncating
to a signed one bit integer and then sign extending that across the
whole code.
But why defer it to expand? This idiom is going to generate a -1,0 result which is definitely interesting from a further simplification standpoint.

Jeff

Reply via email to