diff options
author | Torbjorn Granlund <tege@gnu.org> | 1994-01-03 22:20:01 +0000 |
---|---|---|
committer | Torbjorn Granlund <tege@gnu.org> | 1994-01-03 22:20:01 +0000 |
commit | aa38b201de427ef4f2124ef66e91a5e82e67be0b (patch) | |
tree | a25165f35d2b4b27922886fde5a1d43d8ad2efb2 | |
parent | 8b39ed65f13d64dbf5fe0083837eb1cbf039a5f4 (diff) | |
download | gcc-aa38b201de427ef4f2124ef66e91a5e82e67be0b.zip gcc-aa38b201de427ef4f2124ef66e91a5e82e67be0b.tar.gz gcc-aa38b201de427ef4f2124ef66e91a5e82e67be0b.tar.bz2 |
(thread_jumps): Don't thread to loop label; create new label before loop instead.
(thread_jumps): Don't thread to loop label; create new label
before loop instead.
(thread_jumps): Rename argument `verbose' -> `flag_before_jump'.
From-SVN: r6354
-rw-r--r-- | gcc/jump.c | 22 |
1 files changed, 17 insertions, 5 deletions
@@ -3946,10 +3946,10 @@ mark_modified_reg (dest, x) /* F is the first insn in the chain of insns. */ void -thread_jumps (f, max_reg, verbose) +thread_jumps (f, max_reg, flag_before_loop) rtx f; int max_reg; - int verbose; + int flag_before_loop; { /* Basic algorithm is to find a conditional branch, the label it may branch to, and the branch after @@ -4090,9 +4090,21 @@ thread_jumps (f, max_reg, verbose) else new_label = get_label_after (b2); - if (JUMP_LABEL (b1) != new_label - && redirect_jump (b1, new_label)) - changed = 1; + if (JUMP_LABEL (b1) != new_label) + { + rtx prev = PREV_INSN (new_label); + + if (flag_before_loop + && NOTE_LINE_NUMBER (prev) == NOTE_INSN_LOOP_BEG) + { + /* Don't thread to the loop label. If a loop + label is reused, loop optimization will + be disabled for that loop. */ + new_label = gen_label_rtx (); + emit_label_after (new_label, PREV_INSN (prev)); + } + changed |= redirect_jump (b1, new_label); + } break; } |