From b0cc7919bfacf9c1cf1d750089628627674898ea Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Wed, 24 Jan 2001 05:57:46 +0000 Subject: [PATCH] bb-reorder.c (make_reorder_chain_1): Handle case where jump edge goes to the same block as the fallthru edge. * bb-reorder.c (make_reorder_chain_1): Handle case where jump edge goes to the same block as the fallthru edge. From-SVN: r39228 --- gcc/ChangeLog | 5 +++++ gcc/bb-reorder.c | 21 ++++++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ee6029b7e98..7c1958cd33d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2001-01-23 John David Anglin + + * bb-reorder.c (make_reorder_chain_1): Handle case where + jump edge goes to the same block as the fallthru edge. + 2001-01-23 Jim Wilson * dwarf2out.c (dwarf2out_line): Make last_file_num be unsigned. diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c index 9b8a1bd17e6..08d23264632 100644 --- a/gcc/bb-reorder.c +++ b/gcc/bb-reorder.c @@ -397,14 +397,25 @@ make_reorder_chain_1 (bb, prev) /* Find the normal taken edge and the normal fallthru edge. Note that there may in fact be other edges due to - asynchronous_exceptions. */ + asynchronous_exceptions. + + Note, conditional jumps with other side effects may not + be fully optimized. In this case it is possible for + the conditional jump to branch to the same location as + the fallthru path. + + We should probably work to improve optimization of that + case; however, it seems silly not to also deal with such + problems here if they happen to occur. */ e_taken = e_fall = NULL; for (e = bb->succ; e ; e = e->succ_next) - if (e->flags & EDGE_FALLTHRU) - e_fall = e; - else if (! (e->flags & EDGE_EH)) - e_taken = e; + { + if (e->flags & EDGE_FALLTHRU) + e_fall = e; + if (! (e->flags & EDGE_EH)) + e_taken = e; + } next = (taken ? e_taken : e_fall)->dest; } -- 2.30.2