aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-05-14 15:05:21 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2012-05-14 15:05:21 +0000
commit097dcc6683c3978015f8dd86a201679f530e3dd3 (patch)
treeb9bf2e2cb432abeffcf08761c950899bd398b4e3
parenta5efada73be7bab935ae04116f480584467768dc (diff)
downloadgcc-097dcc6683c3978015f8dd86a201679f530e3dd3.zip
gcc-097dcc6683c3978015f8dd86a201679f530e3dd3.tar.gz
gcc-097dcc6683c3978015f8dd86a201679f530e3dd3.tar.bz2
gimplify.c (gimple_regimplify_operands): Only mark the LHS of statements for renaming.
2012-05-14 Richard Guenther <rguenther@suse.de> * gimplify.c (gimple_regimplify_operands): Only mark the LHS of statements for renaming. (force_gimple_operand_1): Likewise, consistently for both calls to force_gimple_operand and force_gimple_operand_gsi. From-SVN: r187468
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/gimplify.c31
2 files changed, 29 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 40a0f73..67b1fdb 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
2012-05-14 Richard Guenther <rguenther@suse.de>
+ * gimplify.c (gimple_regimplify_operands): Only mark the LHS
+ of statements for renaming.
+ (force_gimple_operand_1): Likewise, consistently for both
+ calls to force_gimple_operand and force_gimple_operand_gsi.
+
+2012-05-14 Richard Guenther <rguenther@suse.de>
+
* tree-dfa.c (make_rename_temp): Be forgiving if not in SSA form.
* omp-low.c (expand_omp_taskreg): Properly conditionalize call
to update_ssa.
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 63195ae..02e42b8 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -8531,7 +8531,13 @@ gimple_regimplify_operands (gimple stmt, gimple_stmt_iterator *gsi_p)
gimple_stmt_iterator i;
for (i = gsi_start (pre); !gsi_end_p (i); gsi_next (&i))
- mark_symbols_for_renaming (gsi_stmt (i));
+ {
+ tree lhs = gimple_get_lhs (gsi_stmt (i));
+ if (lhs
+ && TREE_CODE (lhs) != SSA_NAME
+ && is_gimple_reg (lhs))
+ mark_sym_for_renaming (lhs);
+ }
}
gsi_insert_seq_before (gsi_p, pre, GSI_SAME_STMT);
}
@@ -8585,6 +8591,21 @@ force_gimple_operand_1 (tree expr, gimple_seq *stmts,
for (t = gimplify_ctxp->temps; t ; t = DECL_CHAIN (t))
add_referenced_var (t);
+ if (!gimple_seq_empty_p (*stmts)
+ && gimplify_ctxp->into_ssa)
+ {
+ gimple_stmt_iterator i;
+
+ for (i = gsi_start (*stmts); !gsi_end_p (i); gsi_next (&i))
+ {
+ tree lhs = gimple_get_lhs (gsi_stmt (i));
+ if (lhs
+ && TREE_CODE (lhs) != SSA_NAME
+ && is_gimple_reg (lhs))
+ mark_sym_for_renaming (lhs);
+ }
+ }
+
pop_gimplify_context (NULL);
return expr;
@@ -8621,14 +8642,6 @@ force_gimple_operand_gsi_1 (gimple_stmt_iterator *gsi, tree expr,
if (!gimple_seq_empty_p (stmts))
{
- if (gimple_in_ssa_p (cfun))
- {
- gimple_stmt_iterator i;
-
- for (i = gsi_start (stmts); !gsi_end_p (i); gsi_next (&i))
- mark_symbols_for_renaming (gsi_stmt (i));
- }
-
if (before)
gsi_insert_seq_before (gsi, stmts, m);
else