------- Comment #8 from amonakov at gcc dot gnu dot org 2010-03-09 16:55 ------- Given the fact that loop distribution only works for two-bb loops, I think the fix is to simply take number of latch executions when the stmt is in the latch.
diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c --- a/gcc/tree-loop-distribution.c +++ b/gcc/tree-loop-distribution.c @@ -389,6 +391,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); } } } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43236