aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 2ea1e57..fb27dd0 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -4810,7 +4810,19 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
return ret;
/* Then gimplify the LHS. */
+ /* If we gimplified the RHS to a CALL_EXPR and that call may return
+ twice we have to make sure to gimplify into non-SSA as otherwise
+ the abnormal edge added later will make those defs not dominate
+ their uses.
+ ??? Technically this applies only to the registers used in the
+ resulting non-register *TO_P. */
+ bool saved_into_ssa = gimplify_ctxp->into_ssa;
+ if (saved_into_ssa
+ && TREE_CODE (*from_p) == CALL_EXPR
+ && call_expr_flags (*from_p) & ECF_RETURNS_TWICE)
+ gimplify_ctxp->into_ssa = false;
ret = gimplify_expr (to_p, pre_p, post_p, is_gimple_lvalue, fb_lvalue);
+ gimplify_ctxp->into_ssa = saved_into_ssa;
if (ret == GS_ERROR)
return ret;