https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106746
--- Comment #7 from H.J. Lu <hjl.tools at gmail dot com> --- Specifically, /* We can canonicalize SIGN_EXTEND (op) as ZERO_EXTEND (op) when we know the sign bit of OP must be clear. */ if (val_signbit_known_clear_p (GET_MODE (op), nonzero_bits (op, GET_MODE (op)))) return simplify_gen_unary (ZERO_EXTEND, mode, op, GET_MODE (op)); triggers the failure.