+2005-04-25 J"orn Rennecke <joern.rennecke@st.com>
+ Stephen Clarke <stevec@superh.com>
+ Roger Sayle <roger@eyesopen.com>
+
+ PR rtl-optimization/20413
+ * cfgrtl.c (redirect_edge_and_branch): Use Pmode instead of
+ VOIDmode for LABEL_REF.
+ * final.c (shorten_branches): Likewise.
+ * jump.c (mark_all_labels, redirect_exp_1): Likewise.
+ * loop.c (reg_dead_after_loop): Likewise.
+ * varasm.c (decode_addr_const): Likewise.
+ * doc/rtl.texi: Document mode requirement for LABEL_REF.
+
2005-04-25 Ralf Corsepius <ralf.corsepius@rtems.org>
* config.gcc (avr-*-*): Remove redundant "case".
&& GET_CODE (XEXP (SET_SRC (tmp), 2)) == LABEL_REF
&& XEXP (XEXP (SET_SRC (tmp), 2), 0) == old_label)
{
- XEXP (SET_SRC (tmp), 2) = gen_rtx_LABEL_REF (VOIDmode,
+ XEXP (SET_SRC (tmp), 2) = gen_rtx_LABEL_REF (Pmode,
new_label);
--LABEL_NUSES (old_label);
++LABEL_NUSES (new_label);
Usually that is the only mode for which a symbol is directly valid.
@findex label_ref
-@item (label_ref @var{label})
+@item (label_ref:@var{mode} @var{label})
Represents the value of an assembler label for code. It contains one
operand, an expression, which must be a @code{code_label} or a @code{note}
of type @code{NOTE_INSN_DELETED_LABEL} that appears in the instruction
The reason for using a distinct expression type for code label
references is so that jump optimization can distinguish them.
+The @code{label_ref} contains a mode, which is usually @code{Pmode}.
+Usually that is the only mode for which a label is directly valid.
+
@item (const:@var{m} @var{exp})
Represents a constant that is the result of an assembly-time
arithmetic computation. The operand, @var{exp}, is an expression that
if (min_align > LABEL_TO_ALIGNMENT (lab))
min_align = LABEL_TO_ALIGNMENT (lab);
}
- XEXP (pat, 2) = gen_rtx_LABEL_REF (VOIDmode, min_lab);
- XEXP (pat, 3) = gen_rtx_LABEL_REF (VOIDmode, max_lab);
+ XEXP (pat, 2) = gen_rtx_LABEL_REF (Pmode, min_lab);
+ XEXP (pat, 3) = gen_rtx_LABEL_REF (Pmode, max_lab);
insn_shuid = INSN_SHUID (insn);
rel = INSN_SHUID (XEXP (XEXP (pat, 0), 0));
memset (&flags, 0, sizeof (flags));
{
/* But a LABEL_REF around the REG_LABEL note, so
that we can canonicalize it. */
- rtx label_ref = gen_rtx_LABEL_REF (VOIDmode,
+ rtx label_ref = gen_rtx_LABEL_REF (Pmode,
XEXP (label_note, 0));
mark_jump_label (label_ref, insn, 0);
{
rtx n;
if (nlabel)
- n = gen_rtx_LABEL_REF (VOIDmode, nlabel);
+ n = gen_rtx_LABEL_REF (Pmode, nlabel);
else
n = gen_rtx_RETURN (VOIDmode);
else if (code == RETURN && olabel == 0)
{
if (nlabel)
- x = gen_rtx_LABEL_REF (VOIDmode, nlabel);
+ x = gen_rtx_LABEL_REF (Pmode, nlabel);
else
x = gen_rtx_RETURN (VOIDmode);
if (loc == &PATTERN (insn))
/* HACK: Must also search the loop fall through exit, create a label_ref
here which points to the loop->end, and append the loop_number_exit_labels
list to it. */
- label = gen_rtx_LABEL_REF (VOIDmode, loop->end);
+ label = gen_rtx_LABEL_REF (Pmode, loop->end);
LABEL_NEXTREF (label) = loop->exit_labels;
for (; label; label = LABEL_NEXTREF (label))
case LABEL_DECL:
x = gen_rtx_MEM (FUNCTION_MODE,
- gen_rtx_LABEL_REF (VOIDmode, force_label_rtx (target)));
+ gen_rtx_LABEL_REF (Pmode, force_label_rtx (target)));
break;
case REAL_CST: