(jump_optimize): When handle a USE insn before an unconditional jump...
authorJim Wilson <wilson@gcc.gnu.org>
Mon, 11 Mar 1996 18:12:30 +0000 (10:12 -0800)
committerJim Wilson <wilson@gcc.gnu.org>
Mon, 11 Mar 1996 18:12:30 +0000 (10:12 -0800)
(jump_optimize): When handle a USE insn before an
unconditional jump, disable the optimization if the USE is the
only insn in the loop.

From-SVN: r11512

gcc/jump.c

index f668a472bc80a86a5a78c003ac9089bee6c26623..2b9218a776302076a0f92d2a9a33d2e9fd721558 100644 (file)
@@ -682,7 +682,15 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
              && (temp1 = prev_nonnote_insn (JUMP_LABEL (insn))) != 0
              && (GET_CODE (temp1) == BARRIER
                  || (GET_CODE (temp1) == INSN
-                     && rtx_equal_p (PATTERN (temp), PATTERN (temp1)))))
+                     && rtx_equal_p (PATTERN (temp), PATTERN (temp1))))
+             /* Don't do this optimization if we have a loop containing only
+                the USE instruction, and the loop start label has a usage
+                count of 1.  This is because we will redo this optimization
+                everytime through the outer loop, and jump opt will never
+                exit.  */
+             && ! ((temp2 = prev_nonnote_insn (temp)) != 0
+                   && temp2 == JUMP_LABEL (insn)
+                   && LABEL_NUSES (temp2) == 1))
            {
              if (GET_CODE (temp1) == BARRIER)
                {