haifa-sched.c (create_reg_dead_note): Detect and handle another case where we kill...
authorJeff Law <law@gcc.gnu.org>
Mon, 22 Dec 1997 08:55:49 +0000 (01:55 -0700)
committerJeff Law <law@gcc.gnu.org>
Mon, 22 Dec 1997 08:55:49 +0000 (01:55 -0700)
        * haifa-sched.c (create_reg_dead_note): Detect and handle another
        case where we kill more regs after sched than were killed before
        sched.
        * sched.c (create_reg_dead_note): Similarly.

From-SVN: r17183

gcc/haifa-sched.c
gcc/sched.c

index b2545a2ace7475675fb0c85657f3e3e269c89815..02350e1941fa197adbdb326157fa7284cad7c6cd 100644 (file)
@@ -4467,6 +4467,23 @@ create_reg_dead_note (reg, insn)
       while (reg_note_regs < regs_killed)
        {
          link = XEXP (link, 1);
+
+         /* LINK might be zero if we killed more registers after scheduling
+            than before, and the last hard register we kill is actually
+            multiple hard regs. 
+
+            This is normal for interblock scheduling, so deal with it in
+            that case, else abort.  */
+         if (link == NULL_RTX && current_nr_blocks <= 1)
+           abort ();
+         else if (link == NULL_RTX)
+           {
+             link = rtx_alloc (EXPR_LIST);
+             PUT_REG_NOTE_KIND (link, REG_DEAD);
+             XEXP (link, 0) = gen_rtx (REG, word_mode, 0);
+             XEXP (link, 1) = NULL_RTX;
+           }
+            
          reg_note_regs += (REGNO (XEXP (link, 0)) >= FIRST_PSEUDO_REGISTER ? 1
                            : HARD_REGNO_NREGS (REGNO (XEXP (link, 0)),
                                                GET_MODE (XEXP (link, 0))));
index b7aa75de1eb1c9912ff965958630646abcf5b0b5..64b785f95333ba4e4da67768da19db5fb249f663 100644 (file)
@@ -2218,6 +2218,12 @@ create_reg_dead_note (reg, insn)
                                           GET_MODE (XEXP (link, 0))));
       while (reg_note_regs < regs_killed)
        {
+         /* LINK might be zero if we killed more registers after scheduling
+            than before, and the last hard register we kill is actually
+            multiple hard regs.  */
+         if (link == NULL_RTX)
+           abort ();
+  
          link = XEXP (link, 1);
          reg_note_regs += (REGNO (XEXP (link, 0)) >= FIRST_PSEUDO_REGISTER ? 1
                            : HARD_REGNO_NREGS (REGNO (XEXP (link, 0)),