diff options
author | Richard Henderson <rth@redhat.com> | 2002-03-10 15:46:14 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2002-03-10 15:46:14 -0800 |
commit | 26b738be01562bb7cf45e9bcd93838af69a0d9bd (patch) | |
tree | 2fbb3d0587a9cec6f404c15cbbf3d81173a818c1 | |
parent | 8d8a083e9c81948217d3a5cb3010d4f6ed910222 (diff) | |
download | gcc-26b738be01562bb7cf45e9bcd93838af69a0d9bd.zip gcc-26b738be01562bb7cf45e9bcd93838af69a0d9bd.tar.gz gcc-26b738be01562bb7cf45e9bcd93838af69a0d9bd.tar.bz2 |
loop.c (strength_reduce): Compute number of iterations as unsigned HOST_WIDE_INT.
* loop.c (strength_reduce): Compute number of iterations as
unsigned HOST_WIDE_INT.
From-SVN: r50550
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/loop.c | 12 |
2 files changed, 11 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 26ee503..378d3cc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2002-03-10 Richard Henderson <rth@redhat.com> + * loop.c (strength_reduce): Compute number of iterations as + unsigned HOST_WIDE_INT. + +2002-03-10 Richard Henderson <rth@redhat.com> + * sched-rgn.c (add_branch_dependences): Don't allow insns that throw to move away from the end of the block. @@ -5225,13 +5225,13 @@ strength_reduce (loop, flags) /* In case number of iterations is known, drop branch prediction note in the branch. Do that only in second loop pass, as loop unrolling may change the number of iterations performed. */ - if ((flags & LOOP_BCT) - && loop_info->n_iterations / loop_info->unroll_number > 1) + if (flags & LOOP_BCT) { - int n = loop_info->n_iterations / loop_info->unroll_number; - predict_insn (PREV_INSN (loop->end), - PRED_LOOP_ITERATIONS, - REG_BR_PROB_BASE - REG_BR_PROB_BASE / n); + unsigned HOST_WIDE_INT n + = loop_info->n_iterations / loop_info->unroll_number; + if (n > 1) + predict_insn (PREV_INSN (loop->end), PRED_LOOP_ITERATIONS, + REG_BR_PROB_BASE - REG_BR_PROB_BASE / n); } if (loop_dump_stream) |