reload1.c (eliminate_regs): Don't keep REG_DEAD notes around for things that were...
authorJ"orn Rennecke <amylaar@cygnus.co.uk>
Wed, 17 Mar 1999 13:31:30 +0000 (13:31 +0000)
committerJoern Rennecke <amylaar@gcc.gnu.org>
Wed, 17 Mar 1999 13:31:30 +0000 (13:31 +0000)
* reload1.c (eliminate_regs): Don't keep REG_DEAD notes around for
things that were eliminated.

From-SVN: r25823

gcc/ChangeLog
gcc/reload1.c

index 831320fa040c5e6e24ed56ff5ad7f729312ef201..ac3b77398292b2a4e1cfe02f13e8be5a8434d18f 100644 (file)
@@ -1,3 +1,8 @@
+Wed Mar 17 21:29:12 1999  J"orn Rennecke <amylaar@cygnus.co.uk>
+
+       * reload1.c (eliminate_regs): Don't keep REG_DEAD notes around for
+       things that were eliminated.
+
 Wed Mar 17 12:16:26 1999  Richard Henderson  <rth@cygnus.com>
 
        * function.c (fixup_var_refs_1): First try moving the expression
index 1e83d5fe4be18e327274ce3bc68253ad46db66f7..02002fdd23dcfb6778c06a198144d9e406d7fa3b 100644 (file)
@@ -2914,7 +2914,17 @@ eliminate_regs (x, mem_mode, insn)
        {
          new = eliminate_regs (XEXP (x, 0), mem_mode, insn);
          if (new != XEXP (x, 0))
-           x = gen_rtx_EXPR_LIST (REG_NOTE_KIND (x), new, XEXP (x, 1));
+           {
+             /* If this is a REG_DEAD note, it is not valid anymore.
+                Using the eliminated version could result in creating a
+                REG_DEAD note for the stack or frame pointer.  */
+             if (GET_MODE (x) == REG_DEAD)
+               return (XEXP (x, 1)
+                       ? eliminate_regs (XEXP (x, 1), mem_mode, insn)
+                       : NULL_RTX);
+
+             x = gen_rtx_EXPR_LIST (REG_NOTE_KIND (x), new, XEXP (x, 1));
+           }
        }
 
       /* ... fall through ...  */