rtlanal.c (dead_or_set_regno_p): Ignore REG_DEAD notes after reload completes.
authorMike Stump <mrs@wrs.com>
Wed, 28 Jan 1998 19:21:54 +0000 (19:21 +0000)
committerJeff Law <law@gcc.gnu.org>
Wed, 28 Jan 1998 19:21:54 +0000 (12:21 -0700)
        * rtlanal.c (dead_or_set_regno_p): Ignore REG_DEAD notes after
        reload completes.
        * genattrtab.c (reload_completed): Define.
        * m32r.md, mips.md, mn10200.md, mn10300.md, pyr.md: Remove obsolete
        comments.

From-SVN: r17542

gcc/ChangeLog
gcc/config/m32r/m32r.md
gcc/config/mips/mips.md
gcc/config/mn10200/mn10200.md
gcc/config/mn10300/mn10300.md
gcc/config/pyr/pyr.md
gcc/genattrtab.c
gcc/rtlanal.c

index c84c110820ce06e3b085c40a1310237e5d6cd83b..141302c07dfec7f6c7d9aa73fd6359a04e232b0e 100644 (file)
@@ -1,3 +1,12 @@
+1998-01-28  Mike Stump  <mrs@wrs.com>
+
+       * rtlanal.c (dead_or_set_regno_p): Ignore REG_DEAD notes after
+       reload completes.
+       * genattrtab.c (reload_completed): Define.
+
+       * m32r.md, mips.md, mn10200.md, mn10300.md, pyr.md: Remove obsolete
+       comments.
+
 Wed Jan 28 20:11:06 1998  J"orn Rennecke <amylaar@cygnus.co.uk>
 
        * reload.c (push_reload): If WORD_REGISTER_OPERATIONS, reload the
index 5e40acd3a54fa78537a71eb28100412534e190bb..4c8b2e54ffbd46e7c5c69b551b490130a3784002 100644 (file)
        {
          /* Try to use auto-inc addressing if we can.  */
          if (GET_CODE (XEXP (operands[1], 0)) == REG
-           /* ??? This is WRONG, dead_or_set_p cannot be used after reload
-              because the REG_DEAD notes are not maintained after reload.  */
              && dead_or_set_p (insn, XEXP (operands[1], 0)))
            {
              operands[1] = XEXP (operands[1], 0);
     case 3 :
       /* Try to use auto-inc addressing if we can.  */
       if (GET_CODE (XEXP (operands[0], 0)) == REG
-         /* ??? This is WRONG, dead_or_set_p cannot be used after reload
-            because the REG_DEAD notes are not maintained after reload.  */
          && dead_or_set_p (insn, XEXP (operands[0], 0)))
        {
          operands[0] = XEXP (operands[0], 0);
        {
          /* Try to use auto-inc addressing if we can.  */
          if (GET_CODE (XEXP (operands[1], 0)) == REG
-             /* ??? This is WRONG, dead_or_set_p cannot be used after reload
-                because the REG_DEAD notes are not maintained after reload.  */
              && dead_or_set_p (insn, XEXP (operands[1], 0)))
            {
              operands[1] = XEXP (operands[1], 0);
     case 3 :
       /* Try to use auto-inc addressing if we can.  */
       if (GET_CODE (XEXP (operands[0], 0)) == REG
-         /* ??? This is WRONG, dead_or_set_p cannot be used after reload
-            because the REG_DEAD notes are not maintained after reload.  */
          && dead_or_set_p (insn, XEXP (operands[0], 0)))
        {
          operands[0] = XEXP (operands[0], 0);
   [(set (mem:SI (plus:SI (match_operand:SI 0 "register_operand" "r")
                         (const_int 4)))
         (match_operand:SI 1 "register_operand" "r"))]
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
   "dead_or_set_p (insn, operands[0])"
   "st %1,@+%0"
   [(set_attr "type" "store")
index 948c7334ebb234581c4d26ddadd76bb89556fad9..f90d75b50fdf87fad0633920f40b9c44a232c1e8 100644 (file)
@@ -9771,8 +9771,6 @@ move\\t%0,%z4\\n\\
   "TARGET_MIPS16
    && GET_CODE (operands[0]) == REG
    && REGNO (operands[0]) == 24
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
    && dead_or_set_p (insn, operands[0])
    && GET_CODE (operands[1]) == REG
    && M16_REG_P (REGNO (operands[1]))"
@@ -9798,8 +9796,6 @@ move\\t%0,%z4\\n\\
   "TARGET_MIPS16 && TARGET_64BIT
    && GET_CODE (operands[0]) == REG
    && REGNO (operands[0]) == 24
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
    && dead_or_set_p (insn, operands[0])
    && GET_CODE (operands[1]) == REG
    && M16_REG_P (REGNO (operands[1]))"
@@ -9831,8 +9827,6 @@ move\\t%0,%z4\\n\\
    && REGNO (operands[1]) == 24
    && GET_CODE (operands[0]) == REG
    && M16_REG_P (REGNO (operands[0]))
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
    && dead_or_set_p (insn, operands[0])"
   "*
 {
@@ -9858,8 +9852,6 @@ move\\t%0,%z4\\n\\
    && REGNO (operands[1]) == 24
    && GET_CODE (operands[0]) == REG
    && M16_REG_P (REGNO (operands[0]))
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
    && dead_or_set_p (insn, operands[0])"
   "*
 {
index 47528aedb53a85f7e18319f43e2e0e7b0f4ef24a..90f7f8087534d99c6533b5d23742328dfec23749 100644 (file)
    (set (pc) (if_then_else (ge (cc0) (const_int 0))
                           (match_operand 1 "" "")
                           (pc)))]
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
   "dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"
   "add %0,%0\;bcc %1"
   [(set_attr "cc" "clobber")])
    (set (pc) (if_then_else (lt (cc0) (const_int 0))
                           (match_operand 1 "" "")
                           (pc)))]
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
   "dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"
   "add %0,%0\;bcs %1"
   [(set_attr "cc" "clobber")])
    (set (pc) (if_then_else (ge (cc0) (const_int 0))
                           (pc)
                           (match_operand 1 "" "")))]
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
   "dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"
   "add %0,%0\;bcs %1"
   [(set_attr "cc" "clobber")])
    (set (pc) (if_then_else (lt (cc0) (const_int 0))
                           (pc)
                           (match_operand 1 "" "")))]
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
   "dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"
   "add %0,%0\;bcc %1"
   [(set_attr "cc" "clobber")])
    (set (pc) (if_then_else (ge (cc0) (const_int 0))
                           (match_operand 1 "" "")
                           (pc)))]
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
   "dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"
   "add %0,%0\;bccx %1"
   [(set_attr "cc" "clobber")])
    (set (pc) (if_then_else (lt (cc0) (const_int 0))
                           (match_operand 1 "" "")
                           (pc)))]
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
   "dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"
   "add %0,%0\;bcsx %1"
   [(set_attr "cc" "clobber")])
    (set (pc) (if_then_else (ge (cc0) (const_int 0))
                           (pc)
                           (match_operand 1 "" "")))]
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
   "dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"
   "add %0,%0\;bcsx %1"
   [(set_attr "cc" "clobber")])
    (set (pc) (if_then_else (lt (cc0) (const_int 0))
                           (pc)
                           (match_operand 1 "" "")))]
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
   "dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"
   "add %0,%0\;bccx %1"
   [(set_attr "cc" "clobber")])
index 1747ebdb412169ae239b3b8c533fa4519d21e903..726418fba68dd8ed75598a674ca6623f494beed3 100644 (file)
    (set (pc) (if_then_else (ge (cc0) (const_int 0))
                           (match_operand 1 "" "")
                           (pc)))]
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
   "dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"
   "add %0,%0\;bcc %1"
   [(set_attr "cc" "clobber")])
    (set (pc) (if_then_else (lt (cc0) (const_int 0))
                           (match_operand 1 "" "")
                           (pc)))]
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
   "dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"
   "add %0,%0\;bcs %1"
   [(set_attr "cc" "clobber")])
    (set (pc) (if_then_else (ge (cc0) (const_int 0))
                           (pc)
                           (match_operand 1 "" "")))]
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
   "dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"
   "add %0,%0\;bcs %1"
   [(set_attr "cc" "clobber")])
    (set (pc) (if_then_else (lt (cc0) (const_int 0))
                           (pc)
                           (match_operand 1 "" "")))]
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
   "dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"
   "add %0,%0\;bcc %1"
   [(set_attr "cc" "clobber")])
index 9aeab91e169d36895313cdf85b640d7f42f8b26d..97d91014595fbf34c4dd24ad33f67d555e7092f0 100644 (file)
        (sign_extend:SI (match_dup 1)))
    (set (cc0)
        (match_dup 2))]
-;; ??? This is WRONG, dead_or_set_p cannot be used after reload
-;; because the REG_DEAD notes are not maintained after reload.
   "dead_or_set_p (insn, operands[2])"
   "*
   cc_status.flags |= CC_NO_OVERFLOW;
index 9149c12d6eb3b5326afda4bffa3b8b2e6b357ec5..f71cd4d8447aa1b345a5fa066543ff4ca5735769 100644 (file)
@@ -348,6 +348,11 @@ static rtx true_rtx, false_rtx;
 
 static char *alternative_name;
 
+/* Indicate that REG_DEAD notes are valid if dead_or_set_p is ever
+   called.  */
+
+int reload_completed = 0;
+
 /* Simplify an expression.  Only call the routine if there is something to
    simplify.  */
 #define SIMPLIFY_TEST_EXP(EXP,INSN_CODE,INSN_INDEX)    \
index bff2b6ea2e8a988d2c2bb7a1c22492807d847ed1..efb70ea61305112fa6696955fd9862274e226a03 100644 (file)
@@ -1157,19 +1157,30 @@ dead_or_set_regno_p (insn, test_regno)
   int regno, endregno;
   rtx link;
 
-  /* See if there is a death note for something that includes TEST_REGNO.  */
-  for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
+  /* REG_READ notes are not normally maintained after reload, so we
+     ignore them if the are invalid.  */
+  if (! reload_completed
+#ifdef PRESERVE_DEATH_INFO_REGNO_P
+      || PRESERVE_DEATH_INFO_REGNO_P (test_regno)
+#endif
+      )
     {
-      if (REG_NOTE_KIND (link) != REG_DEAD || GET_CODE (XEXP (link, 0)) != REG)
-       continue;
+      /* See if there is a death note for something that includes
+         TEST_REGNO.  */
+      for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
+       {
+         if (REG_NOTE_KIND (link) != REG_DEAD
+             || GET_CODE (XEXP (link, 0)) != REG)
+           continue;
 
-      regno = REGNO (XEXP (link, 0));
-      endregno = (regno >= FIRST_PSEUDO_REGISTER ? regno + 1
-                 : regno + HARD_REGNO_NREGS (regno,
-                                             GET_MODE (XEXP (link, 0))));
+         regno = REGNO (XEXP (link, 0));
+         endregno = (regno >= FIRST_PSEUDO_REGISTER ? regno + 1
+                     : regno + HARD_REGNO_NREGS (regno,
+                                                 GET_MODE (XEXP (link, 0))));
 
-      if (test_regno >= regno && test_regno < endregno)
-       return 1;
+         if (test_regno >= regno && test_regno < endregno)
+           return 1;
+       }
     }
 
   if (GET_CODE (insn) == CALL_INSN