Commit eeea333e by Richard Henderson Committed by Richard Henderson

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
parent 4bb0968f
Tue Apr 6 15:45:28 1999 Richard Henderson <rth@cygnus.com>
* 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.
1999-04-06 12:56 -0400 Zack Weinberg <zack@rabi.columbia.edu> 1999-04-06 12:56 -0400 Zack Weinberg <zack@rabi.columbia.edu>
* cppexp.c (parse_charconst): Initialize c. * cppexp.c (parse_charconst): Initialize c.
......
...@@ -287,6 +287,7 @@ static void commit_one_edge_insertion PROTO((edge)); ...@@ -287,6 +287,7 @@ static void commit_one_edge_insertion PROTO((edge));
static void delete_unreachable_blocks PROTO((void)); static void delete_unreachable_blocks PROTO((void));
static void delete_eh_regions 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 void delete_insn_chain PROTO((rtx, rtx));
static int delete_block PROTO((basic_block)); static int delete_block PROTO((basic_block));
static void expunge_block PROTO((basic_block)); static void expunge_block PROTO((basic_block));
...@@ -780,6 +781,10 @@ create_basic_block (index, head, end, bb_note) ...@@ -780,6 +781,10 @@ create_basic_block (index, head, end, bb_note)
NOTE_BASIC_BLOCK (bb_note) = bb; 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->head = head;
bb->end = end; bb->end = end;
bb->index = index; bb->index = index;
...@@ -1600,7 +1605,7 @@ delete_eh_regions () ...@@ -1600,7 +1605,7 @@ delete_eh_regions ()
so that we may simply delete them. */ so that we may simply delete them. */
static int static int
delete_note_p (note) can_delete_note_p (note)
rtx note; rtx note;
{ {
return (NOTE_LINE_NUMBER (note) == NOTE_INSN_DELETED return (NOTE_LINE_NUMBER (note) == NOTE_INSN_DELETED
...@@ -1623,7 +1628,11 @@ delete_insn_chain (start, finish) ...@@ -1623,7 +1628,11 @@ delete_insn_chain (start, finish)
while (1) while (1)
{ {
next = NEXT_INSN (start); 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); next = flow_delete_insn (start);
if (start == finish) if (start == finish)
...@@ -1950,26 +1959,19 @@ tidy_fallthru_edge (e, b, c) ...@@ -1950,26 +1959,19 @@ tidy_fallthru_edge (e, b, c)
edge e; edge e;
basic_block b, c; basic_block b, c;
{ {
rtx q, h; rtx q;
/* ??? In a late-running flow pass, other folks may have deleted basic /* ??? In a late-running flow pass, other folks may have deleted basic
blocks by nopping out blocks, leaving multiple BARRIERs between here blocks by nopping out blocks, leaving multiple BARRIERs between here
and the target label. They ought to be chastized and fixed. and the target label. They ought to be chastized and fixed.
In the mean time, search for the last barrier in a sequence of We can also wind up with a sequence of undeletable labels between
barriers and notes. */ one block and the next.
q = NEXT_INSN (b->end); So search through a sequence of barriers, labels, and notes for
if (q && GET_CODE (q) == NOTE) the head of block C and assert that we really do fall through. */
q = next_nonnote_insn (q);
while (q && GET_CODE (q) == BARRIER)
q = next_nonnote_insn (q);
/* Assert that we now actually do fall through. */ if (next_real_insn (b->end) != next_real_insn (PREV_INSN (c->head)))
h = c->head;
if (GET_CODE (h) == NOTE)
h = next_nonnote_insn (h);
if (q != h)
return; return;
/* Remove what will soon cease being the jump insn from the source block. /* Remove what will soon cease being the jump insn from the source block.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment