2017-01-16 Jakub Jelinek <jakub@redhat.com>
+ PR c/79089
+ * gimplify.c (gimplify_init_constructor): If want_value and
+ object == lhs, unshare lhs to avoid invalid tree sharing. Formatting
+ fix.
+
PR target/79080
* loop-doloop.c (doloop_modify): Call unshare_all_rtl_in_chain on
sequence. Formatting fixes.
}
object = TREE_OPERAND (*expr_p, 0);
- ctor = TREE_OPERAND (*expr_p, 1) =
- optimize_compound_literals_in_ctor (TREE_OPERAND (*expr_p, 1));
+ ctor = TREE_OPERAND (*expr_p, 1)
+ = optimize_compound_literals_in_ctor (TREE_OPERAND (*expr_p, 1));
type = TREE_TYPE (ctor);
elts = CONSTRUCTOR_ELTS (ctor);
ret = GS_ALL_DONE;
{
tree lhs = TREE_OPERAND (*expr_p, 0);
tree rhs = TREE_OPERAND (*expr_p, 1);
+ if (want_value && object == lhs)
+ lhs = unshare_expr (lhs);
gassign *init = gimple_build_assign (lhs, rhs);
gimplify_seq_add_stmt (pre_p, init);
}