summaryrefslogtreecommitdiff
path: root/gcc/tree-tailcall.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2007-01-18 15:56:33 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2007-01-18 14:56:33 +0000
commit1994bfea41d3cea4650b1678c13a70bf88186839 (patch)
tree370ef0af6f0c9483e8a124a460b11617ada2ca1b /gcc/tree-tailcall.c
parentd85c755027830f7779768c633aecdaf530a47034 (diff)
downloadgcc-1994bfea41d3cea4650b1678c13a70bf88186839.tar.gz
tree-vrp.c (finalize_jump_threads): Do not call cleanup_cfg by hand.
* tree-vrp.c (finalize_jump_threads): Do not call cleanup_cfg by hand. * tree-tailcall (add_virtual_phis): Likewise. (optimize_tail_call): Return TODOs. (execute_tail_calls): Return TODOs. * tree-ssa-ccp (execute_fold_all_builtins): Do cleanup_cfg via TODO. * tree-cfgcleanup.c (cleanup_tree_cfg_loop): Return if something changed. * tree-ssa-forwprop.c (tree_ssa_forward_propagate_single_use_value): Cleanup cfg using TODO. * tree-flow.h (cleanup_tree_cfg_loop): Update prototype. * passes.c (execute_function_todo): When cleanup did something, remove unused locals. * tree-cfg.c (pass_build_cfg): Add cleanup_cfg TODO. (make_edges): Don't cleanup_cfg. From-SVN: r120900
Diffstat (limited to 'gcc/tree-tailcall.c')
-rw-r--r--gcc/tree-tailcall.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c
index c652e582d25..b5696789657 100644
--- a/gcc/tree-tailcall.c
+++ b/gcc/tree-tailcall.c
@@ -829,8 +829,6 @@ add_virtual_phis (void)
if (!is_gimple_reg (var) && gimple_default_def (cfun, var) != NULL_TREE)
mark_sym_for_renaming (var);
}
-
- update_ssa (TODO_update_ssa_only_virtuals);
}
/* Optimizes the tailcall described by T. If OPT_TAILCALLS is true, also
@@ -865,7 +863,7 @@ optimize_tail_call (struct tailcall *t, bool opt_tailcalls)
/* Optimizes tail calls in the function, turning the tail recursion
into iteration. */
-static void
+static unsigned int
tree_optimize_tail_calls_1 (bool opt_tailcalls)
{
edge e;
@@ -877,7 +875,7 @@ tree_optimize_tail_calls_1 (bool opt_tailcalls)
edge_iterator ei;
if (!suitable_for_tail_opt_p ())
- return;
+ return 0;
if (opt_tailcalls)
opt_tailcalls = suitable_for_tail_call_opt_p ();
@@ -985,20 +983,19 @@ tree_optimize_tail_calls_1 (bool opt_tailcalls)
}
if (changed)
- {
- free_dominance_info (CDI_DOMINATORS);
- cleanup_tree_cfg ();
- }
+ free_dominance_info (CDI_DOMINATORS);
if (phis_constructed)
add_virtual_phis ();
+ if (changed)
+ return TODO_cleanup_cfg | TODO_update_ssa_only_virtuals;
+ return 0;
}
static unsigned int
execute_tail_recursion (void)
{
- tree_optimize_tail_calls_1 (false);
- return 0;
+ return tree_optimize_tail_calls_1 (false);
}
static bool
@@ -1010,8 +1007,7 @@ gate_tail_calls (void)
static unsigned int
execute_tail_calls (void)
{
- tree_optimize_tail_calls_1 (true);
- return 0;
+ return tree_optimize_tail_calls_1 (true);
}
struct tree_opt_pass pass_tail_recursion =