flow.c (find_basic_blocks_1): Do not delete the first bb_note we run across.
authorRichard Henderson <rth@cygnus.com>
Wed, 10 May 2000 05:48:40 +0000 (22:48 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Wed, 10 May 2000 05:48:40 +0000 (22:48 -0700)
        * flow.c (find_basic_blocks_1): Do not delete the first
        bb_note we run across.
        (create_basic_block): Use reorder_insns to move an existing
        bb_note to the correct place.

From-SVN: r33814

gcc/ChangeLog
gcc/flow.c

index e91f0b2ed7e82277d0e3003daf39532034b3bab4..ea8972bdb6ee974a588885ec8265d1c72af1a220 100644 (file)
@@ -1,3 +1,10 @@
+2000-05-09  Richard Henderson  <rth@cygnus.com>
+
+       * flow.c (find_basic_blocks_1): Do not delete the first
+       bb_note we run across.
+       (create_basic_block): Use reorder_insns to move an existing
+       bb_note to the correct place.
+
 2000-05-09  Richard Henderson  <rth@cygnus.com>
 
        * calls.c (expand_call): Increment currently_expanding_call
index f52878022545c6f3434703ec4a16022f48ad3ea2..239c70f4d30b4d8dd31c29e2150e8422219a6be0 100644 (file)
@@ -584,8 +584,8 @@ find_basic_blocks_1 (f)
              {
                if (bb_note == NULL_RTX)
                  bb_note = insn;
-
-               next = flow_delete_insn (insn);
+               else
+                 next = flow_delete_insn (insn);
              }
            break;
          }
@@ -780,13 +780,18 @@ create_basic_block (index, head, end, bb_note)
     {
       /* If we found an existing note, thread it back onto the chain.  */
 
+      rtx after;
+
       if (GET_CODE (head) == CODE_LABEL)
-       add_insn_after (bb_note, head);
+       after = head;
       else
        {
-         add_insn_before (bb_note, head);
+         after = PREV_INSN (head);
          head = bb_note;
        }
+
+      if (after != bb_note && NEXT_INSN (after) != bb_note)
+       reorder_insns (bb_note, bb_note, after);
     }
   else
     {