OSDN Git Service

* de.po, zh_CN.po: Update.
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa-loop.c
index 03c3249..9e38e91 100644 (file)
@@ -40,7 +40,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 /* The loop tree currently optimized.  */
 
-struct loops *current_loops;
+struct loops *current_loops = NULL;
 
 /* Initializes the loop structures.  DUMP is the file to that the details
    about the analysis should be dumped.  */
@@ -53,8 +53,7 @@ tree_loop_optimizer_init (FILE *dump)
   if (!loops)
     return NULL;
 
-  update_ssa (TODO_update_ssa);
-  rewrite_into_loop_closed_ssa (NULL);
+  rewrite_into_loop_closed_ssa (NULL, TODO_update_ssa);
 
   return loops;
 }
@@ -287,6 +286,31 @@ struct tree_opt_pass pass_iv_canon =
   0                                    /* letter */
 };
 
+/* Propagation of constants using scev.  */
+
+static bool
+gate_scev_const_prop (void)
+{
+  return true;
+}
+
+struct tree_opt_pass pass_scev_cprop =
+{
+  "sccp",                              /* name */
+  gate_scev_const_prop,                        /* gate */
+  scev_const_prop,                     /* execute */
+  NULL,                                        /* sub */
+  NULL,                                        /* next */
+  0,                                   /* static_pass_number */
+  TV_SCEV_CONST,                       /* tv_id */
+  PROP_cfg | PROP_ssa,                 /* properties_required */
+  0,                                   /* properties_provided */
+  0,                                   /* properties_destroyed */
+  0,                                   /* todo_flags_start */
+  TODO_dump_func,                      /* todo_flags_finish */
+  0                                    /* letter */
+};
+
 /* Record bounds on numbers of iterations of loops.  */
 
 static void
@@ -324,13 +348,16 @@ tree_complete_unroll (void)
   if (!current_loops)
     return;
 
-  tree_unroll_loops_completely (current_loops);
+  tree_unroll_loops_completely (current_loops,
+                               flag_unroll_loops
+                               || flag_peel_loops
+                               || optimize >= 3);
 }
 
 static bool
 gate_tree_complete_unroll (void)
 {
-  return flag_peel_loops || flag_unroll_loops;
+  return true;
 }
 
 struct tree_opt_pass pass_complete_unroll =