This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [4.2 only] RFA: PR 33848: reload rematerialisation of labels
> Well, we build jump labels immediately after expanding, and try to keep
> them up-to-date when changing jumps later. Not keeping them up-to-date
> would be a bug.
It's 4.2.x so we have to be conservative and avoid pulling too long a string,
that's why I would go for a very safe change in this case.
The original code was:
+ /* If we're replacing a LABEL_REF with a register, add a
+ REG_LABEL note to indicate to flow which label this
+ register refers to. */
+ if (GET_CODE (*r->where) == LABEL_REF
+ && GET_CODE (insn) == JUMP_INSN)
+ REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_LABEL,
+ XEXP (*r->where, 0),
+ REG_NOTES (insn));
Then it was modified as follows
@@ -6033,9 +6033,12 @@ subst_reloads (rtx insn)
register refers to. */
if (GET_CODE (*r->where) == LABEL_REF
&& JUMP_P (insn))
- REG_NOTES (insn) = gen_rtx_INSN_LIST (REG_LABEL,
- XEXP (*r->where, 0),
- REG_NOTES (insn));
+ {
+ REG_NOTES (insn) = gen_rtx_INSN_LIST (REG_LABEL,
+ XEXP (*r->where, 0),
+ REG_NOTES (insn));
+ JUMP_LABEL (insn) = XEXP (*r->where, 0);
+ }
/* Encapsulate RELOADREG so its machine mode matches what
used to be there. Note that gen_lowpart_common will
I'm afraid your change would void the original intent in the name of fixing
the subsequent modification. Couldn't we find a middle-ground instead?
--
Eric Botcazou