------- Comment #22 from rguenther at suse dot de 2006-05-17 15:06 -------
Subject: Re: [4.1/4.2 regression] VRP miscompilation
of simple loop
On Wed, 17 May 2006, rakdver at gcc dot gnu dot org wrote:
> ------- Comment #8 from rakdver at gcc dot gnu dot org 2006-05-17 13:11
> -------
> > It's
> >
> > (set_scalar_evolution
> > (scalar = D.1993_10)
> > (scalar_evolution = {79, +, -1}_1))
> > )
>
>
> Then it is a bug in chrec_convert (might also be related to PR 27619).
Index: tree-chrec.c
===================================================================
*** tree-chrec.c (revision 113852)
--- tree-chrec.c (working copy)
*************** chrec_convert (tree type, tree chrec, tr
*** 1150,1156 ****
1, 2, ..., 127, -128, ... The result should not be
{(schar)1, +, (schar)1}_x, but instead, we should keep the
conversion: (schar) {(uchar)1, +, (uchar)1}_x. */
! if (scev_probably_wraps_p (type, base, step, at_stmt, loop,
&dummy, &dummy))
goto failed_to_convert;
--- 1150,1156 ----
1, 2, ..., 127, -128, ... The result should not be
{(schar)1, +, (schar)1}_x, but instead, we should keep the
conversion: (schar) {(uchar)1, +, (uchar)1}_x. */
! if (scev_probably_wraps_p (ct, base, step, at_stmt, loop,
&dummy, &dummy))
goto failed_to_convert;
fixes it. Looks even obvious to me.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27639