diff options
author | Jan Hubicka <jh@suse.cz> | 2001-07-26 22:36:01 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2001-07-26 20:36:01 +0000 |
commit | 01f62f016bb811b0010a36d058c660882a92ca1c (patch) | |
tree | 4d6e8197e32e92b663df66e7f3d07be1ccf41202 /gcc/jump.c | |
parent | aa069f77b2591aed51274befe68aeef5c903f45c (diff) | |
download | gcc-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.c | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -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; |