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
This commit is contained in:
J"orn Rennecke 2005-04-25 12:46:12 +00:00 committed by Joern Rennecke
parent a26b6b94b9
commit 4c33cb26d4
7 changed files with 25 additions and 9 deletions

View File

@ -1,3 +1,16 @@
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".

View File

@ -904,7 +904,7 @@ redirect_branch_edge (edge e, basic_block target)
&& 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);

View File

@ -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.
@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
@ -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
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

View File

@ -953,8 +953,8 @@ shorten_branches (rtx first ATTRIBUTE_UNUSED)
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));

View File

@ -209,7 +209,7 @@ mark_all_labels (rtx f)
{
/* 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);
@ -1543,7 +1543,7 @@ redirect_exp_1 (rtx *loc, rtx olabel, rtx nlabel, rtx insn)
{
rtx n;
if (nlabel)
n = gen_rtx_LABEL_REF (VOIDmode, nlabel);
n = gen_rtx_LABEL_REF (Pmode, nlabel);
else
n = gen_rtx_RETURN (VOIDmode);
@ -1554,7 +1554,7 @@ redirect_exp_1 (rtx *loc, rtx olabel, rtx nlabel, rtx insn)
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))

View File

@ -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
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))

View File

@ -2309,7 +2309,7 @@ decode_addr_const (tree exp, struct addr_const *value)
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: