From aa38b201de427ef4f2124ef66e91a5e82e67be0b Mon Sep 17 00:00:00 2001 From: Torbjorn Granlund Date: Mon, 3 Jan 1994 22:20:01 +0000 Subject: [PATCH] (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 --- gcc/jump.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/gcc/jump.c b/gcc/jump.c index b2181a5..9e0230f 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -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; } -- 2.7.4