summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r--gcc/tree-ssa.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index 7564a52fabf..a0115938077 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -471,7 +471,10 @@ insert_debug_temp_for_var_def (gimple_stmt_iterator *gsi, tree var)
/* If we didn't replace uses with a debug decl fold the
resulting expression. Otherwise we end up with invalid IL. */
if (TREE_CODE (value) != DEBUG_EXPR_DECL)
- fold_stmt_inplace (stmt);
+ {
+ gimple_stmt_iterator gsi = gsi_for_stmt (stmt);
+ fold_stmt_inplace (&gsi);
+ }
}
else
gimple_debug_bind_reset_value (stmt);