aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-sra.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2008-03-01 00:27:26 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2008-03-01 00:27:26 +0000
commit2fb5f2af000e6e0ea5e7530e623ab33840a75668 (patch)
tree2da1b9137cf43382d6ed2ac1544b88801f0ac8b7 /gcc/tree-sra.c
parent87504f4df6084c5deebea51c4f5ba51a792737be (diff)
downloadgcc-2fb5f2af000e6e0ea5e7530e623ab33840a75668.zip
gcc-2fb5f2af000e6e0ea5e7530e623ab33840a75668.tar.gz
gcc-2fb5f2af000e6e0ea5e7530e623ab33840a75668.tar.bz2
re PR middle-end/35411 (internal compiler error: in set_ssa_val_to, at tree-ssa-sccvn.c:1075)
2008-03-01 Richard Guenther <rguenther@suse.de> PR tree-optimization/35411 * tree-sra.c (sra_build_assignment): Split conversion to final type to a separate statement if we are not assigning to a register. From-SVN: r132791
Diffstat (limited to 'gcc/tree-sra.c')
-rw-r--r--gcc/tree-sra.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 26f1af4..1f2d6c2 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -2139,7 +2139,7 @@ sra_build_assignment (tree dst, tree src)
if (scalar_bitfield_p (src))
{
tree var, shift, width;
- tree utype, stype, stmp, utmp;
+ tree utype, stype, stmp, utmp, dtmp;
tree list, stmt;
bool unsignedp = BIT_FIELD_REF_UNSIGNED (src);
@@ -2256,6 +2256,16 @@ sra_build_assignment (tree dst, tree src)
var = fold_convert (TREE_TYPE (dst), var);
else
var = fold_build1 (VIEW_CONVERT_EXPR, TREE_TYPE (dst), var);
+
+ /* If the destination is not a register the conversion needs
+ to be a separate statement. */
+ if (!is_gimple_reg (dst))
+ {
+ dtmp = make_rename_temp (TREE_TYPE (dst), "SR");
+ stmt = build_gimple_modify_stmt (dtmp, var);
+ append_to_statement_list (stmt, &list);
+ var = dtmp;
+ }
}
stmt = build_gimple_modify_stmt (dst, var);
append_to_statement_list (stmt, &list);