aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/bb-reorder.c21
2 files changed, 21 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ee6029b..7c1958c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2001-01-23 John David Anglin <dave@hiauly1.hia.nrc.ca>
+
+ * 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 <wilson@redhat.com>
* dwarf2out.c (dwarf2out_line): Make last_file_num be unsigned.
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
index 9b8a1bd..08d2326 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;
}