https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120050
--- Comment #7 from Jeffrey A. Law <law at gcc dot gnu.org> --- I'd forgotten about the MIPS quirks WRT promoted values. While you can have a value in a register without promotion, you can't *use* that value validly, even if it may otherwise appear to be safe to do so. On a target that doesn't set MODE_REP_EXTENDED, the transformation is valid because nothing should have looked at bits 32..63 of r431. So transforming the sign_extend into a simple subreg is safe. Transforming the sign_extend into a subreg destroys knowledge of the SUBREG_PROMOTED state of the (subreg/s/u:SI (reg:DI 523) 0), so we clear the SUBREG_PROMOTED state of that node. However on a MODE_REP_EXTENDED target the transformation is not safe because the comparison may look at bits outside the given mode (ie, for an SImode comparison the hardware may actually look a bits 32..63). I suspect ext-dce is simply not suitable for a MODE_REP_EXTENDED target and should be disabled (in ext-dce.cc rather than in the target itself).