aboutsummaryrefslogtreecommitdiff
path: root/gcc/jump.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2001-07-26 22:36:01 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2001-07-26 20:36:01 +0000
commit01f62f016bb811b0010a36d058c660882a92ca1c (patch)
tree4d6e8197e32e92b663df66e7f3d07be1ccf41202 /gcc/jump.c
parentaa069f77b2591aed51274befe68aeef5c903f45c (diff)
downloadgcc-01f62f016bb811b0010a36d058c660882a92ca1c.zip
gcc-01f62f016bb811b0010a36d058c660882a92ca1c.tar.gz
gcc-01f62f016bb811b0010a36d058c660882a92ca1c.tar.bz2
rtl.h (cleanup_barriers): Declare.
* rtl.h (cleanup_barriers): Declare. * jump.c (cleanup_barriers): New function. * toplev.c (rest_of_compilation): Call cleanup_barriers before loop optimizer and after bb_reorder. * flow.c (back_edge_of_syntactic_loop_p): New. (split_edge): Use it. From-SVN: r44409
Diffstat (limited to 'gcc/jump.c')
-rw-r--r--gcc/jump.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/jump.c b/gcc/jump.c
index 01fc741..e77ba56 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -100,6 +100,32 @@ rebuild_jump_labels (f)
LABEL_NUSES (XEXP (insn, 0))++;
}
+/* Some old code expects exactly one BARRIER as the NEXT_INSN of a
+ non-fallthru insn. This is not generally true, as multiple barriers
+ may have crept in, or the BARRIER may be separated from the last
+ real insn by one or more NOTEs.
+
+ This simple pass moves barriers and removes duplicates so that the
+ old code is happy.
+ */
+void
+cleanup_barriers ()
+{
+ rtx insn, next, prev;
+ for (insn = get_insns (); insn; insn = next)
+ {
+ next = NEXT_INSN (insn);
+ if (GET_CODE (insn) == BARRIER)
+ {
+ prev = prev_nonnote_insn (insn);
+ if (GET_CODE (prev) == BARRIER)
+ delete_barrier (insn);
+ else if (prev != PREV_INSN (insn))
+ reorder_insns (insn, insn, prev);
+ }
+ }
+}
+
void
copy_loop_headers (f)
rtx f;