This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR26898, 2nd try
On Fri, 31 Mar 2006, Joseph S. Myers wrote:
> On Fri, 31 Mar 2006, Richard Guenther wrote:
>
> > On 3/31/06, Joseph S. Myers <joseph@codesourcery.com> wrote:
> > > I take it that at this point in folding it is guaranteed that the
> > > constants are non-negative, i.e. you don't have to deal with "X + -1" or
> > > "X - -1"?
> >
> > Hmm I thought they were canonicalized - but now I verified they are not.
> > *sigh* Are there any problems with treating X - -1 as X + 1?
>
> No, though you can't fold X + INT_MIN or X - INT_MIN that way. (But
> the optimization is still valid as applied to X + INT_MIN CMP Y - INT_MAX
> converted to X - 1 CMP Y.)
Based on the reasoning that abs(-1) <= abs(INT_MIN), correct?
Richard.