diff options
author | (no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-05 00:40:41 +0000 |
---|---|---|
committer | (no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-05 00:40:41 +0000 |
commit | f6ff45b5b0d670379779a72fe907f5147c2459bb (patch) | |
tree | b1540de4319151105aaad777b387219ef01bc592 /gcc/tree-if-conv.c | |
parent | 521f3adaa1baeaf00caf66ecb1761b845c1bcea7 (diff) |
This commit was manufactured by cvs2svn to create tagbje-unsw-branchpoint
'bje-unsw-branchpoint'.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/tags/bje-unsw-branchpoint@97592 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-if-conv.c')
-rw-r--r-- | gcc/tree-if-conv.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c index 52bcfba69fb..b7ed8380acf 100644 --- a/gcc/tree-if-conv.c +++ b/gcc/tree-if-conv.c @@ -858,7 +858,8 @@ combine_blocks (struct loop *loop) basic_block bb, exit_bb, merge_target_bb; unsigned int orig_loop_num_nodes = loop->num_nodes; unsigned int i; - + unsigned int n_exits; + edge *exits = get_loop_exit_edges (loop, &n_exits); /* Process phi nodes to prepare blocks for merge. */ process_phi_nodes (loop); @@ -903,11 +904,23 @@ combine_blocks (struct loop *loop) continue; /* It is time to remove this basic block. First remove edges. */ - while (EDGE_COUNT (bb->succs) > 0) - remove_edge (EDGE_SUCC (bb, 0)); while (EDGE_COUNT (bb->preds) > 0) remove_edge (EDGE_PRED (bb, 0)); + /* This is loop latch and loop does not have exit then do not + delete this basic block. Just remove its PREDS and reconnect + loop->header and loop->latch blocks. */ + if (bb == loop->latch && n_exits == 0) + { + exits = NULL; /* To suppress unused warning. */ + make_edge (loop->header, loop->latch, EDGE_FALLTHRU); + set_immediate_dominator (CDI_DOMINATORS, loop->latch, loop->header); + continue; + } + + while (EDGE_COUNT (bb->succs) > 0) + remove_edge (EDGE_SUCC (bb, 0)); + /* Remove labels and make stmts member of loop->header. */ for (bsi = bsi_start (bb); !bsi_end_p (bsi); ) { |