diff options
Diffstat (limited to 'gcc/tree-ssa-threadedge.c')
-rw-r--r-- | gcc/tree-ssa-threadedge.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/gcc/tree-ssa-threadedge.c b/gcc/tree-ssa-threadedge.c index 24ccf01..37ee5c1 100644 --- a/gcc/tree-ssa-threadedge.c +++ b/gcc/tree-ssa-threadedge.c @@ -1261,6 +1261,18 @@ jump_threader::thread_across_edge (edge e) m_state->pop (); } +/* Return TRUE if BB has a single successor to a block with multiple + incoming and outgoing edges. */ + +bool +single_succ_to_potentially_threadable_block (basic_block bb) +{ + int flags = (EDGE_IGNORE | EDGE_COMPLEX | EDGE_ABNORMAL); + return (single_succ_p (bb) + && (single_succ_edge (bb)->flags & flags) == 0 + && potentially_threadable_block (single_succ (bb))); +} + /* Examine the outgoing edges from BB and conditionally try to thread them. */ @@ -1274,12 +1286,8 @@ jump_threader::thread_outgoing_edges (basic_block bb) outgoing edges, then we may be able to thread the edge, i.e., we may be able to statically determine which of the outgoing edges will be traversed when the incoming edge from BB is traversed. */ - if (single_succ_p (bb) - && (single_succ_edge (bb)->flags & flags) == 0 - && potentially_threadable_block (single_succ (bb))) - { - thread_across_edge (single_succ_edge (bb)); - } + if (single_succ_to_potentially_threadable_block (bb)) + thread_across_edge (single_succ_edge (bb)); else if ((last = last_stmt (bb)) && gimple_code (last) == GIMPLE_COND && EDGE_COUNT (bb->succs) == 2 |