https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85300
--- Comment #5 from Segher Boessenkool <segher at gcc dot gnu.org> ---
There also is
/* We don't have to handle SIGN_EXTEND here, because even in the
case of replacing something with a modeless CONST_INT, a
CONST_INT is already (supposed to be) a valid sign extension for
its narrower mode, which implies it's already properly
sign-extended for the wider mode. Now, for ZERO_EXTEND, the
story is different. */
This invalid sharing was never handled before?