On Wed, Apr 2, 2014 at 9:04 AM, Thomas Preud'homme <thomas.preudho...@arm.com> wrote: >> From: Marc Glisse [mailto:marc.gli...@inria.fr] >> >> Uh? It does fold a+1-a for me. What it doesn't do is look through the >> definition of b in b-a. Richard+GSoC will supposedly soon provide a >> function that does that. > > Oh right, it's a bit more complex here since the array index is converted > to an offset first. So the operation is more like: ((a+1)*cst) - (a*cst). > Any chances this might be handled at some point? Note that this might > not be very frequent so it's not very important for this patch.
"More like" isn't enough to answer this - do you have a testcase? (usually these end up in undefined-overflow and/or conversion-to-sizetype issues) Richard. > Thanks for the comment. > > Best regards, > > Thomas > >