X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Ftree-loop-distribution.c;h=746e4421a967c456ef85c5924428618bf871d9a5;hb=d18f7e25250d286de9cbdf007529f9d5f7b78908;hp=13ac7ea584a46424910261e51df25e3baf610b22;hpb=eeb74f9f363aad87d2db46e1d0657e9b45bba8c2;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c index 13ac7ea584a..746e4421a96 100644 --- a/gcc/tree-loop-distribution.c +++ b/gcc/tree-loop-distribution.c @@ -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 and Sebastian Pop . @@ -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" @@ -118,8 +115,8 @@ update_phis_for_loop_copy (struct loop *orig_loop, struct loop *new_loop) if (!new_ssa_name) /* This only happens if there are no definitions inside the - loop. Use the phi_result in this case. */ - new_ssa_name = PHI_RESULT (phi_new); + loop. Use the the invariant in the new loop as is. */ + new_ssa_name = def; } else /* Could be an integer. */ @@ -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 */ } };