aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/gcc/function.c b/gcc/function.c
index 36c874f..39fa22a 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -6270,8 +6270,10 @@ thread_prologue_and_epilogue_insns (void)
break;
if (e)
{
- copy_bb = create_basic_block (NEXT_INSN (BB_END (e->src)),
- NULL_RTX, e->src);
+ /* Make sure we insert after any barriers. */
+ rtx end = get_last_bb_insn (e->src);
+ copy_bb = create_basic_block (NEXT_INSN (end),
+ NULL_RTX, e->src);
BB_COPY_PARTITION (copy_bb, e->src);
}
else
@@ -6538,7 +6540,7 @@ epilogue_done:
basic_block simple_return_block_cold = NULL;
edge pending_edge_hot = NULL;
edge pending_edge_cold = NULL;
- basic_block exit_pred = EXIT_BLOCK_PTR->prev_bb;
+ basic_block exit_pred;
int i;
gcc_assert (entry_edge != orig_entry_edge);
@@ -6566,6 +6568,12 @@ epilogue_done:
else
pending_edge_cold = e;
}
+
+ /* Save a pointer to the exit's predecessor BB for use in
+ inserting new BBs at the end of the function. Do this
+ after the call to split_block above which may split
+ the original exit pred. */
+ exit_pred = EXIT_BLOCK_PTR->prev_bb;
FOR_EACH_VEC_ELT (unconverted_simple_returns, i, e)
{