US-CERT Vulnerability Note VU#162289

Paolo Bonzini bonzini@gnu.org
Mon Apr 14 05:19:00 GMT 2008


> (as an aside, as most target implementations treat pointers as unsigned
> values, its not clear that presuming signed integer overflow semantics are
> a reasonable choice for pointer comparison optimization)

The point is not of presuming signed integer overflow semantics (I was 
corrected on this by Ian Taylor).  It is of presuming that pointers 
never move before the beginning of their object.  If you have an array 
of 20 elements, pointers &a[0] to &a[20] are valid (accessing &a[20] is 
not valid), but the compiler can assume that the program does not refer 
to &a[-2].

Paolo



More information about the Gcc mailing list