]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
unroll.c (loop_iterations): Give up on jumps with null JUMP_LABEL while scanning...
authorOlivier Hainque <hainque@act-europe.fr>
Sat, 1 Dec 2001 12:04:16 +0000 (13:04 +0100)
committerFranz Sirl <sirl@gcc.gnu.org>
Sat, 1 Dec 2001 12:04:16 +0000 (12:04 +0000)
2001-12-01  Olivier Hainque <hainque@act-europe.fr>

* unroll.c (loop_iterations): Give up on jumps with null JUMP_LABEL
while scanning for multiple back edges.

From-SVN: r47510

gcc/ChangeLog
gcc/unroll.c

index 666edafc092dbba14c7a65d3422575ea77c4eae9..45aea6a3409701c9646a2702d637f8a6d6b9bf6b 100644 (file)
@@ -1,3 +1,8 @@
+2001-12-01  Olivier Hainque <hainque@act-europe.fr>
+
+       * unroll.c (loop_iterations): Give up on jumps with null JUMP_LABEL
+       while scanning for multiple back edges.
+
 2001-12-01  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>
 
        * ginclude/ppc-asm.h (JUMP_TARGET): New macro.
index b66916e320b88db5f2dcde90cbda6afba7b4ebbc..6502614daf46970f189aa393251888a3529cf3d0 100644 (file)
@@ -3551,18 +3551,31 @@ loop_iterations (loop)
 
       do
        {
-         if (GET_CODE (temp) == JUMP_INSN
-             /* Previous unrolling may have generated new insns not covered
-                by the uid_luid array.  */
-             && INSN_UID (JUMP_LABEL (temp)) < max_uid_for_loop
-             /* Check if we jump back into the loop body.  */
-             && INSN_LUID (JUMP_LABEL (temp)) > INSN_LUID (loop->top)
-             && INSN_LUID (JUMP_LABEL (temp)) < INSN_LUID (loop->cont))
+         if (GET_CODE (temp) == JUMP_INSN)
            {
-             if (loop_dump_stream)
-               fprintf (loop_dump_stream,
-                        "Loop iterations: Loop has multiple back edges.\n");
-             return 0;
+             /* There are some kinds of jumps we can't deal with easily.  */
+             if (JUMP_LABEL (temp) == 0)
+               {
+                 if (loop_dump_stream)
+                   fprintf
+                     (loop_dump_stream,
+                      "Loop iterations: Jump insn has null JUMP_LABEL.\n");
+                 return 0;
+               }
+
+             if (/* Previous unrolling may have generated new insns not
+                    covered by the uid_luid array.  */
+                 INSN_UID (JUMP_LABEL (temp)) < max_uid_for_loop
+                 /* Check if we jump back into the loop body.  */
+                 && INSN_LUID (JUMP_LABEL (temp)) > INSN_LUID (loop->top)
+                 && INSN_LUID (JUMP_LABEL (temp)) < INSN_LUID (loop->cont))
+               {
+                 if (loop_dump_stream)
+                   fprintf 
+                     (loop_dump_stream,
+                      "Loop iterations: Loop has multiple back edges.\n");
+                 return 0;
+               }
            }
        }
       while ((temp = PREV_INSN (temp)) != loop->cont);