summaryrefslogtreecommitdiff
path: root/gcc/tree-eh.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-16 11:42:50 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-16 11:42:50 +0000
commit8cbab43373292cd84bb1a105f5523fc1bc945114 (patch)
treed61657bcab2eff1e8c65657c9310e16ee7012d42 /gcc/tree-eh.c
parentc6347c7a61e6b4f4eb000ef71f459c2cda5062d0 (diff)
downloadgcc-8cbab43373292cd84bb1a105f5523fc1bc945114.tar.gz
2010-11-16 Richard Guenther <rguenther@suse.de>
PR middle-end/45172 * tree-eh.c (cleanup_empty_eh_unsplit): Avoid creating duplicate edges. * gfortran.dg/gomp/pr45172.f90: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166794 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-eh.c')
-rw-r--r--gcc/tree-eh.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index 8a99ad3aa4f..270d76d9480 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -3670,6 +3670,8 @@ cleanup_empty_eh_unsplit (basic_block bb, edge e_out, eh_landing_pad lp)
{
gimple_stmt_iterator gsi;
tree lab;
+ edge_iterator ei;
+ edge e;
/* We really ought not have totally lost everything following
a landing pad label. Given that BB is empty, there had better
@@ -3692,6 +3694,22 @@ cleanup_empty_eh_unsplit (basic_block bb, edge e_out, eh_landing_pad lp)
return false;
}
+ /* The destination block must not be a regular successor for any
+ of the preds of the landing pad. Thus, avoid turning
+ <..>
+ | \ EH
+ | <..>
+ | /
+ <..>
+ into
+ <..>
+ | | EH
+ <..>
+ which CFG verification would choke on. See PR45172. */
+ FOR_EACH_EDGE (e, ei, bb->preds)
+ if (find_edge (e->src, e_out->dest))
+ return false;
+
/* Attempt to move the PHIs into the successor block. */
if (cleanup_empty_eh_merge_phis (e_out->dest, bb, e_out, false))
{