This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/57343] [4.8/4.9 Regression] wrong code on x86_64-linux at -Os and above


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]