This is the mail archive of the gcc@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: Serious performance regression -- some tree optimizer questions


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


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