This is the mail archive of the gcc-patches@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]

Re: [PATCH] Fix PR26898, 2nd try


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.)

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)


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