[Bug c/67999] Wrong optimization of pointer comparisons
bugdal at aerifal dot cx
gcc-bugzilla@gcc.gnu.org
Wed Oct 28 00:20:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67999
--- Comment #23 from Rich Felker <bugdal at aerifal dot cx> ---
I think you can always do the right-shift first. Pointer subtraction is
undefined unless both pointers point to elements of the same array, and the
addresses of elements of an array will inherently be congruent modulo the size
of an element.
More information about the Gcc-bugs
mailing list