+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.
/* 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;
}