[PATCH] libstdc++: remove the gnu++11 in check performance script
Yuao Ma
addr2line@gmail.com
Thu Aug 20 13:37:40 GMT 2026
Hi!
Based on previous discussions, we could remove the gnu++11 flag in the
check performance script. And the rebind logic removed in c++20 is
also adjusted.
Tested with make check-performance, ok for trunk?
Thanks,
Yuao
-------------- next part --------------
From 2f90cf6b275b2af22bdf5a9b1d1e6abcfd34ed40 Mon Sep 17 00:00:00 2001
From: Yuao Ma <c8ef@outlook.com>
Date: Thu, 20 Aug 2026 21:32:57 +0800
Subject: [PATCH] libstdc++: remove the gnu++11 in check performance script
Nowadays gcc's default c++ version is gnu++20, maybe we should just use
this in performance check as well.
libstdc++-v3/ChangeLog:
* scripts/check_performance: Remove gnu++11 flag.
* testsuite/util/native_type/native_hash_map.hpp: Adjust rebind
usage.
* testsuite/util/native_type/native_hash_multimap.hpp: Ditto.
* testsuite/util/native_type/native_hash_set.hpp: Ditto.
* testsuite/util/native_type/native_map.hpp: Ditto.
* testsuite/util/native_type/native_multimap.hpp: Ditto.
* testsuite/util/native_type/native_set.hpp: Ditto.
---
libstdc++-v3/scripts/check_performance | 2 +-
.../testsuite/util/native_type/native_hash_map.hpp | 2 +-
.../testsuite/util/native_type/native_hash_multimap.hpp | 4 +---
.../testsuite/util/native_type/native_hash_set.hpp | 2 +-
libstdc++-v3/testsuite/util/native_type/native_map.hpp | 4 ++--
.../testsuite/util/native_type/native_multimap.hpp | 7 ++-----
libstdc++-v3/testsuite/util/native_type/native_set.hpp | 2 +-
7 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/libstdc++-v3/scripts/check_performance b/libstdc++-v3/scripts/check_performance
index 4831ed71b6f..eb6adbc5ec6 100755
--- a/libstdc++-v3/scripts/check_performance
+++ b/libstdc++-v3/scripts/check_performance
@@ -32,7 +32,7 @@ SH_FLAG="-Wl,--rpath -Wl,$BUILD_DIR/../../gcc \
-Wl,--rpath -Wl,$BUILD_DIR/src/.libs"
ST_FLAG="-static"
LINK=$SH_FLAG
-CXX="$COMPILER $INCLUDES $FLAGS -std=gnu++11 $CXXFLAGS $LINK"
+CXX="$COMPILER $INCLUDES $FLAGS $CXXFLAGS $LINK"
LIBS="./libtestc++.a"
TESTS_FILE="testsuite_files_performance"
diff --git a/libstdc++-v3/testsuite/util/native_type/native_hash_map.hpp b/libstdc++-v3/testsuite/util/native_type/native_hash_map.hpp
index 1eb9851c886..d5f37e79716 100644
--- a/libstdc++-v3/testsuite/util/native_type/native_hash_map.hpp
+++ b/libstdc++-v3/testsuite/util/native_type/native_hash_map.hpp
@@ -50,7 +50,7 @@ namespace __gnu_pbds
{
#define PB_DS_BASE_C_DEC \
std::tr1::__unordered_map<Key, Data, Hash_Fn, Eq_Fn, \
- typename _Alloc::template rebind<std::pair<const Key, Data> >::other, Cache_Hash>
+ typename std::allocator_traits<_Alloc>::template rebind_alloc<std::pair<const Key, Data>>, Cache_Hash>
template<typename Key,
typename Data,
diff --git a/libstdc++-v3/testsuite/util/native_type/native_hash_multimap.hpp b/libstdc++-v3/testsuite/util/native_type/native_hash_multimap.hpp
index 35f16de8a1c..f6808aab9d1 100644
--- a/libstdc++-v3/testsuite/util/native_type/native_hash_multimap.hpp
+++ b/libstdc++-v3/testsuite/util/native_type/native_hash_multimap.hpp
@@ -70,9 +70,7 @@ namespace __gnu_pbds
typedef typename base_type::iterator iterator;
typedef typename base_type::const_iterator const_iterator;
- typedef
- typename allocator::template rebind<pair_type>::other::const_reference
- const_reference;
+ typedef const pair_type& const_reference;
native_hash_multimap() : base_type(Init_Size)
{ }
diff --git a/libstdc++-v3/testsuite/util/native_type/native_hash_set.hpp b/libstdc++-v3/testsuite/util/native_type/native_hash_set.hpp
index 75ebed43110..864520a78d6 100644
--- a/libstdc++-v3/testsuite/util/native_type/native_hash_set.hpp
+++ b/libstdc++-v3/testsuite/util/native_type/native_hash_set.hpp
@@ -50,7 +50,7 @@ namespace __gnu_pbds
{
#define PB_DS_BASE_C_DEC \
std::tr1::__unordered_set<Key, Hash_Fn, Eq_Fn, \
- typename _Alloc::template rebind<Key>::other, Cache_Hash>
+ typename std::allocator_traits<_Alloc>::template rebind_alloc<Key>, Cache_Hash>
template<typename Key,
size_t Init_Size = 8,
diff --git a/libstdc++-v3/testsuite/util/native_type/native_map.hpp b/libstdc++-v3/testsuite/util/native_type/native_map.hpp
index 958553951b4..72f5cf1712f 100644
--- a/libstdc++-v3/testsuite/util/native_type/native_map.hpp
+++ b/libstdc++-v3/testsuite/util/native_type/native_map.hpp
@@ -49,8 +49,8 @@ namespace __gnu_pbds
namespace test
{
#define PB_DS_BASE_C_DEC \
- std::map<Key, Data, Cmp_Fn, \
-typename _Alloc::template rebind<std::pair<const Key, Data > >::other >
+ std::map<Key, Data, Cmp_Fn, \
+ typename std::allocator_traits<_Alloc>::template rebind_alloc<std::pair<const Key, Data>>>
template<typename Key, typename Data, class Cmp_Fn = std::less<Key>,
typename _Alloc = std::allocator<char> >
diff --git a/libstdc++-v3/testsuite/util/native_type/native_multimap.hpp b/libstdc++-v3/testsuite/util/native_type/native_multimap.hpp
index 3646de930b4..a4e6e5ff2a9 100644
--- a/libstdc++-v3/testsuite/util/native_type/native_multimap.hpp
+++ b/libstdc++-v3/testsuite/util/native_type/native_multimap.hpp
@@ -48,7 +48,7 @@ namespace __gnu_pbds
{
#define PB_DS_BASE_C_DEC \
std::multimap<Key, Data, Less_Fn, \
- typename _Alloc::template rebind<std::pair<const Key, Data> >::other>
+ typename std::allocator_traits<_Alloc>::template rebind_alloc<std::pair<const Key, Data>>>
template<typename Key, typename Data, class Less_Fn = std::less<Key>,
typename _Alloc = std::allocator<char> >
@@ -62,10 +62,7 @@ namespace __gnu_pbds
typedef _Alloc allocator;
- typedef
- typename _Alloc::template rebind<
- std::pair<Key, Data> >::other::const_reference
- const_reference;
+ typedef const std::pair<Key, Data>& const_reference;
typedef typename base_type::iterator iterator;
typedef typename base_type::const_iterator const_iterator;
diff --git a/libstdc++-v3/testsuite/util/native_type/native_set.hpp b/libstdc++-v3/testsuite/util/native_type/native_set.hpp
index d382a371226..c3e88ec84e8 100644
--- a/libstdc++-v3/testsuite/util/native_type/native_set.hpp
+++ b/libstdc++-v3/testsuite/util/native_type/native_set.hpp
@@ -48,7 +48,7 @@ namespace __gnu_pbds
namespace test
{
#define PB_DS_BASE_C_DEC \
- std::set<Key, Cmp_Fn, typename _Alloc::template rebind<Key>::other>
+ std::set<Key, Cmp_Fn, typename std::allocator_traits<_Alloc>::template rebind_alloc<Key>>
template<typename Key, class Cmp_Fn = std::less<Key>,
typename _Alloc = std::allocator<char> >
--
2.54.0
More information about the Libstdc++
mailing list