Commit 4c33cb26 by J"orn Rennecke Committed by Joern Rennecke

re PR rtl-optimization/20413 (VOIDmode LABEL_REFs are generated)

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.

Co-Authored-By: Roger Sayle <roger@eyesopen.com>
Co-Authored-By: Stephen Clarke <stevec@superh.com>

From-SVN: r98711
parent a26b6b94
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> 2005-04-25 Ralf Corsepius <ralf.corsepius@rtems.org>
* config.gcc (avr-*-*): Remove redundant "case". * config.gcc (avr-*-*): Remove redundant "case".
......
...@@ -904,7 +904,7 @@ redirect_branch_edge (edge e, basic_block target) ...@@ -904,7 +904,7 @@ redirect_branch_edge (edge e, basic_block target)
&& GET_CODE (XEXP (SET_SRC (tmp), 2)) == LABEL_REF && GET_CODE (XEXP (SET_SRC (tmp), 2)) == LABEL_REF
&& XEXP (XEXP (SET_SRC (tmp), 2), 0) == old_label) && 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); new_label);
--LABEL_NUSES (old_label); --LABEL_NUSES (old_label);
++LABEL_NUSES (new_label); ++LABEL_NUSES (new_label);
......
...@@ -1390,7 +1390,7 @@ The @code{symbol_ref} contains a mode, which is usually @code{Pmode}. ...@@ -1390,7 +1390,7 @@ The @code{symbol_ref} contains a mode, which is usually @code{Pmode}.
Usually that is the only mode for which a symbol is directly valid. Usually that is the only mode for which a symbol is directly valid.
@findex label_ref @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 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} 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 of type @code{NOTE_INSN_DELETED_LABEL} that appears in the instruction
...@@ -1399,6 +1399,9 @@ sequence to identify the place where the label should go. ...@@ -1399,6 +1399,9 @@ sequence to identify the place where the label should go.
The reason for using a distinct expression type for code label The reason for using a distinct expression type for code label
references is so that jump optimization can distinguish them. 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}) @item (const:@var{m} @var{exp})
Represents a constant that is the result of an assembly-time Represents a constant that is the result of an assembly-time
arithmetic computation. The operand, @var{exp}, is an expression that arithmetic computation. The operand, @var{exp}, is an expression that
......
...@@ -953,8 +953,8 @@ shorten_branches (rtx first ATTRIBUTE_UNUSED) ...@@ -953,8 +953,8 @@ shorten_branches (rtx first ATTRIBUTE_UNUSED)
if (min_align > LABEL_TO_ALIGNMENT (lab)) if (min_align > LABEL_TO_ALIGNMENT (lab))
min_align = LABEL_TO_ALIGNMENT (lab); min_align = LABEL_TO_ALIGNMENT (lab);
} }
XEXP (pat, 2) = gen_rtx_LABEL_REF (VOIDmode, min_lab); XEXP (pat, 2) = gen_rtx_LABEL_REF (Pmode, min_lab);
XEXP (pat, 3) = gen_rtx_LABEL_REF (VOIDmode, max_lab); XEXP (pat, 3) = gen_rtx_LABEL_REF (Pmode, max_lab);
insn_shuid = INSN_SHUID (insn); insn_shuid = INSN_SHUID (insn);
rel = INSN_SHUID (XEXP (XEXP (pat, 0), 0)); rel = INSN_SHUID (XEXP (XEXP (pat, 0), 0));
memset (&flags, 0, sizeof (flags)); memset (&flags, 0, sizeof (flags));
......
...@@ -209,7 +209,7 @@ mark_all_labels (rtx f) ...@@ -209,7 +209,7 @@ mark_all_labels (rtx f)
{ {
/* But a LABEL_REF around the REG_LABEL note, so /* But a LABEL_REF around the REG_LABEL note, so
that we can canonicalize it. */ 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)); XEXP (label_note, 0));
mark_jump_label (label_ref, insn, 0); mark_jump_label (label_ref, insn, 0);
...@@ -1543,7 +1543,7 @@ redirect_exp_1 (rtx *loc, rtx olabel, rtx nlabel, rtx insn) ...@@ -1543,7 +1543,7 @@ redirect_exp_1 (rtx *loc, rtx olabel, rtx nlabel, rtx insn)
{ {
rtx n; rtx n;
if (nlabel) if (nlabel)
n = gen_rtx_LABEL_REF (VOIDmode, nlabel); n = gen_rtx_LABEL_REF (Pmode, nlabel);
else else
n = gen_rtx_RETURN (VOIDmode); n = gen_rtx_RETURN (VOIDmode);
...@@ -1554,7 +1554,7 @@ redirect_exp_1 (rtx *loc, rtx olabel, rtx nlabel, rtx insn) ...@@ -1554,7 +1554,7 @@ redirect_exp_1 (rtx *loc, rtx olabel, rtx nlabel, rtx insn)
else if (code == RETURN && olabel == 0) else if (code == RETURN && olabel == 0)
{ {
if (nlabel) if (nlabel)
x = gen_rtx_LABEL_REF (VOIDmode, nlabel); x = gen_rtx_LABEL_REF (Pmode, nlabel);
else else
x = gen_rtx_RETURN (VOIDmode); x = gen_rtx_RETURN (VOIDmode);
if (loc == &PATTERN (insn)) if (loc == &PATTERN (insn))
......
...@@ -5074,7 +5074,7 @@ reg_dead_after_loop (const struct loop *loop, rtx reg) ...@@ -5074,7 +5074,7 @@ reg_dead_after_loop (const struct loop *loop, rtx reg)
/* HACK: Must also search the loop fall through exit, create a label_ref /* 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 here which points to the loop->end, and append the loop_number_exit_labels
list to it. */ 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; LABEL_NEXTREF (label) = loop->exit_labels;
for (; label; label = LABEL_NEXTREF (label)) for (; label; label = LABEL_NEXTREF (label))
......
...@@ -2309,7 +2309,7 @@ decode_addr_const (tree exp, struct addr_const *value) ...@@ -2309,7 +2309,7 @@ decode_addr_const (tree exp, struct addr_const *value)
case LABEL_DECL: case LABEL_DECL:
x = gen_rtx_MEM (FUNCTION_MODE, 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; break;
case REAL_CST: case REAL_CST:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment