]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
rtlanal.c (dead_or_set_regno_p): Ignore REG_DEAD notes after reload completes.
authorMike Stump <mrs@wrs.com>
Mon, 9 Feb 1998 21:20:52 +0000 (21:20 +0000)
committerJeff Law <law@gcc.gnu.org>
Mon, 9 Feb 1998 21:20:52 +0000 (14:20 -0700)
        * rtlanal.c (dead_or_set_regno_p): Ignore REG_DEAD notes after
        reload completes.
        * genattrtab.c (reload_completed, optimize): Define.

From-SVN: r17812

gcc/ChangeLog
gcc/genattrtab.c
gcc/rtlanal.c

index 5f7c7fa457ffd1355606674eafaca154f9988d75..22ec9422673770177b82a32fa71d805e5dc5f2bb 100644 (file)
@@ -1,3 +1,9 @@
+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, optimize): Define.
+
 Mon Feb  9 22:16:04 1998  J"orn Rennecke <amylaar@cygnus.co.uk>
 
        * c-decl.c (grokdeclarator): Get parameter tags from
index 8e4f423b5adbfd58dc5b1699b3e6d53aec928402..99b0f819e00c6e06f0f0346fb94d654378343fd7 100644 (file)
@@ -340,6 +340,14 @@ 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;
+
+/* Similarly since PRESERVE_DEATH_INFO_REGNO_P might reference "optimize".  */
+int optimize = 0;
+
 /* Simplify an expression.  Only call the routine if there is something to
    simplify.  */
 #define SIMPLIFY_TEST_EXP(EXP,INSN_CODE,INSN_INDEX)    \
index c8b21b847c4cf43c35138d89d999ca25b12e608c..daf57bb51d36db2987ad249ed44cec0b4c7023b8 100644 (file)
@@ -1138,19 +1138,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