summaryrefslogtreecommitdiff
path: root/gcc/bb-reorder.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2001-08-29 02:31:44 -0700
committerRichard Henderson <rth@gcc.gnu.org>2001-08-29 02:31:44 -0700
commita7b01a4bf1537bc20459fbc2467c95bef9147c83 (patch)
tree24fd9efa04c81a860a36bba92bac52734b3833f9 /gcc/bb-reorder.c
parentc43f84d7ced26730f6ca327e9007846aaa715783 (diff)
downloadgcc-a7b01a4bf1537bc20459fbc2467c95bef9147c83.tar.gz
bb-reorder.c (function_tail_eff_head): New.
* bb-reorder.c (function_tail_eff_head): New. (record_effective_endpoints): Set it. (fixup_reorder_chain): Use it. From-SVN: r45255
Diffstat (limited to 'gcc/bb-reorder.c')
-rw-r--r--gcc/bb-reorder.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
index c75ac96988c..72d3902e7fc 100644
--- a/gcc/bb-reorder.c
+++ b/gcc/bb-reorder.c
@@ -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. */