OSDN Git Service

* es.po: Update.
[pf3gnuchains/gcc-fork.git] / gcc / tree-loop-distribution.c
index 920ab8c..746e442 100644 (file)
@@ -1,5 +1,6 @@
 /* Loop distribution.
-   Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2007, 2008, 2009, 2010
+   Free Software Foundation, Inc.
    Contributed by Georges-Andre Silber <Georges-Andre.Silber@ensmp.fr>
    and Sebastian Pop <sebastian.pop@amd.com>.
 
@@ -45,11 +46,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "system.h"
 #include "coretypes.h"
 #include "tm.h"
-#include "ggc.h"
 #include "tree.h"
-#include "target.h"
-
-#include "rtl.h"
 #include "basic-block.h"
 #include "diagnostic.h"
 #include "tree-flow.h"
@@ -226,12 +223,9 @@ build_size_arg_loc (location_t loc, tree nb_iter, tree op,
                    gimple_seq *stmt_list)
 {
   gimple_seq stmts;
-  tree x;
-
-  x = fold_build2_loc (loc, MULT_EXPR, size_type_node,
-                      fold_convert_loc (loc, size_type_node, nb_iter),
-                      fold_convert_loc (loc, size_type_node,
-                                        TYPE_SIZE_UNIT (TREE_TYPE (op))));
+  tree x = size_binop_loc (loc, MULT_EXPR,
+                          fold_convert_loc (loc, sizetype, nb_iter),
+                          TYPE_SIZE_UNIT (TREE_TYPE (op)));
   x = force_gimple_operand (x, &stmts, true, NULL);
   gimple_seq_add_seq (stmt_list, stmts);
 
@@ -285,6 +279,8 @@ generate_memset_zero (gimple stmt, tree op0, tree nb_iter,
       addr_base = fold_convert_loc (loc, sizetype, addr_base);
       addr_base = size_binop_loc (loc, MINUS_EXPR, addr_base,
                                  fold_convert_loc (loc, sizetype, nb_bytes));
+      addr_base = size_binop_loc (loc, PLUS_EXPR, addr_base,
+                                 TYPE_SIZE_UNIT (TREE_TYPE (op0)));
       addr_base = fold_build2_loc (loc, POINTER_PLUS_EXPR,
                                   TREE_TYPE (DR_BASE_ADDRESS (dr)),
                                   DR_BASE_ADDRESS (dr), addr_base);
@@ -389,6 +385,8 @@ generate_builtin (struct loop *loop, bitmap partition, bool copy_p)
                goto end;
 
              write = stmt;
+             if (bb == loop->latch)
+               nb_iter = number_of_latch_executions (loop);
            }
        }
     }
@@ -1238,6 +1236,6 @@ struct gimple_opt_pass pass_loop_distribution =
   0,                           /* properties_provided */
   0,                           /* properties_destroyed */
   0,                           /* todo_flags_start */
-  TODO_dump_func | TODO_verify_loops            /* todo_flags_finish */
+  TODO_dump_func                /* todo_flags_finish */
  }
 };