summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-16 10:45:18 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-16 10:45:18 +0000
commit3e40d86fecdae3924f3847922c42fae79a95e344 (patch)
treeaea1f631377fbafc1c53cc58287483dc76e4a8b5
parent5ee65f7026bcf4ea9e49f6e68f79227bb8c05939 (diff)
downloadppe42-gcc-3e40d86fecdae3924f3847922c42fae79a95e344.tar.gz
ppe42-gcc-3e40d86fecdae3924f3847922c42fae79a95e344.zip
2009-04-16 Richard Guenther <rguenther@suse.de>
PR middle-end/39625 * tree-cfg.c (make_blocks): Split statements with to-be abnormal SSA names on the lhs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146168 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-cfg.c24
2 files changed, 29 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 66374e5926c..f04bbcff5fc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2009-04-16 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/39625
+ * tree-cfg.c (make_blocks): Split statements with to-be
+ abnormal SSA names on the lhs.
+
2009-04-16 Paolo Bonzini <bonzini@gnu.org>
* c-common.c (vector_targets_convertible_p, vector_types_convertible_p):
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 6c5eb87d644..447e6cf0a09 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -375,7 +375,29 @@ make_blocks (gimple_seq seq)
/* If STMT is a basic block terminator, set START_NEW_BLOCK for the
next iteration. */
if (stmt_ends_bb_p (stmt))
- start_new_block = true;
+ {
+ /* If the stmt can make abnormal goto use a new temporary
+ for the assignment to the LHS. This makes sure the old value
+ of the LHS is available on the abnormal edge. Otherwise
+ we will end up with overlapping life-ranges for abnormal
+ SSA names. */
+ if (gimple_has_lhs (stmt)
+ && stmt_can_make_abnormal_goto (stmt)
+ && is_gimple_reg_type (TREE_TYPE (gimple_get_lhs (stmt))))
+ {
+ tree lhs = gimple_get_lhs (stmt);
+ tree tmp = create_tmp_var (TREE_TYPE (lhs), NULL);
+ gimple s = gimple_build_assign (lhs, tmp);
+ gimple_set_location (s, gimple_location (stmt));
+ gimple_set_block (s, gimple_block (stmt));
+ gimple_set_lhs (stmt, tmp);
+ if (TREE_CODE (TREE_TYPE (tmp)) == COMPLEX_TYPE
+ || TREE_CODE (TREE_TYPE (tmp)) == VECTOR_TYPE)
+ DECL_GIMPLE_REG_P (tmp) = 1;
+ gsi_insert_after (&i, s, GSI_SAME_STMT);
+ }
+ start_new_block = true;
+ }
gsi_next (&i);
first_stmt_of_seq = false;
OpenPOWER on IntegriCloud