summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-16 17:04:55 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-16 17:04:55 +0000
commit14abf9235794ba37b9ad3ef6381ad36c3606370d (patch)
tree824f1fd2ba2be6b766d13a1d7de9d099554c905d
parent3ccc58a6ebc96ac94707c335826ed094c0e54a4c (diff)
downloadgcc-14abf9235794ba37b9ad3ef6381ad36c3606370d.tar.gz
* cfgrtl.c (purge_dead_edges): Correct handling of EDGE_EH.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53521 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/cfgrtl.c19
2 files changed, 18 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 38654fbbbe0..50e7bdd9341 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2002-05-16 Mark Mitchell <mark@codesourcery.com>
+
+ * cfgrtl.c (purge_dead_edges): Correct handling of EDGE_EH.
+
2002-05-16 Nick Clifton <nickc@cambridge.redhat.com>
* config/arm/arm.c (arm_rtx_costs): Check for RTX being a
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index 9a6661d7e61..844f5df70f5 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -2186,17 +2186,26 @@ purge_dead_edges (bb)
e->flags &= ~EDGE_ABNORMAL;
- /* Check purposes we can have edge. */
- if ((e->flags & EDGE_FALLTHRU)
- && any_condjump_p (insn))
+ /* See if this edge is one we should keep. */
+ if ((e->flags & EDGE_FALLTHRU) && any_condjump_p (insn))
+ /* A conditional jump can fall through into the next
+ block, so we should keep the edge. */
continue;
else if (e->dest != EXIT_BLOCK_PTR
&& e->dest->head == JUMP_LABEL (insn))
+ /* If the destination block is the target of the jump,
+ keep the edge. */
+ continue;
+ else if (e->dest == EXIT_BLOCK_PTR && returnjump_p (insn))
+ /* If the destination block is the exit block, and this
+ instruction is a return, then keep the edge. */
continue;
- else if (e->dest == EXIT_BLOCK_PTR
- && returnjump_p (insn))
+ else if ((e->flags & EDGE_EH) && can_throw_internal (insn))
+ /* Keep the edges that correspond to exceptions thrown by
+ this instruction. */
continue;
+ /* We do not need this edge. */
bb->flags |= BB_DIRTY;
purged = true;
remove_edge (e);