summaryrefslogtreecommitdiff
path: root/gcc/gimple-fold.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/gimple-fold.c')
-rw-r--r--gcc/gimple-fold.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c
index a00c2c88713..d82d0606cbe 100644
--- a/gcc/gimple-fold.c
+++ b/gcc/gimple-fold.c
@@ -571,7 +571,7 @@ gimplify_and_update_call_from_tree (gimple_stmt_iterator *si_p, tree expr)
/* Replace the call at *GSI with the gimple value VAL. */
-static void
+void
replace_call_with_value (gimple_stmt_iterator *gsi, tree val)
{
gimple *stmt = gsi_stmt (*gsi);
@@ -607,9 +607,10 @@ replace_call_with_call_and_fold (gimple_stmt_iterator *gsi, gimple *repl)
&& TREE_CODE (gimple_vdef (stmt)) == SSA_NAME)
{
gimple_set_vdef (repl, gimple_vdef (stmt));
- gimple_set_vuse (repl, gimple_vuse (stmt));
SSA_NAME_DEF_STMT (gimple_vdef (repl)) = repl;
}
+ if (gimple_vuse (stmt))
+ gimple_set_vuse (repl, gimple_vuse (stmt));
gsi_replace (gsi, repl, false);
fold_stmt (gsi);
}
@@ -4244,7 +4245,7 @@ maybe_canonicalize_mem_ref_addr (tree *t)
TREE_TYPE (*t),
TREE_OPERAND (TREE_OPERAND (*t, 0), 0),
TYPE_SIZE (TREE_TYPE (*t)),
- wide_int_to_tree (sizetype, idx));
+ wide_int_to_tree (bitsizetype, idx));
res = true;
}
}