https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80265

--- Comment #28 from Pedro Alves <palves at redhat dot com> ---
> Looking at the code, it does sound like you instead would want to 
> tweak __equal_aux to end up with __simple==false when all __equal_aux's
> arguments are constant.

I suspect that wouldn't work, because we'd need to check whether the elements
the iterator range point-to are themselves constant.

So back to the constexpr __builtin_memcmp, or __constexpr_memcmp ideas.

Though I still don't see how __constexpr_memcmp would make a difference wrt to
number of __equal::equal implementations, but now I'm thinking that that's not
what you meant.  From my view, __constexpr_memcmp implemented in a helper
constexpr function or directly in the frontend (as __builtin_memcmp), is just
an implementation detail of the function.  Ultimately, __constexpr_memcmp or
constexpr __builtin_memcmp ends up interpreted in a similar way internally, I
expect.

Reply via email to