aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Henderson <rth@cygnus.com>1999-03-09 07:49:53 -0800
committerRichard Henderson <rth@gcc.gnu.org>1999-03-09 07:49:53 -0800
commit86a1db604960e827a493f7b6bf74df6137e6e934 (patch)
tree5cd66d0b370b33ae53c4b5e3bc6f7c9c6789230e /gcc
parent39842893a1d85009d64f29d653b8291d9257648b (diff)
downloadgcc-86a1db604960e827a493f7b6bf74df6137e6e934.zip
gcc-86a1db604960e827a493f7b6bf74df6137e6e934.tar.gz
gcc-86a1db604960e827a493f7b6bf74df6137e6e934.tar.bz2
flow.c (tidy_fallthru_edge): Be more careful finding the last BARRIER of a list.
* 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. From-SVN: r25656
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/flow.c22
2 files changed, 19 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2a5b2a9..171d2ea 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+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.
diff --git a/gcc/flow.c b/gcc/flow.c
index 3b4ef6e..1e17112 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -1933,7 +1933,7 @@ tidy_fallthru_edge (e, b, c)
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
@@ -1943,12 +1943,10 @@ tidy_fallthru_edge (e, b, c)
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;
@@ -1963,6 +1961,13 @@ tidy_fallthru_edge (e, b, c)
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);
@@ -1974,7 +1979,8 @@ tidy_fallthru_edge (e, b, c)
}
/* 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;
}