This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/57343] [4.8/4.9 Regression] wrong code on x86_64-linux at -Os and above
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 21 May 2013 12:19:08 +0000
- Subject: [Bug tree-optimization/57343] [4.8/4.9 Regression] wrong code on x86_64-linux at -Os and above
- Auto-submitted: auto-generated
- References: <bug-57343-4 at http dot gcc dot gnu dot org/bugzilla/>
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.