On Thu, Apr 18, 2019 at 02:42:22PM +0200, Richard Biener wrote: > > 1.) Compilers do not use conditional equivalences for > > optimizations of pointers (or only when additional > > conditions apply which make it safe) > > > > 2.) We make pointer comparison between a pointer > > and a one-after pointer of a different object > > undefined behaviour. > > Yes please! OTOH GCC transforms > (uintptr_t)&a != (uintptr_t)(&b+1) > into &a != &b + 1 (for equality compares) and then
I think we don't. It was http://gcc.gnu.org/PR88775, but we haven't applied those changes, because we don't consider the point to start of one object vs. pointer to end of another one case in pointer comparisons (but do consider it in integral comparisons). Jakub