On Thu, Mar 15, 2012 at 5:09 PM, Bernd Schmidt <ber...@codesourcery.com> wrote: > On 03/16/2012 12:44 AM, Jakub Jelinek wrote: >> For pointer arithmetics in the IL we assume the C >> requirements, pointer arithmetics can be performed only within the same >> object, so for >> int a[10]; >> both of the following are invalid, even in the IL: >> int *p = a - 1; >> int *q = a + 11; > > Ok, so what's the solution? Add a second POINTER_PLUS_EXPR code with > defined overflow behaviour, or add a flag to it?
We should have one for PLUS_EXPR also. There was some movement on that on a branch that Richard Guenther did but I don't know if he is going to work on it further. I have been noticing more and more the need for this feature while working on my tree combiner branch, that I might try to see if Richard's branch can be revisited. Thanks, Andrew Pinski