https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106594
Hans-Peter Nilsson <hp at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hp at gcc dot gnu.org
--- Comment #7 from Hans-Peter Nilsson <hp at gcc dot gnu.org> ---
(In reply to Roger Sayle from comment #5)
> I'm sure if GCC instead canonicalized to the sign_extend form, that other
> targets would show similar asymmetries (it's only when things change that
> anyone notices the difference). I'll see if I can come up with a fix over
> the weekend.
Maybe I'm hallucinating and I'm certainly late to the game, but perhaps a
REG_NONNEGATIVE note can be added on the insn for the target register when
doing the AND transformation and then combine can be improved to try to replace
ZERO_EXTEND with SIGN_EXTEND when seeing this note on the applicable input
operand?