aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJ"orn Rennecke <joern.rennecke@st.com>2005-04-25 12:46:12 +0000
committerJoern Rennecke <amylaar@gcc.gnu.org>2005-04-25 13:46:12 +0100
commit4c33cb26d4c5da87d48e6db6ba6832aaabf358fb (patch)
tree91a9d5e5f1890e7f54fe29873cf50968a8f566e8 /gcc
parenta26b6b94b9ea3370110bf9b86057b83646304aa8 (diff)
downloadgcc-4c33cb26d4c5da87d48e6db6ba6832aaabf358fb.zip
gcc-4c33cb26d4c5da87d48e6db6ba6832aaabf358fb.tar.gz
gcc-4c33cb26d4c5da87d48e6db6ba6832aaabf358fb.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog13
-rw-r--r--gcc/cfgrtl.c2
-rw-r--r--gcc/doc/rtl.texi5
-rw-r--r--gcc/final.c4
-rw-r--r--gcc/jump.c6
-rw-r--r--gcc/loop.c2
-rw-r--r--gcc/varasm.c2
7 files changed, 25 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4b9c7e7..2d9324e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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".
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index c1bbb1a..3ceca75 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -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);
diff --git a/gcc/doc/rtl.texi b/gcc/doc/rtl.texi
index 9858e47..f917c85 100644
--- a/gcc/doc/rtl.texi
+++ b/gcc/doc/rtl.texi
@@ -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
diff --git a/gcc/final.c b/gcc/final.c
index 5096284..0eed889 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -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));
diff --git a/gcc/jump.c b/gcc/jump.c
index 74a6c69..8cfe3b9 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -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))
diff --git a/gcc/loop.c b/gcc/loop.c
index a61c8df..eaa1bd9 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -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))
diff --git a/gcc/varasm.c b/gcc/varasm.c
index bab9437..78de840 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -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: