summaryrefslogtreecommitdiff
path: root/gcc/tree-optimize.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-05 02:00:56 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2007-01-05 02:00:56 +0000
commitd32d077fe17e1beecb7f219d89f915870a404a2d (patch)
treee08cf11e85f9b9ff1e3fee2736cbce8687c1f7bd /gcc/tree-optimize.c
parent6b6b8eeef9398dccf5d29d669d319bffd5972c67 (diff)
downloadgcc-d32d077fe17e1beecb7f219d89f915870a404a2d.tar.gz
* tree-optimize.c (execute_fixup_cfg): Correct previously mistakely
comitted older version of patch. (pass_fixup_cfg): Add TODOs to verify flow and statements, dump function, celanup cfg and collect garbage. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120469 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-optimize.c')
-rw-r--r--gcc/tree-optimize.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c
index 75df4cc54e6..e67b0ef2e12 100644
--- a/gcc/tree-optimize.c
+++ b/gcc/tree-optimize.c
@@ -297,6 +297,7 @@ execute_fixup_cfg (void)
{
basic_block bb;
block_stmt_iterator bsi;
+ int todo = gimple_in_ssa_p (cfun) ? TODO_verify_ssa : 0;
cfun->after_inlining = true;
@@ -312,7 +313,11 @@ execute_fixup_cfg (void)
if (decl && call_expr_flags (call) & (ECF_CONST | ECF_PURE)
&& TREE_SIDE_EFFECTS (call))
{
- update_stmt (stmt);
+ if (gimple_in_ssa_p (cfun))
+ {
+ todo |= TODO_update_ssa;
+ update_stmt (stmt);
+ }
TREE_SIDE_EFFECTS (call) = 0;
}
if (decl && TREE_NOTHROW (decl))
@@ -355,8 +360,10 @@ execute_fixup_cfg (void)
if (DECL_NONLOCAL (target))
{
tree phi;
+
for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
{
+ todo |= TODO_update_ssa;
gcc_assert (SSA_NAME_OCCURS_IN_ABNORMAL_PHI
(PHI_RESULT (phi)));
mark_sym_for_renaming
@@ -368,18 +375,11 @@ execute_fixup_cfg (void)
}
}
- if (gimple_in_ssa_p (cfun))
- {
- delete_unreachable_blocks ();
- update_ssa (TODO_update_ssa);
- }
- cleanup_tree_cfg ();
-
/* Dump a textual representation of the flowgraph. */
if (dump_file)
dump_tree_cfg (dump_file, dump_flags);
- return 0;
+ return todo;
}
struct tree_opt_pass pass_fixup_cfg =
@@ -395,9 +395,10 @@ struct tree_opt_pass pass_fixup_cfg =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- 0, /* todo_flags_finish */
- 0 /* letter */
-};
+ TODO_cleanup_cfg | TODO_ggc_collect
+ | TODO_dump_func | TODO_verify_flow
+ | TODO_verify_stmts,/* todo_flags_finish */
+ 0 /* letter */ };
/* Do the actions required to initialize internal data structures used
in tree-ssa optimization passes. */