diff options
Diffstat (limited to 'gcc/tree-ssa-forwprop.c')
-rw-r--r-- | gcc/tree-ssa-forwprop.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c index 26a82461600..5aec33415d4 100644 --- a/gcc/tree-ssa-forwprop.c +++ b/gcc/tree-ssa-forwprop.c @@ -937,6 +937,7 @@ forward_propagate_addr_expr (tree name, tree rhs) gimple use_stmt; bool all = true; bool single_use_p = has_single_use (name); + bool debug = false; FOR_EACH_IMM_USE_STMT (use_stmt, iter, name) { @@ -947,7 +948,10 @@ forward_propagate_addr_expr (tree name, tree rhs) there is nothing we can do. */ if (gimple_code (use_stmt) != GIMPLE_ASSIGN) { - all = false; + if (is_gimple_debug (use_stmt)) + debug = true; + else + all = false; continue; } @@ -989,6 +993,9 @@ forward_propagate_addr_expr (tree name, tree rhs) } } + if (all && debug) + propagate_var_def_into_debug_stmts (name, NULL, NULL); + return all; } |