OSDN Git Service

* reg-stack.c (emit_swap_insn): Do not put a new insn before a
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Feb 2000 04:34:02 +0000 (04:34 +0000)
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Feb 2000 04:34:02 +0000 (04:34 +0000)
NOTE_BASIC_BLOCK.

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

gcc/ChangeLog
gcc/reg-stack.c

index a7b6c52..3c559e1 100644 (file)
@@ -1,5 +1,8 @@
 2000-02-16  Zack Weinberg  <zack@wolery.cumb.org>
 
+       * reg-stack.c (emit_swap_insn): Do not put a new insn before a
+       NOTE_BASIC_BLOCK.
+
        * flow.c (dump_regset, debug_regset, dump_bb, debug_bb,
        debug_bb_n): New functions.
        (dump_flow_info, print_rtl_with_bb): Use dump_regset.
index 70e877b..77d52ea 100644 (file)
@@ -973,7 +973,8 @@ emit_swap_insn (insn, regstack, reg)
   if (current_block && insn != current_block->head)
     {
       rtx tmp = PREV_INSN (insn);
-      while (tmp != current_block->head)
+      rtx limit = PREV_INSN (current_block->head);
+      while (tmp != limit)
        {
          if (GET_CODE (tmp) == CODE_LABEL
              || (GET_CODE (tmp) == NOTE
@@ -1017,10 +1018,7 @@ emit_swap_insn (insn, regstack, reg)
   if (i1)
     emit_block_insn_after (swap_rtx, i1, current_block);
   else if (current_block)
-    {
-      i1 = emit_insn_before (swap_rtx, current_block->head);
-      current_block->head = i1;
-    }
+    emit_block_insn_before (swap_rtx, current_block->head, current_block);
   else
     emit_insn_before (swap_rtx, insn);
 }