]> gcc.gnu.org Git - gcc.git/commitdiff
loop-iv.c (iv_number_of_iterations): Record the upper bound only if there are no...
authorJan Hubicka <jh@suse.cz>
Sat, 20 Oct 2012 14:19:12 +0000 (16:19 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sat, 20 Oct 2012 14:19:12 +0000 (14:19 +0000)
* loop-iv.c (iv_number_of_iterations): Record the upper bound
only if there are no further conditions on it.

From-SVN: r192636

gcc/ChangeLog
gcc/loop-iv.c

index ecba9c67c68f231c41c5ccdb9d1604c6765d4cf5..47263fd823210578892b8188d47b463fe5b0c0e9 100644 (file)
@@ -1,3 +1,8 @@
+2012-10-20  Jan Hubicka  <jh@suse.cz>
+
+       * loop-iv.c (iv_number_of_iterations): Record the upper bound
+       only if there are no further conditions on it.
+
 2012-10-20  Manuel López-Ibáñez  <manu@gcc.gnu.org>
 
        PR c/53063
index 43d3c4e3ede075580839510fc3674f0f814ee2e9..50b75362a97201562c730db9ad35fae0867075e0 100644 (file)
@@ -2593,8 +2593,10 @@ iv_number_of_iterations (struct loop *loop, rtx insn, rtx condition,
                         ? iv0.base
                         : mode_mmin);
          max = (up - down) / inc + 1;
-         record_niter_bound (loop, double_int::from_uhwi (max),
-                             false, true);
+         if (!desc->infinite
+             && !desc->assumptions)
+           record_niter_bound (loop, double_int::from_uhwi (max),
+                               false, true);
 
          if (iv0.step == const0_rtx)
            {
@@ -2806,15 +2808,19 @@ iv_number_of_iterations (struct loop *loop, rtx insn, rtx condition,
 
       desc->const_iter = true;
       desc->niter = val & GET_MODE_MASK (desc->mode);
-      record_niter_bound (loop, double_int::from_uhwi (desc->niter),
-                         false, true);
+      if (!desc->infinite
+         && !desc->assumptions)
+        record_niter_bound (loop, double_int::from_uhwi (desc->niter),
+                           false, true);
     }
   else
     {
       max = determine_max_iter (loop, desc, old_niter);
       gcc_assert (max);
-      record_niter_bound (loop, double_int::from_uhwi (max),
-                         false, true);
+      if (!desc->infinite
+         && !desc->assumptions)
+       record_niter_bound (loop, double_int::from_uhwi (max),
+                           false, true);
 
       /* simplify_using_initial_values does a copy propagation on the registers
         in the expression for the number of iterations.  This prolongs life
This page took 0.102029 seconds and 5 git commands to generate.