diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 15 | ||||
-rw-r--r-- | gcc/basic-block.h | 1 | ||||
-rw-r--r-- | gcc/cfganal.c | 24 | ||||
-rw-r--r-- | gcc/cfgcleanup.c | 2 | ||||
-rw-r--r-- | gcc/gcse.c | 4 | ||||
-rw-r--r-- | gcc/predict.c | 6 | ||||
-rw-r--r-- | gcc/profile.c | 5 | ||||
-rw-r--r-- | gcc/tree-cfg.c | 2 | ||||
-rw-r--r-- | gcc/tree-ssa-pre.c | 3 |
9 files changed, 43 insertions, 19 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a4a69f0..df18afa 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,20 @@ 2004-07-16 Richard Henderson <rth@redhat.com> + * basic-block.h (remove_fake_exit_edges): Declare. + * cfganal.c (remove_fake_predecessors): Rename from + remove_fake_successors; iterate over predecessors. + (remove_fake_exit_edges): New. + * cfgcleanup.c (try_optimize_cfg): Use it. + * gcse.c (one_pre_gcse_pass, store_motion): Likewise. + * predict.c (estimate_probability): Likewise. + (tree_estimate_probability, note_prediction_to_br_prob): Likewise. + * tree-cfg.c (make_edges): Likewise. + * tree-ssa-pre.c (fini_pre): Likewise. + * profile.c (instrument_edges): Don't remove_fake_edges. + (branch_prob): Do it earlier here. + +2004-07-16 Richard Henderson <rth@redhat.com> + * tree-ssa-operands.c (get_expr_operands): Fix 2004-07-15 switchification wrt CONSTRUCTOR. Document the reason. diff --git a/gcc/basic-block.h b/gcc/basic-block.h index e097f99..e29b67a 100644 --- a/gcc/basic-block.h +++ b/gcc/basic-block.h @@ -417,6 +417,7 @@ extern void commit_edge_insertions (void); extern void commit_edge_insertions_watch_calls (void); extern void remove_fake_edges (void); +extern void remove_fake_exit_edges (void); extern void add_noreturn_fake_exit_edges (void); extern void connect_infinite_loops_to_exit (void); extern edge unchecked_make_edge (basic_block, basic_block, int); diff --git a/gcc/cfganal.c b/gcc/cfganal.c index 0bfccae..db0238c 100644 --- a/gcc/cfganal.c +++ b/gcc/cfganal.c @@ -51,7 +51,6 @@ static void flow_dfs_compute_reverse_add_bb (depth_first_search_ds, basic_block); static basic_block flow_dfs_compute_reverse_execute (depth_first_search_ds); static void flow_dfs_compute_reverse_finish (depth_first_search_ds); -static void remove_fake_successors (basic_block); static bool flow_active_insn_p (rtx); /* Like active_insn_p, except keep the return value clobber around @@ -529,20 +528,20 @@ flow_edge_list_print (const char *str, const edge *edge_list, int num_edges, FIL } -/* This routine will remove any fake successor edges for a basic block. - When the edge is removed, it is also removed from whatever predecessor +/* This routine will remove any fake predecessor edges for a basic block. + When the edge is removed, it is also removed from whatever successor list it is in. */ static void -remove_fake_successors (basic_block bb) +remove_fake_predecessors (basic_block bb) { edge e; - for (e = bb->succ; e;) + for (e = bb->pred; e;) { edge tmp = e; - e = e->succ_next; + e = e->pred_next; if ((tmp->flags & EDGE_FAKE) == EDGE_FAKE) remove_edge (tmp); } @@ -557,10 +556,19 @@ remove_fake_edges (void) { basic_block bb; - FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, next_bb) - remove_fake_successors (bb); + FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR->next_bb, NULL, next_bb) + remove_fake_predecessors (bb); } +/* This routine will remove all fake edges to the EXIT_BLOCK. */ + +void +remove_fake_exit_edges (void) +{ + remove_fake_predecessors (EXIT_BLOCK_PTR); +} + + /* This function will add a fake edge between any block which has no successors, and the exit block. Some data flow equations require these edges to exist. */ diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c index 9cccf0e..f167800 100644 --- a/gcc/cfgcleanup.c +++ b/gcc/cfgcleanup.c @@ -1978,7 +1978,7 @@ try_optimize_cfg (int mode) } if (mode & CLEANUP_CROSSJUMP) - remove_fake_edges (); + remove_fake_exit_edges (); clear_aux_for_blocks (); @@ -4964,7 +4964,7 @@ one_pre_gcse_pass (int pass) } free_ldst_mems (); - remove_fake_edges (); + remove_fake_exit_edges (); free_hash_table (&expr_hash_table); if (gcse_file) @@ -6858,7 +6858,7 @@ store_motion (void) free_store_memory (); free_edge_list (edge_list); - remove_fake_edges (); + remove_fake_exit_edges (); end_alias_analysis (); } diff --git a/gcc/predict.c b/gcc/predict.c index 08834f8..49d2c612 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -779,7 +779,7 @@ estimate_probability (struct loops *loops_info) && bb->succ->succ_next != NULL) combine_predictions_for_insn (BB_END (bb), bb); - remove_fake_edges (); + remove_fake_exit_edges (); /* Fill in the probability values in flowgraph based on the REG_BR_PROB notes. */ FOR_EACH_BB (bb) @@ -986,7 +986,7 @@ tree_estimate_probability (void) estimate_bb_frequencies (&loops_info); free_dominance_info (CDI_POST_DOMINATORS); - remove_fake_edges (); + remove_fake_exit_edges (); flow_loops_free (&loops_info); if (dump_file && (dump_flags & TDF_DETAILS)) dump_tree_cfg (dump_file, dump_flags); @@ -1220,7 +1220,7 @@ note_prediction_to_br_prob (void) free_dominance_info (CDI_DOMINATORS); free (heads); - remove_fake_edges (); + remove_fake_exit_edges (); } /* This is used to carry information about basic blocks. It is diff --git a/gcc/profile.c b/gcc/profile.c index 1d16b43..ad62f87 100644 --- a/gcc/profile.c +++ b/gcc/profile.c @@ -139,8 +139,6 @@ instrument_edges (struct edge_list *el) int num_edges = NUM_EDGES (el); basic_block bb; - remove_fake_edges (); - FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb) { edge e; @@ -971,6 +969,8 @@ branch_prob (void) compute_value_histograms (n_values, values); } + remove_fake_edges (); + /* For each edge not on the spanning tree, add counting code. */ if (profile_arc_flag && coverage_counter_alloc (GCOV_COUNTER_ARCS, num_instrumented)) @@ -993,7 +993,6 @@ branch_prob (void) } } - remove_fake_edges (); free_aux_for_edges (); if (!ir_type ()) diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 6207fd3..f6bb8e0 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -448,7 +448,7 @@ make_edges (void) /* We do not care about fake edges, so remove any that the CFG builder inserted for completeness. */ - remove_fake_edges (); + remove_fake_exit_edges (); /* Clean up the graph and warn for unreachable code. */ cleanup_tree_cfg (); diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index d6b19cd..ba4be7b 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -1943,13 +1943,14 @@ fini_pre (void) free_alloc_pool (reference_node_pool); free_alloc_pool (unary_node_pool); htab_delete (phi_translate_table); - remove_fake_edges (); + remove_fake_exit_edges (); FOR_ALL_BB (bb) { free (bb->aux); bb->aux = NULL; } + free_dominance_info (CDI_POST_DOMINATORS); vn_delete (); } |