summaryrefslogtreecommitdiff
path: root/gcc/ifcvt.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-22 05:21:10 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-22 05:21:10 +0000
commit5b6ea16e7ab26a5e75f2d2c7836df918f191f804 (patch)
tree52b47aa01a9ec67a95b7c255f3990bda897b57d3 /gcc/ifcvt.c
parent0608064e04b2835b6b43807e387ab527fb53015e (diff)
downloadgcc-5b6ea16e7ab26a5e75f2d2c7836df918f191f804.tar.gz
* ifcvt.c (find_if_block): Allow join_bb as EXIT.
(merge_if_block): Handle fallout from same. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45093 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ifcvt.c')
-rw-r--r--gcc/ifcvt.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index a877a90da18..dc78672a54f 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -1881,7 +1881,9 @@ merge_if_block (test_bb, then_bb, else_bb, join_bb)
is more than one remaining edge, it must come from elsewhere. There
may be zero incoming edges if the THEN block didn't actually join
back up (as with a call to abort). */
- else if (join_bb->pred == NULL || join_bb->pred->pred_next == NULL)
+ else if ((join_bb->pred == NULL
+ || join_bb->pred->pred_next == NULL)
+ && join_bb != EXIT_BLOCK_PTR)
{
/* We can merge the JOIN. */
if (life_data_ok)
@@ -1901,7 +1903,8 @@ merge_if_block (test_bb, then_bb, else_bb, join_bb)
abort ();
/* Remove the jump and cruft from the end of the COMBO block. */
- tidy_fallthru_edge (combo_bb->succ, combo_bb, join_bb);
+ if (join_bb != EXIT_BLOCK_PTR)
+ tidy_fallthru_edge (combo_bb->succ, combo_bb, join_bb);
}
/* Make sure we update life info properly. */
@@ -2067,7 +2070,7 @@ find_if_block (test_bb, then_edge, else_edge)
next_index = then_bb->index;
if (else_bb && ++next_index != else_bb->index)
return FALSE;
- if (++next_index != join_bb->index)
+ if (++next_index != join_bb->index && join_bb->index != EXIT_BLOCK)
{
if (else_bb)
join_bb = NULL;