https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128910

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |law at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

--- Comment #1 from Jeffrey A. Law <law at gcc dot gnu.org> ---
So bisection lands on:

commit 900b5386f501f1b108959f93b0073842ebde3eea (HEAD)
Author: Jeff Law <[email protected]>
Date:   Mon May 18 15:24:02 2026 -0600

    [RISC-V] Improve SI->DI zero/sign extension patterns for RISC-V
[ ... ]

But I think that's just exposing a long latent bug in gcse (so, ironically, I'm
likely still to blame in the end).

In gcse we see two subreg expressions with different extension states we
consider them equivalent, emit representative version at the right point before
the loop to make the other redundant.  We remove the redundant one naturally.

Now we have an insn with incorrect promotion state in the IL.  A few passes
later combine see that incorrect promotion state which causes nonzero_bits to
return the wrong value in combine thus ultimately leading combine to
incorrectly the high 32 bits are already zero'd out and thus it drops the shift
pair that zeros them out.

Testing a fix.

Reply via email to