diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-30 21:59:04 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-30 21:59:04 +0000 |
commit | 19bcc4242224959c27d42d3675f678d6dc12b4a8 (patch) | |
tree | a216f979d556248ae6aaf835392bed7085a3b65d /gcc/tree-eh.c | |
parent | 94b5c9e7f8d15ece6dfa43c2bbf29fb0d053b46b (diff) | |
download | gcc-19bcc4242224959c27d42d3675f678d6dc12b4a8.tar.gz |
PR middle-end/51089
* tree-eh.c (cleanup_empty_eh_merge_phis): Add check to
avoid creating duplicate edges here.
(cleanup_empty_eh_unsplit): And remove it in the caller.
* gfortran.dg/gomp/pr51089.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181859 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-eh.c')
-rw-r--r-- | gcc/tree-eh.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c index 5faeefed55f..57abca80e4e 100644 --- a/gcc/tree-eh.c +++ b/gcc/tree-eh.c @@ -3653,6 +3653,22 @@ cleanup_empty_eh_merge_phis (basic_block new_bb, basic_block old_bb, bitmap rename_virts; bitmap ophi_handled; + /* 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 and PR51089. */ + FOR_EACH_EDGE (e, ei, old_bb->preds) + if (find_edge (e->src, new_bb)) + return false; + FOR_EACH_EDGE (e, ei, old_bb->preds) redirect_edge_var_map_clear (e); @@ -3815,8 +3831,6 @@ 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 @@ -3839,22 +3853,6 @@ 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)) { |