------- Comment #1 from rakdver at gcc dot gnu dot org  2007-08-21 21:29 -------
This patch fixes the problem:

Index: tree-ssa-loop-niter.c
===================================================================
*** tree-ssa-loop-niter.c       (revision 127674)
--- tree-ssa-loop-niter.c       (working copy)
*************** scev_probably_wraps_p (tree base, tree s
*** 2969,2977 ****
       2032, 2040, 0, 8, ..., but the code is still legal.  */

    if (chrec_contains_undetermined (base)
!       || chrec_contains_undetermined (step)
!       || TREE_CODE (step) != INTEGER_CST)
!     return true;

    if (integer_zerop (step))
      return false;
--- 2969,2975 ----
       2032, 2040, 0, 8, ..., but the code is still legal.  */

    if (chrec_contains_undetermined (base)
!       || chrec_contains_undetermined (step))

    if (integer_zerop (step))
      return false;
*************** scev_probably_wraps_p (tree base, tree s
*** 2981,2986 ****
--- 2979,2989 ----
    if (use_overflow_semantics && nowrap_type_p (type))
      return false;

+   /* To be able to use estimates on number of iterations of the loop,
+      we must have an upper bound on the absolute value of the step.  */
+   if (TREE_CODE (step) != INTEGER_CST)
+     return true;
+
    /* Don't issue signed overflow warnings.  */
    fold_defer_overflow_warnings ();


-- 

rakdver at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |rakdver at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-08-21 21:29:28
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32949

Reply via email to