diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-01-29 12:19:36 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-01-29 12:19:36 +0000 |
commit | 338cce8f9ae07a2135b04b693f882c03d2de3bb5 (patch) | |
tree | e90381126a2950ed6ced8289ff2b6053134aed29 /gcc/tree-ssa-ccp.c | |
parent | 86fc6921a23779b1f281aa35a5db1bd4ea555b5f (diff) | |
download | gcc-338cce8f9ae07a2135b04b693f882c03d2de3bb5.tar.gz |
2010-01-29 Richard Guenther <rguenther@suse.de>
* tree-ssa-ccp.c (ccp_fold_stmt): Unshare values we substitute.
Assert we successfully updated the call.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156346 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r-- | gcc/tree-ssa-ccp.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index f6380ebdbe7..238361166b9 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -1518,11 +1518,13 @@ ccp_fold_stmt (gimple_stmt_iterator *gsi) && (val = get_value (lhs)) && val->lattice_val == CONSTANT) { - tree new_rhs = val->value; + tree new_rhs = unshare_expr (val->value); + bool res; if (!useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (new_rhs))) new_rhs = fold_convert (TREE_TYPE (lhs), new_rhs); - update_call_from_tree (gsi, new_rhs); + res = update_call_from_tree (gsi, new_rhs); + gcc_assert (res); return true; } @@ -1542,7 +1544,7 @@ ccp_fold_stmt (gimple_stmt_iterator *gsi) (TYPE_MAIN_VARIANT (TREE_VALUE (argt)), TYPE_MAIN_VARIANT (TREE_TYPE (val->value)))) { - gimple_call_set_arg (stmt, i, val->value); + gimple_call_set_arg (stmt, i, unshare_expr (val->value)); changed = true; } } |