diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-09-03 11:35:18 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-09-03 11:35:18 +0000 |
commit | c9e36a4b56413d7f9946867ef8e7a0c34ff61696 (patch) | |
tree | 69bf05bdf7a0fda3d7c71f5cdd8fa56a543de1bc /gcc/tree-sra.c | |
parent | 98b04a0312078dd2ed719a606084e3105fb8e1ff (diff) | |
download | gcc-c9e36a4b56413d7f9946867ef8e7a0c34ff61696.tar.gz |
2008-09-03 Richard Guenther <rguenther@suse.de>
PR tree-optimization/37328
* tree-sra.c (sra_build_assignment): Gimplify properly.
(generate_copy_inout): Take the correct stmt as definition,
remove bogus assert.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139931 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-sra.c')
-rw-r--r-- | gcc/tree-sra.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index ea351ea9766..01f90844bd0 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -2144,7 +2144,7 @@ static gimple_seq sra_build_assignment (tree dst, tree src) { gimple stmt; - gimple_seq seq = NULL; + gimple_seq seq = NULL, seq2 = NULL; /* Turning BIT_FIELD_REFs into bit operations enables other passes to do a much better job at optimizing the code. From dst = BIT_FIELD_REF <var, sz, off> we produce @@ -2308,6 +2308,8 @@ sra_build_assignment (tree dst, tree src) && !useless_type_conversion_p (TREE_TYPE (dst), TREE_TYPE (src))) src = fold_convert (TREE_TYPE (dst), src); + src = force_gimple_operand (src, &seq2, false, NULL_TREE); + gimple_seq_add_seq (&seq, seq2); stmt = gimple_build_assign (dst, src); gimple_seq_add_stmt (&seq, stmt); return seq; @@ -2597,8 +2599,7 @@ generate_copy_inout (struct sra_elt *elt, bool copy_out, tree expr, t = build2 (COMPLEX_EXPR, elt->type, r, i); tmp_seq = sra_build_bf_assignment (expr, t); - gcc_assert (gimple_seq_singleton_p (tmp_seq)); - SSA_NAME_DEF_STMT (expr) = gimple_seq_first_stmt (tmp_seq); + SSA_NAME_DEF_STMT (expr) = gimple_seq_last_stmt (tmp_seq); gimple_seq_add_seq (seq_p, tmp_seq); } else if (elt->replacement) |