From: Olivier Hainque Date: Sat, 1 Dec 2001 12:04:16 +0000 (+0100) Subject: unroll.c (loop_iterations): Give up on jumps with null JUMP_LABEL while scanning... X-Git-Tag: prereleases/libstdc++-3.0.95~599 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a22455dfa1b41a8be2dd496a997ac13426f2f00f;p=thirdparty%2Fgcc.git unroll.c (loop_iterations): Give up on jumps with null JUMP_LABEL while scanning for multiple back edges. 2001-12-01 Olivier Hainque * unroll.c (loop_iterations): Give up on jumps with null JUMP_LABEL while scanning for multiple back edges. From-SVN: r47510 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 666edafc092d..45aea6a34097 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2001-12-01 Olivier Hainque + + * unroll.c (loop_iterations): Give up on jumps with null JUMP_LABEL + while scanning for multiple back edges. + 2001-12-01 Franz Sirl * ginclude/ppc-asm.h (JUMP_TARGET): New macro. diff --git a/gcc/unroll.c b/gcc/unroll.c index b66916e320b8..6502614daf46 100644 --- a/gcc/unroll.c +++ b/gcc/unroll.c @@ -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);