aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2001-07-23 17:57:46 -0700
committerRichard Henderson <rth@gcc.gnu.org>2001-07-23 17:57:46 -0700
commit6a7ca9966bb1501aa57ebd55c6282b3853316104 (patch)
tree3d6096a1c1859078033ec0892d82157a42989109
parent82efa2e52463ab63a7c9d3bb975aa1b6750a29be (diff)
downloadgcc-6a7ca9966bb1501aa57ebd55c6282b3853316104.zip
gcc-6a7ca9966bb1501aa57ebd55c6282b3853316104.tar.gz
gcc-6a7ca9966bb1501aa57ebd55c6282b3853316104.tar.bz2
* flow.c (try_simplify_condjump): Use tidy_fallthru_edge.
From-SVN: r44287
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/flow.c11
2 files changed, 10 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b66c8ca..ed7a5ae 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2001-07-23 Richard Henderson <rth@redhat.com>
+
+ * flow.c (try_simplify_condjump): Use tidy_fallthru_edge.
+
2001-07-23 Kazu Hirata <kazu@hxi.com>
* config/h8300/h8300-protos.h: Add a prototype for
diff --git a/gcc/flow.c b/gcc/flow.c
index 12712f2..904684a 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -3073,17 +3073,18 @@ try_simplify_condjump (cbranch_block)
fprintf (rtl_dump_file, "Simplifying condjump %i around jump %i\n",
INSN_UID (cbranch_insn), INSN_UID (jump_block->end));
- /* Success. Update the CFG to match. */
+ /* Success. Update the CFG to match. Note that after this point
+ the edge variable names appear backwards; the redirection is done
+ this way to preserve edge profile data. */
redirect_edge_succ (cbranch_jump_edge, cbranch_dest_block);
redirect_edge_succ (cbranch_fallthru_edge, jump_dest_block);
cbranch_jump_edge->flags |= EDGE_FALLTHRU;
cbranch_fallthru_edge->flags &= ~EDGE_FALLTHRU;
+ /* Delete the block with the unconditional jump, and clean up the mess. */
flow_delete_block (jump_block);
- /* Selectively unlink the sequence. */
- if (cbranch_jump_edge->src->end != PREV_INSN (cbranch_jump_edge->dest->head))
- flow_delete_insn_chain (NEXT_INSN (cbranch_jump_edge->src->end),
- PREV_INSN (cbranch_jump_edge->dest->head));
+ tidy_fallthru_edge (cbranch_jump_edge, cbranch_block, cbranch_dest_block);
+
return true;
}