summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-pre.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2006-05-04 07:44:37 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2006-05-04 07:44:37 +0000
commit696243a6115e019684f7062e28b91ba3925e96c2 (patch)
tree50d692e043640fe958ccfee2d8b4f4c741b1d483 /gcc/tree-ssa-pre.c
parenta2b530175db099d04f3be456899898046e1743bc (diff)
downloadgcc-696243a6115e019684f7062e28b91ba3925e96c2.tar.gz
2006-05-04 Richard Guenther <rguenther@suse.de>
PR tree-optimization/26447 * tree-ssa-pre.c (realify_fake_stores): For necessary loads produce SSA_NAME copies before the store stmt to avoid breaking exception handling. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113517 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-pre.c')
-rw-r--r--gcc/tree-ssa-pre.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index fc0dff5a2b8..38f020f30f2 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -3290,16 +3290,19 @@ realify_fake_stores (void)
/* Mark the temp variable as referenced */
add_referenced_tmp_var (SSA_NAME_VAR (TREE_OPERAND (stmt, 0)));
- /* Put the new statement in GC memory, fix up the annotation
- and SSA_NAME_DEF_STMT on it, and then put it in place of
- the old statement in the IR stream. */
- newstmt = unshare_expr (stmt);
+ /* Put the new statement in GC memory, fix up the
+ SSA_NAME_DEF_STMT on it, and then put it in place of
+ the old statement before the store in the IR stream
+ as a plain ssa name copy. */
+ bsi = bsi_for_stmt (stmt);
+ bsi_prev (&bsi);
+ newstmt = build2 (MODIFY_EXPR, void_type_node,
+ TREE_OPERAND (stmt, 0),
+ TREE_OPERAND (bsi_stmt (bsi), 1));
SSA_NAME_DEF_STMT (TREE_OPERAND (newstmt, 0)) = newstmt;
-
- newstmt->common.ann = stmt->common.ann;
-
+ bsi_insert_before (&bsi, newstmt, BSI_SAME_STMT);
bsi = bsi_for_stmt (stmt);
- bsi_replace (&bsi, newstmt, true);
+ bsi_remove (&bsi, true);
}
else
release_defs (stmt);