OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa-loop-niter.c
index 544ead2..796991b 100644 (file)
@@ -634,11 +634,15 @@ expand_simple_operations (tree expr)
 {
   unsigned i, n;
   tree ret = NULL_TREE, e, ee, stmt;
-  enum tree_code code = TREE_CODE (expr);
+  enum tree_code code;
+
+  if (expr == NULL_TREE)
+    return expr;
 
   if (is_gimple_min_invariant (expr))
     return expr;
 
+  code = TREE_CODE (expr);
   if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (code)))
     {
       n = TREE_CODE_LENGTH (code);
@@ -1433,10 +1437,12 @@ infer_loop_bounds_from_undefined (struct loop *loop)
 
                /* For each array access, analyze its access function
                   and record a bound on the loop iteration domain.  */
-               if (TREE_CODE (op1) == ARRAY_REF)
+               if (TREE_CODE (op1) == ARRAY_REF 
+                   && !array_ref_contains_indirect_ref (op1))
                  estimate_iters_using_array (stmt, op1);
 
-               if (TREE_CODE (op0) == ARRAY_REF)
+               if (TREE_CODE (op0) == ARRAY_REF 
+                   && !array_ref_contains_indirect_ref (op0))
                  estimate_iters_using_array (stmt, op0);
 
                /* For each signed type variable in LOOP, analyze its
@@ -1487,7 +1493,8 @@ infer_loop_bounds_from_undefined (struct loop *loop)
 
                for (args = TREE_OPERAND (stmt, 1); args;
                     args = TREE_CHAIN (args))
-                 if (TREE_CODE (TREE_VALUE (args)) == ARRAY_REF)
+                 if (TREE_CODE (TREE_VALUE (args)) == ARRAY_REF
+                     && !array_ref_contains_indirect_ref (TREE_VALUE (args)))
                    estimate_iters_using_array (stmt, TREE_VALUE (args));
 
                break;
@@ -2000,11 +2007,13 @@ convert_step (struct loop *loop, tree new_type, tree base, tree step,
 
 /* Frees the information on upper bounds on numbers of iterations of LOOP.  */
 
-static void
+void
 free_numbers_of_iterations_estimates_loop (struct loop *loop)
 {
   struct nb_iter_bound *bound, *next;
-  
+
+  loop->nb_iterations = NULL;
+  loop->estimated_nb_iterations = NULL;
   for (bound = loop->bounds; bound; bound = next)
     {
       next = bound->next;