aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-phiopt.c
diff options
context:
space:
mode:
authorZdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>2004-07-17 20:08:10 +0200
committerZdenek Dvorak <rakdver@gcc.gnu.org>2004-07-17 18:08:10 +0000
commit8a807136e16752e8024f34967cf2071e4c1c284f (patch)
treef9b4d8d5ff8c3cf2b8b7d8b0817c4d09fca2073d /gcc/tree-ssa-phiopt.c
parent0e242c8215a01f83fd09116711e8ec13e5341d93 (diff)
downloadgcc-8a807136e16752e8024f34967cf2071e4c1c284f.zip
gcc-8a807136e16752e8024f34967cf2071e4c1c284f.tar.gz
gcc-8a807136e16752e8024f34967cf2071e4c1c284f.tar.bz2
loop-init.c (loop_optimizer_init, [...]): Do not destroy dominance information.
* loop-init.c (loop_optimizer_init, loop_optimizer_finalize): Do not destroy dominance information. * passes.c (rest_of_handle_loop2): Free dominance information. * tree-cfg.c (cleanup_tree_cfg): Remove unreachable blocks before jump threading. (thread_jumps): Update dominance information and remove unreachable blocks. * tree-ssa-phiopt.c (replace_phi_with_stmt): Update dominance information and remove the unreachable block. From-SVN: r84873
Diffstat (limited to 'gcc/tree-ssa-phiopt.c')
-rw-r--r--gcc/tree-ssa-phiopt.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c
index bc14dc4..50c845e 100644
--- a/gcc/tree-ssa-phiopt.c
+++ b/gcc/tree-ssa-phiopt.c
@@ -236,6 +236,8 @@ static void
replace_phi_with_stmt (block_stmt_iterator bsi, basic_block bb,
basic_block cond_block, tree phi, tree new)
{
+ basic_block block_to_remove;
+
/* Insert our new statement at the head of our block. */
bsi_insert_after (&bsi, new, BSI_NEW_STMT);
@@ -250,21 +252,23 @@ replace_phi_with_stmt (block_stmt_iterator bsi, basic_block bb,
release_phi_node (phi);
bb_ann (bb)->phi_nodes = NULL;
- /* Disconnect the edge leading into the empty block. That will
- make the empty block unreachable and it will be removed later. */
+ /* Remove the empty basic block. */
if (cond_block->succ->dest == bb)
{
cond_block->succ->flags |= EDGE_FALLTHRU;
cond_block->succ->flags &= ~(EDGE_TRUE_VALUE | EDGE_FALSE_VALUE);
- ssa_remove_edge (cond_block->succ->succ_next);
+
+ block_to_remove = cond_block->succ->succ_next->dest;
}
else
{
cond_block->succ->succ_next->flags |= EDGE_FALLTHRU;
cond_block->succ->succ_next->flags
&= ~(EDGE_TRUE_VALUE | EDGE_FALSE_VALUE);
- ssa_remove_edge (cond_block->succ);
+
+ block_to_remove = cond_block->succ->dest;
}
+ delete_basic_block (block_to_remove);
/* Eliminate the COND_EXPR at the end of COND_BLOCK. */
bsi = bsi_last (cond_block);