OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa-loop-ivcanon.c
index df48dfd..187f53c 100644 (file)
@@ -1,5 +1,6 @@
 /* Induction variable canonicalization.
-   Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005, 2007, 2008, 2010
+   Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -37,17 +38,14 @@ along with GCC; see the file COPYING3.  If not see
 #include "coretypes.h"
 #include "tm.h"
 #include "tree.h"
-#include "rtl.h"
 #include "tm_p.h"
-#include "hard-reg-set.h"
 #include "basic-block.h"
-#include "output.h"
-#include "diagnostic.h"
+#include "tree-pretty-print.h"
+#include "gimple-pretty-print.h"
 #include "tree-flow.h"
 #include "tree-dump.h"
 #include "cfgloop.h"
 #include "tree-pass.h"
-#include "ggc.h"
 #include "tree-chrec.h"
 #include "tree-scalar-evolution.h"
 #include "params.h"
@@ -164,12 +162,8 @@ constant_after_peeling (tree op, gimple stmt, struct loop *loop)
       /* First make fast look if we see constant array inside.  */
       while (handled_component_p (base))
        base = TREE_OPERAND (base, 0);
-      if ((DECL_P (base)
-          && TREE_STATIC (base)
-          && TREE_READONLY (base)
-           && (DECL_INITIAL (base)
-              || (!DECL_EXTERNAL (base)
-                  && targetm.binds_local_p (base))))
+      if ((DECL_P (base) == VAR_DECL
+          && const_value_known_p (base))
          || CONSTANT_CLASS_P (base))
        {
          /* If so, see if we understand all the indices.  */
@@ -405,7 +399,7 @@ try_unroll_loop_completely (struct loop *loop,
          return false;
        }
 
-      for (i = 0; VEC_iterate (edge, to_remove, i, e); i++)
+      FOR_EACH_VEC_ELT (edge, to_remove, i, e)
        {
          bool ok = remove_path (e);
          gcc_assert (ok);
@@ -522,6 +516,7 @@ tree_unroll_loops_completely (bool may_increase_size, bool unroll_outer)
   struct loop *loop;
   bool changed;
   enum unroll_level ul;
+  int iteration = 0;
 
   do
     {
@@ -554,7 +549,8 @@ tree_unroll_loops_completely (bool may_increase_size, bool unroll_outer)
          scev_reset ();
        }
     }
-  while (changed);
+  while (changed
+        && ++iteration <= PARAM_VALUE (PARAM_MAX_UNROLL_ITERATIONS));
 
   return 0;
 }