summaryrefslogtreecommitdiff
path: root/gcc/bb-reorder.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2001-01-24 05:57:46 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2001-01-24 05:57:46 +0000
commit5dac36930432f83d1d5ca8ee41255efdb371a9b4 (patch)
tree54679aee67da49a83a244ac395cc6c84b0ea26ed /gcc/bb-reorder.c
parentf8b4f867dca9c78aa3f37a3e1a77354040717c62 (diff)
downloadgcc-5dac36930432f83d1d5ca8ee41255efdb371a9b4.tar.gz
* bb-reorder.c (make_reorder_chain_1): Handle case where
jump edge goes to the same block as the fallthru edge. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39228 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/bb-reorder.c')
-rw-r--r--gcc/bb-reorder.c21
1 files changed, 16 insertions, 5 deletions
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;
}