diff options
Diffstat (limited to 'gcc/cfgrtl.c')
-rw-r--r-- | gcc/cfgrtl.c | 51 |
1 files changed, 11 insertions, 40 deletions
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index c960525cda0..a42063b6c4c 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -79,7 +79,6 @@ static basic_block rtl_split_block (basic_block, void *); static void rtl_dump_bb (basic_block, FILE *, int); static int rtl_verify_flow_info_1 (void); static void rtl_make_forwarder_block (edge); -static rtx get_last_bb_insn_1 (basic_block, bool); /* Return true if NOTE is not one of the ones that must be kept paired, so that we may simply delete it. */ @@ -363,17 +362,16 @@ cfg_layout_create_basic_block (void *head, void *end, basic_block after) return newbb; } - /* Delete the insns in a (non-live) block. We physically delete every non-deleted-note insn, and update the flow graph appropriately. - If INCLUDE_BARRIERS_P is true, also delete barriers after the block. + Return nonzero if we deleted an exception handler. */ /* ??? Preserving all such notes strikes me as wrong. It would be nice to post-process the stream to remove empty blocks, loops, ranges, etc. */ static void -rtl_delete_block_1 (basic_block b, bool include_barriers_p) +rtl_delete_block (basic_block b) { rtx insn, end; @@ -384,7 +382,7 @@ rtl_delete_block_1 (basic_block b, bool include_barriers_p) if (LABEL_P (insn)) maybe_remove_eh_handler (insn); - end = get_last_bb_insn_1 (b, include_barriers_p); + end = get_last_bb_insn (b); /* Selectively delete the entire chain. */ BB_HEAD (b) = NULL; @@ -395,20 +393,6 @@ rtl_delete_block_1 (basic_block b, bool include_barriers_p) fprintf (dump_file, "deleting block %d\n", b->index); df_bb_delete (b->index); } - -/* Delete the insns in a block B together with any barriers after it. */ -static void -rtl_delete_block (basic_block b) -{ - rtl_delete_block_1 (b, true); -} - -/* The same as above, but after-block barriers are left untouched. */ -void -rtl_delete_block_not_barriers (basic_block b) -{ - rtl_delete_block_1 (b, false); -} /* Records the basic block struct in BLOCK_FOR_INSN for every insn. */ @@ -1688,10 +1672,10 @@ update_br_prob_note (basic_block bb) XEXP (note, 0) = GEN_INT (BRANCH_EDGE (bb)->probability); } -/* Get the last insn associated with block BB (that includes tablejumps and, if - INCLUDE_BARRIERS_P, barriers after BB). */ -static rtx -get_last_bb_insn_1 (basic_block bb, bool include_barriers_p) +/* Get the last insn associated with block BB (that includes barriers and + tablejumps after BB). */ +rtx +get_last_bb_insn (basic_block bb) { rtx tmp; rtx end = BB_END (bb); @@ -1700,29 +1684,16 @@ get_last_bb_insn_1 (basic_block bb, bool include_barriers_p) if (tablejump_p (end, NULL, &tmp)) end = tmp; - if (include_barriers_p) - /* Include any barriers that may follow the basic block. */ + /* Include any barriers that may follow the basic block. */ + tmp = next_nonnote_insn (end); + while (tmp && BARRIER_P (tmp)) { + end = tmp; tmp = next_nonnote_insn (end); - - while (tmp != NULL_RTX && BARRIER_P (tmp)) - { - end = tmp; - tmp = next_nonnote_insn (end); - } } return end; } - -/* Get the last insn associated with block BB (that includes barriers and - tablejumps after BB). */ -rtx -get_last_bb_insn (basic_block bb) -{ - return get_last_bb_insn_1 (bb, true); -} - /* Verify the CFG and RTL consistency common for both underlying RTL and cfglayout RTL. |