aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorDaniel Berlin <dberlin@dberlin.org>2005-12-17 13:40:27 +0000
committerKenneth Zadeck <zadeck@gcc.gnu.org>2005-12-17 13:40:27 +0000
commit24bd1a0b27fc7ea64a1bec8eca37abc13cff4178 (patch)
tree9df368d8d09a4cf8e6f2a79bb6e4864ceb6a4907 /gcc/tree-cfg.c
parent86051306a1a4da9a1fb5da12325cac62cd4ca883 (diff)
downloadgcc-24bd1a0b27fc7ea64a1bec8eca37abc13cff4178.zip
gcc-24bd1a0b27fc7ea64a1bec8eca37abc13cff4178.tar.gz
gcc-24bd1a0b27fc7ea64a1bec8eca37abc13cff4178.tar.bz2
basic-block.h: Changed basic block numbering so that the entry block is 0 and the exit block is 1.
2005-12-17 Danny Berlin <dberlin@dberlin.org> Kenneth Zadeck <zadeck@naturalbridge.com> * basic-block.h: Changed basic block numbering so that the entry block is 0 and the exit block is 1. Changed insn iterators so that they are tolerant of blocks with no insns. * regrename.c (copyprop_hardreg_forward): Changed basic block numbering so that the entry block is 0 and the exit block is 1. * sched-ebb.c (sehedule_ebbs): Ditto. * tracer.c (branch_ratio_cutoff): Ditto. * cfgloopmanip.c (fix_loop_structure): Ditto. * cfghooks.c (verify_flow_info): Ditto. * cfg.c (compact_blocks): Ditto. * reorg.c (dbr_schedule): Ditto. * flow.c (calculate_global_regs_live, libcall_dead_p): Ditto. * dominance.c (calc_dfs_tree_nonrec, calc_dfs_tree, calculate_dominance_info): Ditto. * cfganal.c (create_edge_list, print_edge_list, flow_depth_first_order_compute, flow_dfs_compute_reverse_init, flow_dfs_compute_reverse_add_bb, flow_dfs_compute_reverse_execute, dfs_enumerate_from): Ditto. * global.c (global_alloc, set_up_bb_rts_numbers): Ditto. * ifcvt.c (find_if_case_2): Ditto. * cfgbuild.c (control_flow_insn_p, count_basic_blocks, find_basic_blocks): Ditto. * predict.c (predict_loops, tree_bb_level_predictions, predict_paths_leading_to, propagate_freq): Ditto. * lcm.c (compute_antinout_edge, compute_laterin, compute_available): Ditto. * function.c (thread_prologue_and_epilogue_insns): Ditto. * gcse.c (gcse_main, bypass_jumps): Ditto. * profile.c (compute_branch_probabilities, compute_value_histograms, branch_prob): Ditto. * tree-flow-inline.h (bsi_start, bsi_after_labels, bsi_last): Ditto. * tree-ssa-phiopt.c (tree_ssa_phiopt, blocks_in_phiopt_order): Ditto. * bt-load.c (compute_defs_uses_and_gen, compute_kill, compute_out, link_btr_uses, migrate_btr_defs): Ditto. * tree-dfa.c (collect_dfa_stats): Ditto. * cfgcleanup.c (try_forward_edges, try_optimize_cfg): Ditto. * cfglayout.c (fixup_reorder_chain): Ditto. * bb-reorder.c (reorder_basic_blocks, duplicate_computed_gotos, partition_hot_cold_basic_blocks): Ditto. * var-tracking.c (vt_find_locations): Ditto. * cfgloop.c (flow_loops_cfg_dump, flow_loops_find, get_loop_body): Ditto. * sched-rgn.c (compute_trg_info, init_regions, schedule_insns): Ditto. * tree-cfg.c (init_empty_tree_cfg, build_tree_cfg, make_edges label_to_block_fn, print_loop_ir, tree_flow_call_edges_add): Ditto. * tree-ssa-reassoc.c (init_reassoc): Ditto. * cfgrtl.c (entry_of_function, rtl_verify_flow_info, rtl_flow_call_edges_add, rtl_flow_call_edges_add): Ditto. * df.c (df_analyze_1, hybrid_search, iterative_dataflow): Ditto and removed unused reverse orders. * df.h (): Ditto. * combine.c: Fix document typo. Co-Authored-By: Kenneth Zadeck <zadeck@naturalbridge.com> From-SVN: r108713
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index fd6d1c7..6c0d1c0 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -129,14 +129,16 @@ init_empty_tree_cfg (void)
/* Initialize the basic block array. */
init_flow ();
profile_status = PROFILE_ABSENT;
- n_basic_blocks = 0;
- last_basic_block = 0;
+ n_basic_blocks = NUM_FIXED_BLOCKS;
+ last_basic_block = NUM_FIXED_BLOCKS;
VARRAY_BB_INIT (basic_block_info, initial_cfg_capacity, "basic_block_info");
/* Build a mapping of labels to their associated blocks. */
VARRAY_BB_INIT (label_to_block_map, initial_cfg_capacity,
"label to block map");
+ BASIC_BLOCK (ENTRY_BLOCK) = ENTRY_BLOCK_PTR;
+ BASIC_BLOCK (EXIT_BLOCK) = EXIT_BLOCK_PTR;
ENTRY_BLOCK_PTR->next_bb = EXIT_BLOCK_PTR;
EXIT_BLOCK_PTR->prev_bb = ENTRY_BLOCK_PTR;
}
@@ -170,7 +172,7 @@ build_tree_cfg (tree *tp)
factor_computed_gotos ();
/* Make sure there is always at least one block, even if it's empty. */
- if (n_basic_blocks == 0)
+ if (n_basic_blocks == NUM_FIXED_BLOCKS)
create_empty_bb (ENTRY_BLOCK_PTR);
/* Adjust the size of the array. */
@@ -430,7 +432,7 @@ make_edges (void)
/* Create an edge from entry to the first block with executable
statements in it. */
- make_edge (ENTRY_BLOCK_PTR, BASIC_BLOCK (0), EDGE_FALLTHRU);
+ make_edge (ENTRY_BLOCK_PTR, BASIC_BLOCK (NUM_FIXED_BLOCKS), EDGE_FALLTHRU);
/* Traverse the basic block array placing edges. */
FOR_EACH_BB (bb)
@@ -794,7 +796,8 @@ label_to_block_fn (struct function *ifun, tree dest)
and undefined variable warnings quite right. */
if ((errorcount || sorrycount) && uid < 0)
{
- block_stmt_iterator bsi = bsi_start (BASIC_BLOCK (0));
+ block_stmt_iterator bsi =
+ bsi_start (BASIC_BLOCK (NUM_FIXED_BLOCKS));
tree stmt;
stmt = build1 (LABEL_EXPR, void_type_node, dest);
@@ -4656,7 +4659,7 @@ print_loop_ir (FILE *file)
{
basic_block bb;
- bb = BASIC_BLOCK (0);
+ bb = BASIC_BLOCK (NUM_FIXED_BLOCKS);
if (bb && bb->loop_father)
print_loop (file, bb->loop_father, 0);
}
@@ -4738,7 +4741,7 @@ tree_flow_call_edges_add (sbitmap blocks)
int last_bb = last_basic_block;
bool check_last_block = false;
- if (n_basic_blocks == 0)
+ if (n_basic_blocks == NUM_FIXED_BLOCKS)
return 0;
if (! blocks)