http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57343
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Richard Biener from comment #4) > Index: gcc/tree-ssa-loop-niter.c > =================================================================== > --- gcc/tree-ssa-loop-niter.c (revision 199137) > +++ gcc/tree-ssa-loop-niter.c (working copy) > @@ -627,7 +627,7 @@ number_of_iterations_ne (tree type, affi > not overflow, BNDS bounds the value of C. Also, this is the > case if the computation |FINAL - IV->base| does not overflow, i.e., > if BNDS->below in the result is nonnegative. */ > - if (tree_int_cst_sign_bit (iv->step)) > + if (tree_int_cst_sgn (iv->step) == -1) > { > s = fold_convert (niter_type, > fold_build1 (NEGATE_EXPR, type, iv->step)); > > fixes the testcase (otherwise untested). Doesn't work and fails bootstrap.