[Bug middle-end/84071] [7/8 regression] wrong elimination of zero-extension after sign-extended load
ebotcazou at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Jan 30 11:39:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84071
--- Comment #9 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
The problematic code is the SUBREG case of record_dead_and_set_regs_1:
if (REG_P (dest))
{
/* If we are setting the whole register, we know its value. Otherwise
show that we don't know the value. We can handle SUBREG in
some cases. */
if (GET_CODE (setter) == SET && dest == SET_DEST (setter))
record_value_for_reg (dest, record_dead_insn, SET_SRC (setter));
else if (GET_CODE (setter) == SET
&& GET_CODE (SET_DEST (setter)) == SUBREG
&& SUBREG_REG (SET_DEST (setter)) == dest
&& known_le (GET_MODE_PRECISION (GET_MODE (dest)),
BITS_PER_WORD)
&& subreg_lowpart_p (SET_DEST (setter)))
record_value_for_reg (dest, record_dead_insn,
gen_lowpart (GET_MODE (dest),
SET_SRC (setter)));
else
record_value_for_reg (dest, record_dead_insn, NULL_RTX);
}
It's very old (RMS r357) and effectively synthesizes a wrong SET operation.
More information about the Gcc-bugs
mailing list