reload.c (find_reloads): Add a REG_LABEL note if we substitute a LABEL_REF for someth...
authorMark Mitchell <mark@markmitchell.com>
Mon, 15 Mar 1999 09:25:01 +0000 (09:25 +0000)
committerJeff Law <law@gcc.gnu.org>
Mon, 15 Mar 1999 09:25:01 +0000 (02:25 -0700)
Mon Mar 15 10:20:20 1999  Mark Mitchell  <mark@markmitchell.com>
        * reload.c (find_reloads): Add a REG_LABEL note if we substitute a
        LABEL_REF for something else.

From-SVN: r25777

gcc/ChangeLog
gcc/reload.c

index 88e3bd261713749dd5ab08c06dbe96b5e5de9ab5..049d7adbd8acab1272f6b57f293e402c3933e373 100644 (file)
@@ -1,3 +1,8 @@
+Mon Mar 15 10:20:20 1999  Mark Mitchell  <mark@markmitchell.com>
+
+       * reload.c (find_reloads): Add a REG_LABEL note if we substitute a
+       LABEL_REF for something else.
+
 Mon Mar 15 08:24:17 1999  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
         * fold-const.c (exact_real_inverse): Move variable `float_error'
index e424d74554a8021f14d3d4cb5d72020e92325e04..936e72fced424a637f35ae860d5a59bde3caa871 100644 (file)
@@ -3854,7 +3854,21 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
        reload_{in,out}_reg when we do these replacements.  */
 
       if (replace)
-       *recog_operand_loc[i] = substed_operand[i];
+       {
+         rtx substitution = substed_operand[i];
+
+         *recog_operand_loc[i] = substitution;
+
+         /* If we're replacing an operand with a LABEL_REF, we need
+            to make sure that there's a REG_LABEL note attached to
+            this instruction.  */
+         if (GET_CODE (insn) != JUMP_INSN
+             && GET_CODE (substitution) == LABEL_REF
+             && !find_reg_note (insn, REG_LABEL, XEXP (substitution, 0)))
+           REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_LABEL,
+                                                 XEXP (substitution, 0),
+                                                 REG_NOTES (insn));
+       }
       else
        retval |= (substed_operand[i] != *recog_operand_loc[i]);
     }