diff options
author | Richard Biener <rguenther@suse.de> | 2016-07-13 08:03:04 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2016-07-13 08:03:04 +0000 |
commit | 7f15b177ba2b5907242dec45da10da635df3e16e (patch) | |
tree | ea0b49d988c805f076b94649d35c07b127b9da16 /gcc/gimplify.c | |
parent | 4a0e3b5ac35c0f2b2b7b93aee81ddb10a45ff6d3 (diff) | |
download | gcc-7f15b177ba2b5907242dec45da10da635df3e16e.zip gcc-7f15b177ba2b5907242dec45da10da635df3e16e.tar.gz gcc-7f15b177ba2b5907242dec45da10da635df3e16e.tar.bz2 |
re PR tree-optimization/71104 (ICE: verify_ssa failed (with vfork / error: definition in block 3 does not dominate use in block 7 ))
2016-07-13 Richard Biener <rguenther@suse.de>
PR middle-end/71104
* gimplify.c (gimplify_modify_expr): Gimplify the RHS before
gimplifying the LHS. Make sure to gimplify a returning twice
call LHS without using SSA names.
* gcc.dg/pr71104-1.c: New testcase.
* gcc.dg/pr71104-2.c: Likewise.
From-SVN: r238287
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 12 |
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; |