8
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 2 Dec 1998 09:14:57 +0000 (09:14 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 2 Dec 1998 09:14:57 +0000 (09:14 +0000)
        * flow.c (delete_block): Call set_last_insn after we have reset
        NEXT_INSN (kept_tail).

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@24059 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/flow.c

index 825bf22..cc76a9c 100644 (file)
@@ -1026,11 +1026,15 @@ delete_block (i)
       NEXT_INSN (PREV_INSN (basic_block_head[i])) = kept_head;
       if (insn != 0)
        PREV_INSN (insn) = kept_tail;
-      else
-       set_last_insn (kept_tail);
 
       PREV_INSN (kept_head) = PREV_INSN (basic_block_head[i]);
       NEXT_INSN (kept_tail) = insn;
+
+      /* This must happen after NEXT_INSN (kept_tail) has been reinitialized
+        since set_last_insn will abort if it detects a non-NULL NEXT_INSN
+        field in its argument.  */
+      if (insn == NULL_RTX)
+       set_last_insn (kept_tail);
     }
 
   /* Each time we delete some basic blocks,