diff options
author | Andrew MacLeod <amacleod@cygnus.com> | 1999-09-21 18:57:12 +0000 |
---|---|---|
committer | Andrew Macleod <amacleod@gcc.gnu.org> | 1999-09-21 18:57:12 +0000 |
commit | abb14ef57e7850450042f1195b04266524e3132b (patch) | |
tree | 824571bce3b15f52f4589cf91533e54ce74461f9 | |
parent | 87fdf7fff070b1fb0ed2dea21cfee8c5aa42429d (diff) | |
download | gcc-abb14ef57e7850450042f1195b04266524e3132b.zip gcc-abb14ef57e7850450042f1195b04266524e3132b.tar.gz gcc-abb14ef57e7850450042f1195b04266524e3132b.tar.bz2 |
flow.c (split_edge): Handle insertion on a fallthrough edge which has the EXIT_BLOCK as a dest.
Tue Sep 21 14:55:11 EDT 1999 Andrew MacLeod <amacleod@cygnus.com>
* flow.c (split_edge): Handle insertion on a fallthrough edge which
has the EXIT_BLOCK as a dest.
From-SVN: r29556
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/flow.c | 13 |
2 files changed, 15 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2dc37e8..2e17840 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Tue Sep 21 14:55:11 EDT 1999 Andrew MacLeod <amacleod@cygnus.com> + + * flow.c (split_edge): Handle insertion on a fallthrough edge which + has the EXIT_BLOCK as a dest. + Tue Sep 21 14:51:23 EDT 1999 Andrew MacLeod <amacleod@cygnus.com> * flow.c (remove_edge): New function to remove an edge from the @@ -1153,7 +1153,7 @@ split_edge (edge_in) basic_block old_pred, bb, old_succ; edge edge_out; rtx bb_note; - int i; + int i, j; /* Abnormal edges cannot be split. */ if ((edge_in->flags & EDGE_ABNORMAL) != 0) @@ -1263,7 +1263,11 @@ split_edge (edge_in) /* Place the new block just in front of the successor. */ VARRAY_GROW (basic_block_info, ++n_basic_blocks); - for (i = n_basic_blocks - 1; i > old_succ->index; --i) + if (old_succ == EXIT_BLOCK_PTR) + j = n_basic_blocks - 1; + else + j = old_succ->index; + for (i = n_basic_blocks - 1; i > j; --i) { basic_block tmp = BASIC_BLOCK (i - 1); BASIC_BLOCK (i) = tmp; @@ -1273,7 +1277,10 @@ split_edge (edge_in) bb->index = i; /* Create the basic block note. */ - bb_note = emit_note_before (NOTE_INSN_BASIC_BLOCK, old_succ->head); + if (old_succ != EXIT_BLOCK_PTR) + bb_note = emit_note_before (NOTE_INSN_BASIC_BLOCK, old_succ->head); + else + bb_note = emit_note_after (NOTE_INSN_BASIC_BLOCK, get_last_insn ()); NOTE_BASIC_BLOCK (bb_note) = bb; bb->head = bb->end = bb_note; |