summaryrefslogtreecommitdiff
path: root/gcc/passes.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/passes.c')
-rw-r--r--gcc/passes.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/passes.c b/gcc/passes.c
index 9cb2c5284e4..0ab5f4815e4 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -818,14 +818,19 @@ execute_function_todo (void *data)
if (!flags)
return;
- /* Always cleanup the CFG before trying to update SSA . */
+ /* Always cleanup the CFG before trying to update SSA. */
if (flags & TODO_cleanup_cfg)
{
+ bool cleanup;
+
if (current_loops)
- cleanup_tree_cfg_loop ();
+ cleanup = cleanup_tree_cfg_loop ();
else
- cleanup_tree_cfg ();
+ cleanup = cleanup_tree_cfg ();
+ if (cleanup && (cfun->curr_properties & PROP_ssa))
+ flags |= TODO_remove_unused_locals;
+
/* When cleanup_tree_cfg merges consecutive blocks, it may
perform some simplistic propagation when removing single
valued PHI nodes. This propagation may, in turn, cause the