]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
loop.c (strength_reduce): Compute number of iterations as unsigned HOST_WIDE_INT.
authorRichard Henderson <rth@redhat.com>
Sun, 10 Mar 2002 23:46:14 +0000 (15:46 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Sun, 10 Mar 2002 23:46:14 +0000 (15:46 -0800)
        * loop.c (strength_reduce): Compute number of iterations as
        unsigned HOST_WIDE_INT.

From-SVN: r50550

gcc/ChangeLog
gcc/loop.c

index 26ee5030c22656c187a200ded0a26e05a5556ece..378d3cca8131ec9d063289894a5d3084c1aa0c0c 100644 (file)
@@ -1,3 +1,8 @@
+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
index 506984beaaf88e368510a4297c1fea88d4f8f542..3108b032498b169b1b9cefc2b24b6917b24d55eb 100644 (file)
@@ -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)