diff options
author | rakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-05-28 12:53:47 +0000 |
---|---|---|
committer | rakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-05-28 12:53:47 +0000 |
commit | 3c0a32c9310d31a517b77e5e0b78c8464df21b63 (patch) | |
tree | e6c0737229b9c2c57cf0353f3dd15ebecc686b75 /gcc/cfganal.c | |
parent | 39ebe913b0f38d9a0b7c090d2dcba03c777ba3d6 (diff) | |
download | gcc-3c0a32c9310d31a517b77e5e0b78c8464df21b63.tar.gz |
* basic-block.h (last_basic_block): Declare.
(expunge_block_nocompact): Declaration removed.
(compact_blocks): Declare.
* cfg.c (last_basic_block): New variable.
(expunge_block_nocompact): Removed.
(expunge_block): Do not compact basic blocks.
(compact_blocks): New.
* cfganal.c (flow_call_edges_add): Use the fact that bb indices no
longer change.
* cfgbuild.c (find_basic_blocks_1, find_basic_blocks): Set
last_basic_block.
* cfgcleanup.c (merge_blocks_move_predecessor_nojumps): Do not change
real positions of blocks.
(delete_unreachable_blocks): Simplified -- quadratic behavior now
cannot occur.
(cleanup_cfg): Compact blocks.
* cfgrtl.c (create_basic_block): Insert basic blocks to the end of
basic_block_info varray.
(flow_delete_block): Comment update.
(back_edge_of_syntactic_loop_p): Modify position check code.
(verify_flow_info): Update checking.
* flow.c (calculate_global_regs_live): Use FOR_EACH_BB.
* ifcvt.c (SET_ORIG_INDEX, ORIG_INDEX): Removed.
(find_if_case_1, find_if_case_2, if_convert): Use the fact that bb
indices no longer change.
* lcm.c (optimize_mode_switching): Replace n_basic_blocks with
last_basic_block.
* predict.c (estimate_bb_frequencies): Remove unneccessary code.
* profile.c (branch_prob): Compact blocks.
* sched-rgn.c (find_rgns): Replace n_basic_blocks with
last_basic_block.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53957 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cfganal.c')
-rw-r--r-- | gcc/cfganal.c | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/gcc/cfganal.c b/gcc/cfganal.c index 15031f621c5..5f69d1ab2d4 100644 --- a/gcc/cfganal.c +++ b/gcc/cfganal.c @@ -258,29 +258,16 @@ flow_call_edges_add (blocks) { int i; int blocks_split = 0; - int bb_num = 0; - basic_block *bbs, bb; + int last_bb = last_basic_block; bool check_last_block = false; - /* Map bb indices into basic block pointers since split_block - will renumber the basic blocks. */ - - bbs = xmalloc (n_basic_blocks * sizeof (*bbs)); + if (n_basic_blocks == 0) + return 0; if (! blocks) - { - FOR_EACH_BB (bb) - bbs[bb_num++] = bb; - - check_last_block = true; - } + check_last_block = true; else - EXECUTE_IF_SET_IN_SBITMAP (blocks, 0, i, - { - bbs[bb_num++] = BASIC_BLOCK (i); - if (i == n_basic_blocks - 1) - check_last_block = true; - }); + check_last_block = TEST_BIT (blocks, EXIT_BLOCK_PTR->prev_bb->index); /* In the last basic block, before epilogue generation, there will be a fallthru edge to EXIT. Special care is required if the last insn @@ -321,12 +308,18 @@ flow_call_edges_add (blocks) calls since there is no way that we can determine if they will return or not... */ - for (i = 0; i < bb_num; i++) + for (i = 0; i < last_bb; i++) { - basic_block bb = bbs[i]; + basic_block bb = BASIC_BLOCK (i); rtx insn; rtx prev_insn; + if (!bb) + continue; + + if (blocks && !TEST_BIT (blocks, i)) + continue; + for (insn = bb->end; ; insn = prev_insn) { prev_insn = PREV_INSN (insn); @@ -374,7 +367,6 @@ flow_call_edges_add (blocks) if (blocks_split) verify_flow_info (); - free (bbs); return blocks_split; } @@ -927,7 +919,7 @@ flow_preorder_transversal_compute (pot_order) for (e = bb->succ; e; e = e->succ_next) max_successors++; - dfst[i].node + dfst[bb->index].node = (max_successors ? (struct dfst_node **) xcalloc (max_successors, sizeof (struct dfst_node *)) |