diff options
author | Richard Henderson <rth@cygnus.com> | 1999-04-06 08:45:55 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 1999-04-06 08:45:55 -0700 |
commit | eeea333e3b37c1e1d9fd13dcb2d60d626aff5bd4 (patch) | |
tree | 863827c839c5bb0ebd7c848b83a3904379b1c89e /gcc/flow.c | |
parent | 4bb0968f4e3eb6af9a9a1ba5758ebea168a4b2e2 (diff) | |
download | gcc-eeea333e3b37c1e1d9fd13dcb2d60d626aff5bd4.zip gcc-eeea333e3b37c1e1d9fd13dcb2d60d626aff5bd4.tar.gz gcc-eeea333e3b37c1e1d9fd13dcb2d60d626aff5bd4.tar.bz2 |
flow.c (create_basic_block): Make sure the bb note is in the block.
* flow.c (create_basic_block): Make sure the bb note is in the block.
(can_delete_note_p): Rename from delete_note_p.
(delete_insn_chain): Preserve undeleteable labels too.
(tidy_fallthru_edge): Use next_real_insn instead of confusing
inline code.
From-SVN: r26220
Diffstat (limited to 'gcc/flow.c')
-rw-r--r-- | gcc/flow.c | 32 |
1 files changed, 17 insertions, 15 deletions
@@ -287,6 +287,7 @@ static void commit_one_edge_insertion PROTO((edge)); static void delete_unreachable_blocks PROTO((void)); static void delete_eh_regions PROTO((void)); +static int can_delete_note_p PROTO((rtx)); static void delete_insn_chain PROTO((rtx, rtx)); static int delete_block PROTO((basic_block)); static void expunge_block PROTO((basic_block)); @@ -780,6 +781,10 @@ create_basic_block (index, head, end, bb_note) NOTE_BASIC_BLOCK (bb_note) = bb; } + /* Always include the bb note in the block. */ + if (NEXT_INSN (end) == bb_note) + end = bb_note; + bb->head = head; bb->end = end; bb->index = index; @@ -1600,7 +1605,7 @@ delete_eh_regions () so that we may simply delete them. */ static int -delete_note_p (note) +can_delete_note_p (note) rtx note; { return (NOTE_LINE_NUMBER (note) == NOTE_INSN_DELETED @@ -1623,7 +1628,11 @@ delete_insn_chain (start, finish) while (1) { next = NEXT_INSN (start); - if (GET_CODE (start) != NOTE || delete_note_p (start)) + if (GET_CODE (start) == NOTE && !can_delete_note_p (start)) + ; + else if (GET_CODE (start) == CODE_LABEL && !can_delete_label_p (start)) + ; + else next = flow_delete_insn (start); if (start == finish) @@ -1950,26 +1959,19 @@ tidy_fallthru_edge (e, b, c) edge e; basic_block b, c; { - rtx q, h; + rtx q; /* ??? In a late-running flow pass, other folks may have deleted basic blocks by nopping out blocks, leaving multiple BARRIERs between here and the target label. They ought to be chastized and fixed. - In the mean time, search for the last barrier in a sequence of - barriers and notes. */ + We can also wind up with a sequence of undeletable labels between + one block and the next. - q = NEXT_INSN (b->end); - if (q && GET_CODE (q) == NOTE) - q = next_nonnote_insn (q); - while (q && GET_CODE (q) == BARRIER) - q = next_nonnote_insn (q); + So search through a sequence of barriers, labels, and notes for + the head of block C and assert that we really do fall through. */ - /* Assert that we now actually do fall through. */ - h = c->head; - if (GET_CODE (h) == NOTE) - h = next_nonnote_insn (h); - if (q != h) + if (next_real_insn (b->end) != next_real_insn (PREV_INSN (c->head))) return; /* Remove what will soon cease being the jump insn from the source block. |