]> gcc.gnu.org Git - gcc.git/commitdiff
(thread_jumps): Don't thread to loop label; create new label before loop instead.
authorTorbjorn Granlund <tege@gnu.org>
Mon, 3 Jan 1994 22:20:01 +0000 (22:20 +0000)
committerTorbjorn Granlund <tege@gnu.org>
Mon, 3 Jan 1994 22:20:01 +0000 (22:20 +0000)
(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

index b2181a5afec8b861e077d9a1ac4d5b825e41cf1c..9e0230fb05e5fd11c3245b92093fa7a81117bf96 100644 (file)
@@ -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;
                    }
                    
This page took 2.204583 seconds and 5 git commands to generate.