aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-sra.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2009-12-13 17:36:20 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-12-13 17:36:20 +0000
commit1bea309889ac0d3f7cab5d51e2105cda6fc7f59b (patch)
tree23844ce3a0dff07fc11d48bb663df234c6fea161 /gcc/tree-sra.c
parent70c5cc5d72b5ce7bc8b5601f7e1817b9a021678f (diff)
downloadgcc-1bea309889ac0d3f7cab5d51e2105cda6fc7f59b.zip
gcc-1bea309889ac0d3f7cab5d51e2105cda6fc7f59b.tar.gz
gcc-1bea309889ac0d3f7cab5d51e2105cda6fc7f59b.tar.bz2
re PR tree-optimization/42357 (another ice in create_tmp_var)
2009-12-13 Richard Guenther <rguenther@suse.de> PR tree-optimization/42357 * tree-sra.c (sra_modify_assign): Do not tear apart struct copies. * g++.dg/torture/pr42357.C: New testcase. From-SVN: r155193
Diffstat (limited to 'gcc/tree-sra.c')
-rw-r--r--gcc/tree-sra.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index a6a1a90..8fdbb72 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -2441,7 +2441,8 @@ sra_modify_assign (gimple *stmt, gimple_stmt_iterator *gsi,
if (!useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (rhs)))
{
rhs = fold_build1_loc (loc, VIEW_CONVERT_EXPR, TREE_TYPE (lhs), rhs);
- if (!is_gimple_reg (lhs))
+ if (is_gimple_reg_type (TREE_TYPE (lhs))
+ && TREE_CODE (lhs) != SSA_NAME)
force_gimple_rhs = true;
}
}