1 --- gcc-4_1-branch/gcc/tree-ssa-loop-niter.c (wersja 113819)
2 +++ gcc-4_1-branch/gcc/tree-ssa-loop-niter.c (wersja 113820)
3 @@ -1562,15 +1562,20 @@
5 utype = unsigned_type_for (type);
6 if (tree_int_cst_lt (step, integer_zero_node))
7 - diff = fold_build2 (MINUS_EXPR, utype, init,
8 + diff = fold_build2 (MINUS_EXPR, type, init,
9 TYPE_MIN_VALUE (type));
11 - diff = fold_build2 (MINUS_EXPR, utype,
12 + diff = fold_build2 (MINUS_EXPR, type,
13 TYPE_MAX_VALUE (type), init);
15 - estimation = fold_build2 (CEIL_DIV_EXPR, utype, diff,
17 - record_estimate (loop, estimation, boolean_true_node, stmt);
18 + if (integer_nonzerop (step))
20 + estimation = fold_build2 (CEIL_DIV_EXPR, type, diff,
22 + record_estimate (loop,
23 + fold_convert (utype, estimation),
24 + boolean_true_node, stmt);