]> gcc.gnu.org Git - gcc.git/commit
libstdc++: Extend std::equal memcmp optimization to std::byte [PR101485]
authorJonathan Wakely <jwakely@redhat.com>
Fri, 28 Jun 2024 10:14:39 +0000 (11:14 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 28 Jun 2024 19:19:02 +0000 (20:19 +0100)
commitfab60eaa94b50b1eea84f0d001004c851d4c781b
tree7e8fba2796710d61bd56901d3cda9efa6f5cd693
parent03d3aeb0e0fa7dec9bd702cabf57ef73cdc32704
libstdc++: Extend std::equal memcmp optimization to std::byte [PR101485]

We optimize std::equal to memcmp for integers and pointers, which means
that std::byte comparisons generate bigger code than char comparisons.

We can't use memcmp for arbitrary enum types, because they could have an
overloaded operator== that has custom semantics, but we know that
std::byte doesn't do that.

libstdc++-v3/ChangeLog:

PR libstdc++/101485
* include/bits/stl_algobase.h (__equal_aux1): Check for
std::byte as well.
* testsuite/25_algorithms/equal/101485.cc: New test.
libstdc++-v3/include/bits/stl_algobase.h
libstdc++-v3/testsuite/25_algorithms/equal/101485.cc [new file with mode: 0644]
This page took 0.06339 seconds and 6 git commands to generate.