This is the mail archive of the
mailing list for the libstdc++ project.
Re: [PATCH] Use __builtin_is_constant_evaluated in std::less etc. (PR tree-optimization/88775)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: Jonathan Wakely <jwakely dot gcc at gmail dot com>, libstdc++ <libstdc++ at gcc dot gnu dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Marc Glisse <marc dot glisse at inria dot fr>
- Date: Mon, 14 Jan 2019 09:42:37 +0100
- Subject: Re: [PATCH] Use __builtin_is_constant_evaluated in std::less etc. (PR tree-optimization/88775)
- References: <20190110090219.GT30353@tucnak> <CAFiYyc0ZLu=X9YAKQhTAZ8Da5UX0wHo8-HeNPp6DU7xvBdWymQ@mail.gmail.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Jan 14, 2019 at 09:29:03AM +0100, Richard Biener wrote:
> So why is this not just
> return (__UINTPTR_TYPE__)__x > (__UINTPTR_TYPE__)__y;
> or with the casts elided? Does the C++ standard say pointers are
> to be compared unsigned here? Or do all targets GCC support
> lay out the address space in a way that this is correct for pointers
> into distinct objects?
See PR78420 for details on why it is done that way.