https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113010
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Last reconfirmed| |2024-01-09 Target Milestone|--- |13.3 --- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #4) > (In reply to Greg McGary from comment #3) > > This fixes it, though I would like second look from someone more familiar > > with the combiner: > > I almost sure this is still an issue with WORD_REGISTER_OPERATIONS . That is this is missing that check: ``` /* Convert sign extension to zero extension, if we know that the high bit is not set, as this is easier to optimize. It will be converted back to cheaper alternative in make_extraction. */ if (GET_CODE (x) == SIGN_EXTEND && HWI_COMPUTABLE_MODE_P (mode) && ((nonzero_bits (XEXP (x, 0), inner_mode) & ~(((unsigned HOST_WIDE_INT) GET_MODE_MASK (inner_mode)) >> 1)) == 0)) ``` Should most likely need the same check as what was added in r14-6806 . And yes it a similar bug dealing with WORD_REGISTER_OPERATIONS which is why I thought it was the same.