re PR rtl-optimization/20413 (VOIDmode LABEL_REFs are generated)
authorJ"orn Rennecke <joern.rennecke@st.com>
Mon, 25 Apr 2005 12:46:12 +0000 (12:46 +0000)
committerJoern Rennecke <amylaar@gcc.gnu.org>
Mon, 25 Apr 2005 12:46:12 +0000 (13:46 +0100)
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

gcc/ChangeLog
gcc/cfgrtl.c
gcc/doc/rtl.texi
gcc/final.c
gcc/jump.c
gcc/loop.c
gcc/varasm.c

index 4b9c7e7996d9563dc8783ba247bed3728f74f3f8..2d9324e6192659e0060c6079dd3915843e3b818e 100644 (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".
index c1bbb1a52aa4a3eb471d3098ac06faf26c56f0fc..3ceca75f7e382e27449be01932d0a695fd62cc73 100644 (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);
index 9858e47c767bd99d455dcb59675f3f3c6a6b467f..f917c85e016050458a02e3b66289669a056df16d 100644 (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
index 50962840d37c88a916eb3a454fe87616145afb7f..0eed8893834e6c17eff99089c3acda364d17e7aa 100644 (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));
index 74a6c69b861220ea67a4deba66abf788456a91d9..8cfe3b9bcfd556eced267f8648b44797483a016e 100644 (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))
index a61c8dfbb5dcd5d0d998dd9ad9eca55ccc259331..eaa1bd931b74900bd099b62f332c34137e152d2e 100644 (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))
index bab9437ec0a8d65af8408e6aa1829ee5305a0a4a..78de840ce56bdba7ecc30d1a3b59ad4e32fbca25 100644 (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: