On Thu, Apr 18, 2019 at 02:47:18PM +0200, Jakub Jelinek wrote:
> 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).
That said, in RTL we really don't differentiate between pointers and
integers and we'll need to do something about that one day.
Jakub