Serious performance regression -- some tree optimizer questions

Ken Raeburn raeburn@raeburn.org
Thu Dec 30 00:05:00 GMT 2004


On Dec 29, 2004, at 18:07, Zdenek Dvorak wrote:
> we should be able to determine that &A[i+1] - &A[i] == sizeof (A[0]) on
> architectures where sizeof (int) == sizeof (void *).  On other
> architectures this indeed might be incorrect in general.

Shouldn't that be, when sizeof(i+1) == sizeof(void *) ?
I think the issue is whether "i+1" will wrap and then be widened.
It should be safe on LP64 if i is type "long" or if you use "i+1L", I 
think, because either forces both addends to be widened to 64 bits 
before addition.

Ken



More information about the Gcc mailing list