]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
bb-reorder.c (function_tail_eff_head): New.
authorRichard Henderson <rth@redhat.com>
Wed, 29 Aug 2001 09:31:44 +0000 (02:31 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Wed, 29 Aug 2001 09:31:44 +0000 (02:31 -0700)
        * bb-reorder.c (function_tail_eff_head): New.
        (record_effective_endpoints): Set it.
        (fixup_reorder_chain): Use it.

From-SVN: r45255

gcc/ChangeLog
gcc/bb-reorder.c

index ea82eb5f04f57362e87d0887be0fbf70deb48119..657f68aa341812c83647f066d1cf5684dbb75829 100644 (file)
@@ -1,3 +1,9 @@
+2001-08-29  Richard Henderson  <rth@redhat.com>
+
+       * bb-reorder.c (function_tail_eff_head): New.
+       (record_effective_endpoints): Set it.
+       (fixup_reorder_chain): Use it.
+
 2001-08-28  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * dwarf2asm.c (dw2_asm_output_nstring): Fix typo in previous change.
index c75ac96988c11896ab812e1ef1eaa5a802f6120b..72d3902e7fc6f49eade319ff4ff865fc91d0817c 100644 (file)
@@ -171,6 +171,9 @@ typedef struct reorder_block_def
 
 #define RBI(BB)        ((reorder_block_def) (BB)->aux)
 
+/* Holds the interesting trailing notes for the function.  */
+static rtx function_tail_eff_head;
+
 
 /* Local function prototypes.  */
 static rtx skip_insns_after_block      PARAMS ((basic_block));
@@ -307,6 +310,7 @@ record_effective_endpoints ()
       RBI (bb)->eff_end = end;
       next_insn = NEXT_INSN (end);
     }
+  function_tail_eff_head = next_insn;
 }
 
 
@@ -580,8 +584,18 @@ fixup_reorder_chain ()
       last_bb = bb;
       bb = RBI (bb)->next;
     }
-  NEXT_INSN (RBI (last_bb)->eff_end) = NULL_RTX;
-  set_last_insn (RBI (last_bb)->eff_end);
+
+  {
+    rtx insn = RBI (last_bb)->eff_end;
+
+    NEXT_INSN (insn) = function_tail_eff_head;
+    if (function_tail_eff_head)
+      PREV_INSN (function_tail_eff_head) = insn;
+
+    while (NEXT_INSN (insn))
+      insn = NEXT_INSN (insn);
+    set_last_insn (insn);
+  }
 
   /* Now add jumps and labels as needed to match the blocks new
      outgoing edges.  */