aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorWill Schmidt <will_schmidt@vnet.ibm.com>2016-10-28 13:28:46 +0000
committerWill Schmidt <willschm@gcc.gnu.org>2016-10-28 13:28:46 +0000
commit0faf9ab4d6abd4f5b74ec2ca46a59a0c4b85f6a4 (patch)
tree0c6a5fcd0df4eadf8a1dfeaa1c7da5091c31c4c4 /gcc/gimplify.c
parent2a762fe1652ff05808a82c5169e44412516de7da (diff)
downloadgcc-0faf9ab4d6abd4f5b74ec2ca46a59a0c4b85f6a4.zip
gcc-0faf9ab4d6abd4f5b74ec2ca46a59a0c4b85f6a4.tar.gz
gcc-0faf9ab4d6abd4f5b74ec2ca46a59a0c4b85f6a4.tar.bz2
re PR middle-end/72747 (powerpc: wrong code generated for vec_splats in cascading assignment)
gcc: 2016-10-26 Will Schmidt <will_schmidt@vnet.ibm.com> PR middle-end/72747 * gimplify.c (gimplify_init_constructor): Move emit of constructor assignment to earlier in the if/else logic. testsuite: 2016-10-26 Will Schmidt <will_schmidt@vnet.ibm.com> PR middle-end/72747 * c-c++-common/pr72747-1.c: New test. * c-c++-common/pr72747-2.c: Likewise. From-SVN: r241647
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 5da1725..1531582 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -4730,24 +4730,23 @@ gimplify_init_constructor (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
if (ret == GS_ERROR)
return GS_ERROR;
- else if (want_value)
+ /* If we have gimplified both sides of the initializer but have
+ not emitted an assignment, do so now. */
+ if (*expr_p)
+ {
+ tree lhs = TREE_OPERAND (*expr_p, 0);
+ tree rhs = TREE_OPERAND (*expr_p, 1);
+ gassign *init = gimple_build_assign (lhs, rhs);
+ gimplify_seq_add_stmt (pre_p, init);
+ }
+ if (want_value)
{
*expr_p = object;
return GS_OK;
}
else
{
- /* If we have gimplified both sides of the initializer but have
- not emitted an assignment, do so now. */
- if (*expr_p)
- {
- tree lhs = TREE_OPERAND (*expr_p, 0);
- tree rhs = TREE_OPERAND (*expr_p, 1);
- gassign *init = gimple_build_assign (lhs, rhs);
- gimplify_seq_add_stmt (pre_p, init);
- *expr_p = NULL;
- }
-
+ *expr_p = NULL;
return GS_ALL_DONE;
}
}