+Tue Mar 9 15:48:15 1999 Richard Henderson <rth@cygnus.com>
+
+ * flow.c (tidy_fallthru_edge): Be more careful finding the last
+ BARRIER of a list. Delete the cc0 setter as well as a cond jump.
+
Tue Mar 9 15:26:02 1999 Hans-Peter Nilsson <hp@bitrange.com>
* i386.md (ashlsi3 splitter): Fix typo in last change.
edge e;
basic_block b, c;
{
- rtx p, q, h;
+ rtx q, h;
/* ??? In a late-running flow pass, other folks may have deleted basic
blocks by nopping out blocks, leaving multiple BARRIERs between here
barriers and notes. */
q = NEXT_INSN (b->end);
- do
- {
- p = q;
- q = next_nonnote_insn (q);
- }
- while (GET_CODE (q) == BARRIER);
+ if (q && GET_CODE (q) == NOTE)
+ q = next_nonnote_insn (q);
+ while (q && GET_CODE (q) == BARRIER)
+ q = next_nonnote_insn (q);
/* Assert that we now actually do fall through. */
h = c->head;
q = b->end;
if (GET_CODE (q) == JUMP_INSN)
{
+#ifdef HAVE_cc0
+ /* If this was a conditional jump, we need to also delete
+ the insn that set cc0. */
+ if (! simplejump_p (q) && condjump_p (q))
+ q = PREV_INSN (q);
+#endif
+
if (b->head == q)
{
PUT_CODE (q, NOTE);
}
/* Selectively unlink the sequence. */
- delete_insn_chain (NEXT_INSN (q), p);
+ if (q != PREV_INSN (c->head))
+ delete_insn_chain (NEXT_INSN (q), PREV_INSN (c->head));
e->flags |= EDGE_FALLTHRU;
}