diff options
Diffstat (limited to 'gcc/tree-cfgcleanup.c')
-rw-r--r-- | gcc/tree-cfgcleanup.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c index 5cce1b6eec7..d3a8ca91aa9 100644 --- a/gcc/tree-cfgcleanup.c +++ b/gcc/tree-cfgcleanup.c @@ -239,6 +239,16 @@ tree_forwarder_block_p (basic_block bb, bool phi_wanted) gcc_assert (bb != ENTRY_BLOCK_PTR); #endif + /* There should not be an edge coming from entry, or an EH edge. */ + { + edge_iterator ei; + edge e; + + FOR_EACH_EDGE (e, ei, bb->preds) + if (e->src == ENTRY_BLOCK_PTR || (e->flags & EDGE_EH)) + return false; + } + /* Now walk through the statements backward. We can ignore labels, anything else means this is not a forwarder block. */ for (gsi = gsi_last_bb (bb); !gsi_end_p (gsi); gsi_prev (&gsi)) @@ -262,9 +272,6 @@ tree_forwarder_block_p (basic_block bb, bool phi_wanted) } } - if (find_edge (ENTRY_BLOCK_PTR, bb)) - return false; - if (current_loops) { basic_block dest; |