[gcc r14-11215] libstdc++: Fix reversed args in unreachable assumption [PR109849]

2025-01-16 Thread Jonathan Wakely via Libstdc++-cvs
https://gcc.gnu.org/g:7df6af205f5c9853c4d70b5b8172b0483179c891 commit r14-11215-g7df6af205f5c9853c4d70b5b8172b0483179c891 Author: Jonathan Wakely Date: Wed Jan 15 09:33:55 2025 + libstdc++: Fix reversed args in unreachable assumption [PR109849] libstdc++-v3/ChangeLog

[gcc r14-11214] libstdc++: Fix more pedwarns in headers for C++98

2025-01-16 Thread Jonathan Wakely via Libstdc++-cvs
https://gcc.gnu.org/g:9ea74d9ba8c80d4b78094bec291af47a0f10067d commit r14-11214-g9ea74d9ba8c80d4b78094bec291af47a0f10067d Author: Jonathan Wakely Date: Fri Sep 27 21:01:46 2024 +0100 libstdc++: Fix more pedwarns in headers for C++98 Some tests e.g. 17_intro/headers/c++1998

[gcc r14-11213] libstdc++: Fix std::deque::emplace calling wrong _M_insert_aux [PR90389]

2025-01-16 Thread Jonathan Wakely via Gcc-cvs
https://gcc.gnu.org/g:a5ce37b32d6a32e774ba4e156fe0d6d3f4e616fe commit r14-11213-ga5ce37b32d6a32e774ba4e156fe0d6d3f4e616fe Author: Jonathan Wakely Date: Tue Dec 17 17:38:43 2024 + libstdc++: Fix std::deque::emplace calling wrong _M_insert_aux [PR90389] We have several

[committed v2] libstdc++: Move std::basic_ostream to new internal header [PR99995]

2025-01-16 Thread Jonathan Wakely
This adds so that other headers don't need to include all of , which pulls in all of since C++23 (for the std::print and std::println overloads in ). This new header allows the constrained operator<< in to be defined without all of std::format being compiled. We could also replace with in all

[PATCH] libstdc++: Handle exceptions in std::ostream::sentry destructor

2025-01-16 Thread Jonathan Wakely
Because basic_ostream::sentry::~sentry is implicitly noexcept, we can't let any exceptions escape from it, or the program would terminate. If the streambuf's sync() function throws, or if it returns an error and setting badbit in the stream state throws, then the program would terminate. LWG 835 i

[PATCH] libstdc++: Handle exceptions in std::ostream::sentry destructor

2025-01-16 Thread Jonathan Wakely
Because basic_ostream::sentry::~sentry is implicitly noexcept, we can't let any exceptions escape from it, or the program would terminate. If the streambuf's sync() function throws, or if it returns an error and setting badbit in the stream state throws, then the program would terminate. LWG 835 i

[wwwdocs, pushed] Document dependency changes for libstdc++ header

2025-01-16 Thread Jonathan Wakely
Pushed to wwwdocs. --- htdocs/gcc-15/porting_to.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/gcc-15/porting_to.html b/htdocs/gcc-15/porting_to.html index 2bc0d4e5..b9b2efc7 100644 --- a/htdocs/gcc-15/porting_to.html +++ b/htdocs/gcc-15/porting_to.html @@ -153,6 +153,9 @@ may

[wwwdocs, pushed] Document libstdc++ headers that are deprecated in GCC 15

2025-01-16 Thread Jonathan Wakely
Pushed to wwwdocs. --- htdocs/gcc-15/porting_to.html | 11 +++ 1 file changed, 11 insertions(+) diff --git a/htdocs/gcc-15/porting_to.html b/htdocs/gcc-15/porting_to.html index c446e309..2bc0d4e5 100644 --- a/htdocs/gcc-15/porting_to.html +++ b/htdocs/gcc-15/porting_to.html @@ -155,6 +15

[wwwdocs, pushed] Document dependency changes for libstdc++ header

2025-01-16 Thread Jonathan Wakely
Pushed to wwwdocs. --- htdocs/gcc-15/porting_to.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/gcc-15/porting_to.html b/htdocs/gcc-15/porting_to.html index 2bc0d4e5..b9b2efc7 100644 --- a/htdocs/gcc-15/porting_to.html +++ b/htdocs/gcc-15/porting_to.html @@ -153,6 +153,9 @@ may

[wwwdocs, pushed] Document libstdc++ headers that are deprecated in GCC 15

2025-01-16 Thread Jonathan Wakely
Pushed to wwwdocs. --- htdocs/gcc-15/porting_to.html | 11 +++ 1 file changed, 11 insertions(+) diff --git a/htdocs/gcc-15/porting_to.html b/htdocs/gcc-15/porting_to.html index c446e309..2bc0d4e5 100644 --- a/htdocs/gcc-15/porting_to.html +++ b/htdocs/gcc-15/porting_to.html @@ -155,6 +15

[committed v2] libstdc++: Move std::basic_ostream to new internal header [PR99995]

2025-01-16 Thread Jonathan Wakely
This adds so that other headers don't need to include all of , which pulls in all of since C++23 (for the std::print and std::println overloads in ). This new header allows the constrained operator<< in to be defined without all of std::format being compiled. We could also replace with in all

gcc-wwwdocs branch master updated. e70082a2a05cfc1d1c2944a066e89de59374d46c

2025-01-16 Thread Jonathan Wakely via Gcc-cvs-wwwdocs
ow. - Log - commit e70082a2a05cfc1d1c2944a066e89de59374d46c Author: Jonathan Wakely Date: Thu Jan 16 10:47:53 2025 + Document dependency changes for libstdc++ header diff --git a/htdocs/gcc-15/porting_to.html b/htdocs/gcc-15/porting_to.html index 2bc0d4e5..b9b2e

[gcc r15-6952] libstdc++: Move std::basic_ostream to new internal header [PR99995]

2025-01-16 Thread Jonathan Wakely via Libstdc++-cvs
https://gcc.gnu.org/g:462a7f45caf78466ee6d9a1256a1e2848e4ec49c commit r15-6952-g462a7f45caf78466ee6d9a1256a1e2848e4ec49c Author: Jonathan Wakely Date: Wed Dec 11 17:32:39 2024 + libstdc++: Move std::basic_ostream to new internal header [PR5] This adds so that other

Re: [committed] libstdc++: Implement LWG 2937 for std::filesystem::equivalent [PR118158]

2025-01-16 Thread Jonathan Wakely
On Thu, 16 Jan 2025 at 09:50, Jonathan Wakely wrote: > > Do not report an error for (is_other(s1) && is_other(s2)) as the > standard originally said, nor for (is_other(s1) || is_other(s2)) as > libstdc++ was doing. We can compare inode numbers for special files and > s

Re: [committed] libstdc++: Implement LWG 2937 for std::filesystem::equivalent [PR118158]

2025-01-16 Thread Jonathan Wakely
On Thu, 16 Jan 2025 at 09:50, Jonathan Wakely wrote: > > Do not report an error for (is_other(s1) && is_other(s2)) as the > standard originally said, nor for (is_other(s1) || is_other(s2)) as > libstdc++ was doing. We can compare inode numbers for special files and > s

[committed] libstdc++: Implement LWG 2937 for std::filesystem::equivalent [PR118158]

2025-01-16 Thread Jonathan Wakely
Do not report an error for (is_other(s1) && is_other(s2)) as the standard originally said, nor for (is_other(s1) || is_other(s2)) as libstdc++ was doing. We can compare inode numbers for special files and so give sensible answers. libstdc++-v3/ChangeLog: PR libstdc++/118158 * src/

[committed] libstdc++: Check feature test macro for associative container node extraction

2025-01-16 Thread Jonathan Wakely
Replace some `__cplusplus > 201402L` preprocessor checks with more expressive checks for the appropriate feature test macro. libstdc++-v3/ChangeLog: * include/bits/stl_map.h: Check __glibcxx_node_extract instead of __cplusplus. * include/bits/stl_multimap.h: Likewise.

[committed] libstdc++: Implement LWG 2937 for std::filesystem::equivalent [PR118158]

2025-01-16 Thread Jonathan Wakely
Do not report an error for (is_other(s1) && is_other(s2)) as the standard originally said, nor for (is_other(s1) || is_other(s2)) as libstdc++ was doing. We can compare inode numbers for special files and so give sensible answers. libstdc++-v3/ChangeLog: PR libstdc++/118158 * src/

[gcc r15-6951] libstdc++: Implement LWG 2937 for std::filesystem::equivalent [PR118158]

2025-01-16 Thread Jonathan Wakely via Gcc-cvs
https://gcc.gnu.org/g:301a961ffd0567eece55ece42e80a7ba9e855ba0 commit r15-6951-g301a961ffd0567eece55ece42e80a7ba9e855ba0 Author: Jonathan Wakely Date: Mon Dec 30 13:08:41 2024 + libstdc++: Implement LWG 2937 for std::filesystem::equivalent [PR118158] Do not report an error

[committed] libstdc++: Check feature test macro for associative container node extraction

2025-01-16 Thread Jonathan Wakely
Replace some `__cplusplus > 201402L` preprocessor checks with more expressive checks for the appropriate feature test macro. libstdc++-v3/ChangeLog: * include/bits/stl_map.h: Check __glibcxx_node_extract instead of __cplusplus. * include/bits/stl_multimap.h: Likewise.

[gcc r15-6950] libstdc++: Check feature test macro for associative container node extraction

2025-01-16 Thread Jonathan Wakely via Gcc-cvs
https://gcc.gnu.org/g:408f5b847b5b4e552274dc7b02ccaf106395936d commit r15-6950-g408f5b847b5b4e552274dc7b02ccaf106395936d Author: Jonathan Wakely Date: Fri Nov 1 10:50:02 2024 + libstdc++: Check feature test macro for associative container node extraction Replace some

[committed] libstdc++: Fix fancy pointer test for std::set

2025-01-15 Thread Jonathan Wakely
The alloc_ptr.cc test for std::set tries to use C++17 features unconditionally, and tries to use the C++23 range members which haven't been implemented for std::set yet. Some of the range checks are left in place but commented out, so they can be added after the ranges members are implemented. Oth

[committed] libstdc++: Fix use of internal feature test macro in test

2025-01-15 Thread Jonathan Wakely
This test should use __cpp_lib_ios_noreplace rather than the internal __glibcxx_ios_noreplace macro. libstdc++-v3/ChangeLog: * testsuite/27_io/ios_base/types/openmode/case_label.cc: Use standard feature test macro not internal one. --- Tested x86_64-linux. Pushed to trunk. .../

[committed] libstdc++: Fix use of internal feature test macro in test

2025-01-15 Thread Jonathan Wakely
This test should use __cpp_lib_ios_noreplace rather than the internal __glibcxx_ios_noreplace macro. libstdc++-v3/ChangeLog: * testsuite/27_io/ios_base/types/openmode/case_label.cc: Use standard feature test macro not internal one. --- Tested x86_64-linux. Pushed to trunk. .../

[committed] libstdc++: Fix fancy pointer test for std::set

2025-01-15 Thread Jonathan Wakely
The alloc_ptr.cc test for std::set tries to use C++17 features unconditionally, and tries to use the C++23 range members which haven't been implemented for std::set yet. Some of the range checks are left in place but commented out, so they can be added after the ranges members are implemented. Oth

[gcc r15-6931] libstdc++: Fix use of internal feature test macro in test

2025-01-15 Thread Jonathan Wakely via Libstdc++-cvs
https://gcc.gnu.org/g:79d5504002e1cde242e8284ca134b2573d43bd89 commit r15-6931-g79d5504002e1cde242e8284ca134b2573d43bd89 Author: Jonathan Wakely Date: Wed Jan 15 23:37:14 2025 + libstdc++: Fix use of internal feature test macro in test This test should use

[gcc r15-6930] libstdc++: Fix fancy pointer test for std::set

2025-01-15 Thread Jonathan Wakely via Libstdc++-cvs
https://gcc.gnu.org/g:f079feecab1dda0ea8c7fe632c41dbb3ee1892b8 commit r15-6930-gf079feecab1dda0ea8c7fe632c41dbb3ee1892b8 Author: Jonathan Wakely Date: Wed Jan 15 21:24:15 2025 + libstdc++: Fix fancy pointer test for std::set The alloc_ptr.cc test for std::set tries to use C

[committed] libstdc++: Fix reversed args in unreachable assumption [PR109849]

2025-01-15 Thread Jonathan Wakely
libstdc++-v3/ChangeLog: PR libstdc++/109849 * include/bits/vector.tcc (vector::_M_range_insert): Fix reversed args in length calculation. --- Tested x86_64-linux, pushed to trunk. Backport to gcc-14 to follow after testing. libstdc++-v3/include/bits/vector.tcc | 2 +- 1

[committed] libstdc++: Fix reversed args in unreachable assumption [PR109849]

2025-01-15 Thread Jonathan Wakely
libstdc++-v3/ChangeLog: PR libstdc++/109849 * include/bits/vector.tcc (vector::_M_range_insert): Fix reversed args in length calculation. --- Tested x86_64-linux, pushed to trunk. Backport to gcc-14 to follow after testing. libstdc++-v3/include/bits/vector.tcc | 2 +- 1

[gcc r15-6926] libstdc++: Fix reversed args in unreachable assumption [PR109849]

2025-01-15 Thread Jonathan Wakely via Gcc-cvs
https://gcc.gnu.org/g:6f85a97248fdff15aadc9514c1118eee0293d256 commit r15-6926-g6f85a97248fdff15aadc9514c1118eee0293d256 Author: Jonathan Wakely Date: Wed Jan 15 09:33:55 2025 + libstdc++: Fix reversed args in unreachable assumption [PR109849] libstdc++-v3/ChangeLog

Re: Defining __uint24

2025-01-15 Thread Jonathan Wakely via Gcc
On Wed, 15 Jan 2025 at 20:36, Georg-Johann Lay wrote: > > > > Am 15.01.25 um 20:41 schrieb Jonathan Wakely: > > On Wed, 15 Jan 2025 at 17:17, Georg-Johann Lay via Gcc > > wrote: > >> > >> What's the recommended way to built-in define types like _

Re: Defining __uint24

2025-01-15 Thread Jonathan Wakely via Gcc
On Wed, 15 Jan 2025 at 20:57, Jakub Jelinek wrote: > > On Wed, Jan 15, 2025 at 09:36:51PM +0100, Georg-Johann Lay via Gcc wrote: > > > This pedwarn is correct, so I'm not sure why it's a problem. If you > > > don't want warnings about non-standard extensions, don't use > > > -pedantic-errors. > >

Re: [wwwdocs] Document that gcc-8 changed the default to -std=gnu17

2025-01-15 Thread Jonathan Wakely
On Mon, 23 Dec 2024 at 01:56, Gerald Pfeifer wrote: > > On Wed, 9 Oct 2024, Jonathan Wakely wrote: > > How about this? > > > > +C > > + > > +New options -std=c17, to select support for the 2018 > > +edition of the ISO C standard, and -std=g

gcc-wwwdocs branch master updated. 9a77c1a1eb9c35f015e40f7ed2871f967f87e111

2025-01-15 Thread Jonathan Wakely via Gcc-cvs-wwwdocs
--- commit 9a77c1a1eb9c35f015e40f7ed2871f967f87e111 Author: Jonathan Wakely Date: Wed Oct 9 18:42:29 2024 +0100 Document that gcc-8 changed the default to -std=gnu17 diff --git a/htdocs/gcc-8/changes.html b/htdocs/gcc-8/changes.html index c329a509..12db068a 100644 --- a/htdocs/gcc-8/changes.html +++ b/htdocs/gcc-8/ch

Re: Defining __uint24

2025-01-15 Thread Jonathan Wakely via Gcc
On Wed, 15 Jan 2025 at 17:17, Georg-Johann Lay via Gcc wrote: > > What's the recommended way to built-in define types like __uint24 ? > > Since v4.8, the avr backend has: > > avr-modes.def: >FRACTIONAL_INT_MODE (PSI, 24, 3); > > avr.cc: >tree int24_type = make_signed_type (GET_MODE_BITSIZ

[committed] libstdc++: Fix comments in test that reference wrong subclause of C++11

2025-01-15 Thread Jonathan Wakely
libstdc++-v3/ChangeLog: * testsuite/28_regex/traits/char/transform_primary.cc: Fix subclause numbering in references to the standard. --- Pushed to trunk. .../testsuite/28_regex/traits/char/transform_primary.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) dif

[committed] libstdc++: Fix comments in test that reference wrong subclause of C++11

2025-01-15 Thread Jonathan Wakely
libstdc++-v3/ChangeLog: * testsuite/28_regex/traits/char/transform_primary.cc: Fix subclause numbering in references to the standard. --- Pushed to trunk. .../testsuite/28_regex/traits/char/transform_primary.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) dif

[gcc r15-6915] libstdc++: Fix comments in test that reference wrong subclause of C++11

2025-01-15 Thread Jonathan Wakely via Libstdc++-cvs
https://gcc.gnu.org/g:9cc31b4e07aab75fcbc81b3a9bcaaa21d2c3bdb2 commit r15-6915-g9cc31b4e07aab75fcbc81b3a9bcaaa21d2c3bdb2 Author: Jonathan Wakely Date: Wed Dec 18 17:48:59 2024 + libstdc++: Fix comments in test that reference wrong subclause of C++11 libstdc++-v3/ChangeLog

Re: [libstdc++] Optimize string constructors

2025-01-15 Thread Jonathan Wakely
On Fri, 13 Dec 2024 at 14:01, Jan Hubicka wrote: > > Hi, > this patch improves code generation on string constructors. We currently have > _M_construct which takes as a parameter two iterators (begin/end pointers to > other string) and produces new string. This patch adds special case of > const

Re: [libstdc++] Optimize string constructors

2025-01-15 Thread Jonathan Wakely
On Fri, 13 Dec 2024 at 14:01, Jan Hubicka wrote: > > Hi, > this patch improves code generation on string constructors. We currently have > _M_construct which takes as a parameter two iterators (begin/end pointers to > other string) and produces new string. This patch adds special case of > const

Re: [PATCH] libstdc++: Use string::push_back instead of string::operator+=

2025-01-15 Thread Jonathan Wakely
On Mon, 30 Dec 2024 at 02:37, Aditya K wrote: > > From db5036e40ed7ac43b66ca74c44ec8d0bdc934b07 Mon Sep 17 00:00:00 2001 > From: AdityaK <1108430...@users.noreply.github.com> > Date: Sun, 29 Dec 2024 18:14:29 -0800 > Subject: [PATCH] libstdc++: Use string::push_back instead of > string::operator+

Re: [PATCH] libstdc++: Use string::push_back instead of string::operator+=

2025-01-15 Thread Jonathan Wakely
On Mon, 30 Dec 2024 at 02:37, Aditya K wrote: > > From db5036e40ed7ac43b66ca74c44ec8d0bdc934b07 Mon Sep 17 00:00:00 2001 > From: AdityaK <1108430...@users.noreply.github.com> > Date: Sun, 29 Dec 2024 18:14:29 -0800 > Subject: [PATCH] libstdc++: Use string::push_back instead of > string::operator+

Re: Help for git send-email setting

2025-01-14 Thread Jonathan Wakely via Gcc
On Mon, 13 Jan 2025 at 12:17, Ben Boeckel via Gcc wrote: > > On Mon, Jan 13, 2025 at 01:27:17 +, Hao Liu via Gcc wrote: > > I'm new to GCC community, and try to contribute some patches. > > I am having trouble setting git send-email with Outlook on Linux. Does > > anyone have any successful ex

Re: [PATCH] testsuite: libstdc++: Use effective-target libatomic

2025-01-13 Thread Jonathan Wakely
On Mon, 13 Jan 2025 at 11:12, Thomas Schwinge wrote: > > Hi! > > On 2025-01-13T11:04:50+0000, Jonathan Wakely wrote: > > On Mon, 13 Jan 2025 at 11:03, Thomas Schwinge > > wrote: > >> On 2025-01-12T08:38:05+0100, Torbjorn SVENSSON > >> wrote: > &g

Re: [PATCH] testsuite: libstdc++: Use effective-target libatomic

2025-01-13 Thread Jonathan Wakely
On Mon, 13 Jan 2025 at 11:12, Thomas Schwinge wrote: > > Hi! > > On 2025-01-13T11:04:50+0000, Jonathan Wakely wrote: > > On Mon, 13 Jan 2025 at 11:03, Thomas Schwinge > > wrote: > >> On 2025-01-12T08:38:05+0100, Torbjorn SVENSSON > >> wrote: > &g

Re: [PATCH] testsuite: libstdc++: Use effective-target libatomic

2025-01-13 Thread Jonathan Wakely
On Mon, 13 Jan 2025 at 11:03, Thomas Schwinge wrote: > > Hi! > > On 2025-01-12T08:38:05+0100, Torbjorn SVENSSON > wrote: > > On 2025-01-12 01:05, Jonathan Wakely wrote: > >> On Mon, 23 Dec 2024, 19:05 Torbjörn SVENSSON, > >> mailto:torbjorn.svens...@fos

Re: [PATCH] testsuite: libstdc++: Use effective-target libatomic

2025-01-13 Thread Jonathan Wakely
On Mon, 13 Jan 2025 at 11:03, Thomas Schwinge wrote: > > Hi! > > On 2025-01-12T08:38:05+0100, Torbjorn SVENSSON > wrote: > > On 2025-01-12 01:05, Jonathan Wakely wrote: > >> On Mon, 23 Dec 2024, 19:05 Torbjörn SVENSSON, > >> mailto:torbjorn.svens...@fos

Re: [PATCH] testsuite: libstdc++: Use effective-target libatomic

2025-01-11 Thread Jonathan Wakely
On Mon, 23 Dec 2024, 19:05 Torbjörn SVENSSON, wrote: > Ok for trunk and releases/gcc-14? > OK > -- > > Test assumes libatomic.a is always available, but for some embedded > targets, there is no libatomic.a and the test thus fail. > > libstdc++/ChangeLog: > > * 29_atomics/atomic_float/

Re: [PATCH] testsuite: The expect framework might introduce CR in output

2025-01-11 Thread Jonathan Wakely
On Sat, 11 Jan 2025, 19:14 Torbjorn SVENSSON, wrote: > > > On 2025-01-11 20:05, Jonathan Wakely wrote: > > > > > > On Sat, 11 Jan 2025, 18:31 Torbjörn SVENSSON, > > mailto:torbjorn.svens...@foss.st.com>> > > wrote: > > > > Ok for trun

Re: [PATCH] testsuite: libstdc++: Use effective-target libatomic

2025-01-11 Thread Jonathan Wakely
On Mon, 23 Dec 2024, 19:05 Torbjörn SVENSSON, wrote: > Ok for trunk and releases/gcc-14? > OK > -- > > Test assumes libatomic.a is always available, but for some embedded > targets, there is no libatomic.a and the test thus fail. > > libstdc++/ChangeLog: > > * 29_atomics/atomic_float/

Re: [PATCH] testsuite: The expect framework might introduce CR in output

2025-01-11 Thread Jonathan Wakely
On Sat, 11 Jan 2025, 19:14 Torbjorn SVENSSON, wrote: > > > On 2025-01-11 20:05, Jonathan Wakely wrote: > > > > > > On Sat, 11 Jan 2025, 18:31 Torbjörn SVENSSON, > > mailto:torbjorn.svens...@foss.st.com>> > > wrote: > > > > Ok for trun

Re: [PATCH] testsuite: The expect framework might introduce CR in output

2025-01-11 Thread Jonathan Wakely
On Sat, 11 Jan 2025, 18:31 Torbjörn SVENSSON, wrote: > Ok for trunk and releases/gcc-14? > OK, thanks > -- > > When running tests using the "sim" config, the command is launched in > non-readonly mode and the text retrieved from the expect command will > then replace all LF with CRLF. (The pr

Re: [PATCH] testsuite: The expect framework might introduce CR in output

2025-01-11 Thread Jonathan Wakely
On Sat, 11 Jan 2025, 18:31 Torbjörn SVENSSON, wrote: > Ok for trunk and releases/gcc-14? > OK, thanks > -- > > When running tests using the "sim" config, the command is launched in > non-readonly mode and the text retrieved from the expect command will > then replace all LF with CRLF. (The pr

[PATCH 08/10] libstdc++: Rename __atomic_compare to __atomic_eq

2025-01-10 Thread Jonathan Wakely
This is an equality comparison rather than a three-way comparison like memcmp and <=>, so name it more precisely. libstdc++-v3/ChangeLog: * include/bits/atomic_timed_wait.h (__atomic_wait_address_until_v): Replace __atomic_compare with __atomic_eq. (__atomic_wait_a

[PATCH 05/10] libstdc++: Fix race condition in new atomic notify code

2025-01-10 Thread Jonathan Wakely
When using a proxy object for atomic waiting and notifying operations, we need to ensure that the _M_ver value is always incremented by a notifying operation, even if we return early without doing the futex wake syscall. Otherwise we get missed wake-ups because the notifying thread doesn't modify t

[PATCH 08/10] libstdc++: Rename __atomic_compare to __atomic_eq

2025-01-10 Thread Jonathan Wakely
This is an equality comparison rather than a three-way comparison like memcmp and <=>, so name it more precisely. libstdc++-v3/ChangeLog: * include/bits/atomic_timed_wait.h (__atomic_wait_address_until_v): Replace __atomic_compare with __atomic_eq. (__atomic_wait_a

[PATCH 09/10] libstdc++: Use safe integer comparisons in std::latch [PR98749]

2025-01-10 Thread Jonathan Wakely
Also add missing precondition check to constructor and fix existing check in count_down which was duplicated by mistake. libstdc++-v3/ChangeLog: PR libstdc++/98749 * include/std/latch (latch::max()): Use std::cmp_less to handle the case where __platform_wait_t is wider tha

[PATCH 07/10] libstdc++: Remove reinterpret_cast uses in atomic wait/notify

2025-01-10 Thread Jonathan Wakely
We can pass around void* instead of casting incompatible pointers to __platform_wait_t*, and then only static_cast to __platform_wait_t* when we know that's valid. libstdc++-v3/ChangeLog: * include/bits/atomic_timed_wait.h (__atomic_wait_address_until): Remove reinterpret_cast and

[PATCH 05/10] libstdc++: Fix race condition in new atomic notify code

2025-01-10 Thread Jonathan Wakely
When using a proxy object for atomic waiting and notifying operations, we need to ensure that the _M_ver value is always incremented by a notifying operation, even if we return early without doing the futex wake syscall. Otherwise we get missed wake-ups because the notifying thread doesn't modify t

[PATCH 10/10] libstdc++: Optimise std::latch::arrive_and_wait

2025-01-10 Thread Jonathan Wakely
We don't need to wait if we know the counter has reached zero. libstdc++-v3/ChangeLog: * include/std/latch (latch::arrive_and_wait): Optimise. --- This one's commented out for now, but sending for review anyway. libstdc++-v3/include/std/latch | 12 1 file changed, 12 inser

[PATCH 06/10] libstdc++: Simplify futex wrapper functions for atomic wait/notify

2025-01-10 Thread Jonathan Wakely
Making these non-templates will allow them to be moved into the library at some point. libstdc++-v3/ChangeLog: * include/bits/atomic_wait.h (__platform_wait): Change function template to a normal function. The parameter is always __platform_wait_t* which is just int* for t

[PATCH 04/10] libstdc++: Various fixes for atomic wait/notify code

2025-01-10 Thread Jonathan Wakely
Remove the unnecessary __wait_args_base base class, which seems to serve no purpose. Everywhere it's used we actually want __wait_args instead. The code using the __wait_flags bitmask type is broken, because the __spin_only constant includes the __do_spin element. This means that testing (__args &

[PATCH 06/10] libstdc++: Simplify futex wrapper functions for atomic wait/notify

2025-01-10 Thread Jonathan Wakely
Making these non-templates will allow them to be moved into the library at some point. libstdc++-v3/ChangeLog: * include/bits/atomic_wait.h (__platform_wait): Change function template to a normal function. The parameter is always __platform_wait_t* which is just int* for t

[PATCH 03/10] libstdc++: Whitespace fixes in atomic wait/notify code

2025-01-10 Thread Jonathan Wakely
libstdc++-v3/ChangeLog: * include/bits/atomic_timed_wait.h: Whitespace fixes. * include/bits/atomic_wait.h: Likewise. --- libstdc++-v3/include/bits/atomic_timed_wait.h | 198 +- libstdc++-v3/include/bits/atomic_wait.h | 8 +- 2 files changed, 100 insertions

[PATCH 10/10] libstdc++: Optimise std::latch::arrive_and_wait

2025-01-10 Thread Jonathan Wakely
We don't need to wait if we know the counter has reached zero. libstdc++-v3/ChangeLog: * include/std/latch (latch::arrive_and_wait): Optimise. --- This one's commented out for now, but sending for review anyway. libstdc++-v3/include/std/latch | 12 1 file changed, 12 inser

[PATCH 03/10] libstdc++: Whitespace fixes in atomic wait/notify code

2025-01-10 Thread Jonathan Wakely
libstdc++-v3/ChangeLog: * include/bits/atomic_timed_wait.h: Whitespace fixes. * include/bits/atomic_wait.h: Likewise. --- libstdc++-v3/include/bits/atomic_timed_wait.h | 198 +- libstdc++-v3/include/bits/atomic_wait.h | 8 +- 2 files changed, 100 insertions

[PATCH 09/10] libstdc++: Use safe integer comparisons in std::latch [PR98749]

2025-01-10 Thread Jonathan Wakely
Also add missing precondition check to constructor and fix existing check in count_down which was duplicated by mistake. libstdc++-v3/ChangeLog: PR libstdc++/98749 * include/std/latch (latch::max()): Use std::cmp_less to handle the case where __platform_wait_t is wider tha

[PATCH 07/10] libstdc++: Remove reinterpret_cast uses in atomic wait/notify

2025-01-10 Thread Jonathan Wakely
We can pass around void* instead of casting incompatible pointers to __platform_wait_t*, and then only static_cast to __platform_wait_t* when we know that's valid. libstdc++-v3/ChangeLog: * include/bits/atomic_timed_wait.h (__atomic_wait_address_until): Remove reinterpret_cast and

[PATCH 02/10] libstdc++: Pass __wait_args to internal API by const pointer

2025-01-10 Thread Jonathan Wakely
From: Thomas Rodgers This change splits the __wait_args data members to a new struct __wait_args_base and then passes that type by const pointer to the low level implementation functions. libstdc++-v3/ChangeLog: * include/bits/atomic_timed_wait.h (__spin_until_impl): Accept __wa

[PATCH 00/10] C++20 atomic wait/notify ABI stabilization

2025-01-10 Thread Jonathan Wakely
From: Jonathan Wakely This series complete Tom's work to refactor the C++20 atomic wait/notify code. The goal is to make the implementation ready for some pieces to be moved into libstdc++.so instead of defining everything inline in the headers. Also available for review at

[PATCH 02/10] libstdc++: Pass __wait_args to internal API by const pointer

2025-01-10 Thread Jonathan Wakely
From: Thomas Rodgers This change splits the __wait_args data members to a new struct __wait_args_base and then passes that type by const pointer to the low level implementation functions. libstdc++-v3/ChangeLog: * include/bits/atomic_timed_wait.h (__spin_until_impl): Accept __wa

[PATCH 01/10] libstdc++: Atomic wait/notify ABI stabilization

2025-01-10 Thread Jonathan Wakely
From: Thomas Rodgers This represents a major refactoring of the previous atomic::wait and atomic::notify implementation detail. The aim of this change is to simplify the implementation details and position the resulting implementation so that much of the current header-only detail can be moved in

[PATCH 04/10] libstdc++: Various fixes for atomic wait/notify code

2025-01-10 Thread Jonathan Wakely
Remove the unnecessary __wait_args_base base class, which seems to serve no purpose. Everywhere it's used we actually want __wait_args instead. The code using the __wait_flags bitmask type is broken, because the __spin_only constant includes the __do_spin element. This means that testing (__args &

[PATCH 01/10] libstdc++: Atomic wait/notify ABI stabilization

2025-01-10 Thread Jonathan Wakely
From: Thomas Rodgers This represents a major refactoring of the previous atomic::wait and atomic::notify implementation detail. The aim of this change is to simplify the implementation details and position the resulting implementation so that much of the current header-only detail can be moved in

[PATCH 00/10] C++20 atomic wait/notify ABI stabilization

2025-01-10 Thread Jonathan Wakely
From: Jonathan Wakely This series complete Tom's work to refactor the C++20 atomic wait/notify code. The goal is to make the implementation ready for some pieces to be moved into libstdc++.so instead of defining everything inline in the headers. Also available for review at

[committed] libstdc++: Fix unused parameter warnings in

2025-01-10 Thread Jonathan Wakely
This fixes warnings like the following during bootstrap: sparc-sun-solaris2.11/libstdc++-v3/include/bits/atomic_futex.h:324:53: warning: unused parameter ‘__mo’ [-Wunused-parameter] 324 | _M_load_when_equal(unsigned __val, memory_order __mo) |~~

[committed] libstdc++: Fix unused parameter warnings in

2025-01-10 Thread Jonathan Wakely
This fixes warnings like the following during bootstrap: sparc-sun-solaris2.11/libstdc++-v3/include/bits/atomic_futex.h:324:53: warning: unused parameter ‘__mo’ [-Wunused-parameter] 324 | _M_load_when_equal(unsigned __val, memory_order __mo) |~~

[gcc r15-6804] libstdc++: Fix unused parameter warnings in

2025-01-10 Thread Jonathan Wakely via Gcc-cvs
https://gcc.gnu.org/g:c9353e0fcd0ddc0d48ae8a2b0518f0f82670d708 commit r15-6804-gc9353e0fcd0ddc0d48ae8a2b0518f0f82670d708 Author: Jonathan Wakely Date: Fri Jan 10 10:32:22 2025 + libstdc++: Fix unused parameter warnings in This fixes warnings like the following during

[PATCH] libstdc++: Create new base class of std::barrier for non-dependent code

2025-01-10 Thread Jonathan Wakely
This moves all non-dependent state and logic for std::barrier into a new non-template base class, to avoid template bloat. This would permit moving the _M_arrive function into the library instead of the header. libstdc++-v3/ChangeLog: * include/std/barrier (__tree_barrier_base): New clas

[PATCH] libstdc++: Create new base class of std::barrier for non-dependent code

2025-01-10 Thread Jonathan Wakely
This moves all non-dependent state and logic for std::barrier into a new non-template base class, to avoid template bloat. This would permit moving the _M_arrive function into the library instead of the header. libstdc++-v3/ChangeLog: * include/std/barrier (__tree_barrier_base): New clas

Re: libstdc++: Optimize std::vector

2025-01-10 Thread Jonathan Wakely
On Sun, 8 Dec 2024 at 15:36, Jan Hubicka wrote: > > Hi, > std::vector has independent implementation for bool which has its won > size/capacity functions. I updated them to add __builtin_unreachable to > announce that size is never more than max_size. However while testing the > code > I notice

Re: libstdc++: Optimize std::vector

2025-01-10 Thread Jonathan Wakely
On Fri, 10 Jan 2025 at 14:51, Jonathan Wakely wrote: > > On Sun, 8 Dec 2024 at 15:36, Jan Hubicka wrote: > > > > Hi, > > std::vector has independent implementation for bool which has its won > > size/capacity functions. I updated them to add __builtin_unreachabl

Re: libstdc++: Optimize std::vector

2025-01-10 Thread Jonathan Wakely
On Fri, 10 Jan 2025 at 14:51, Jonathan Wakely wrote: > > On Sun, 8 Dec 2024 at 15:36, Jan Hubicka wrote: > > > > Hi, > > std::vector has independent implementation for bool which has its won > > size/capacity functions. I updated them to add __builtin_unreachabl

Re: libstdc++: Optimize std::vector

2025-01-10 Thread Jonathan Wakely
On Sun, 8 Dec 2024 at 15:36, Jan Hubicka wrote: > > Hi, > std::vector has independent implementation for bool which has its won > size/capacity functions. I updated them to add __builtin_unreachable to > announce that size is never more than max_size. However while testing the > code > I notice

Re: [libstdc++] Optimize std::vector::operator[]

2025-01-10 Thread Jonathan Wakely
On Fri, 27 Dec 2024 at 20:13, Jan Hubicka wrote: > > Hi, > the following testcase: > > bool f(const std::vector& v, std::size_t x) { > return v[x]; > } > > is compiled as: > > f(std::vector > const&, unsigned long): > testq %rsi, %rsi > leaq63(%rsi), %rax > mo

Re: [libstdc++] Optimize std::vector::operator[]

2025-01-10 Thread Jonathan Wakely
On Fri, 27 Dec 2024 at 20:13, Jan Hubicka wrote: > > Hi, > the following testcase: > > bool f(const std::vector& v, std::size_t x) { > return v[x]; > } > > is compiled as: > > f(std::vector > const&, unsigned long): > testq %rsi, %rsi > leaq63(%rsi), %rax > mo

Re: [PATCH][libstdc++]: backport inline keyword on std::find

2025-01-10 Thread Jonathan Wakely
On Fri, 10 Jan 2025 at 14:32, Tamar Christina wrote: > > Hi All, > > This is a backport version of the same patch as > https://gcc.gnu.org/pipermail/gcc-patches/2024-December/671618.html > > for the release branches. I'd like to backport this to GCC 14,13 and 12 where > the first regression showe

Re: [PATCH][libstdc++]: backport inline keyword on std::find

2025-01-10 Thread Jonathan Wakely
On Fri, 10 Jan 2025 at 14:32, Tamar Christina wrote: > > Hi All, > > This is a backport version of the same patch as > https://gcc.gnu.org/pipermail/gcc-patches/2024-December/671618.html > > for the release branches. I'd like to backport this to GCC 14,13 and 12 where > the first regression showe

[PATCH] libstdc++: Fix std::barrier for constant initialization [PR118395]

2025-01-10 Thread Jonathan Wakely
The std::barrier constructor should be constexpr, which means we need to defer the dynamic allocation if the constructor is called during constant-initialization. We can defer it to the first call to barrier::arrive, using compare-and-swap on an atomic (instead of the unique_ptr currently used). A

[PATCH] libstdc++: Fix std::barrier for constant initialization [PR118395]

2025-01-10 Thread Jonathan Wakely
The std::barrier constructor should be constexpr, which means we need to defer the dynamic allocation if the constructor is called during constant-initialization. We can defer it to the first call to barrier::arrive, using compare-and-swap on an atomic (instead of the unique_ptr currently used). A

[gcc r14-11192] libstdc++: Improve Doxygen docs for std::allocator_traits specializations

2025-01-09 Thread Jonathan Wakely via Gcc-cvs
https://gcc.gnu.org/g:e6d2bcf74235ec8760136b2d7364ec472954b65b commit r14-11192-ge6d2bcf74235ec8760136b2d7364ec472954b65b Author: Jonathan Wakely Date: Fri Aug 23 21:54:21 2024 +0100 libstdc++: Improve Doxygen docs for std::allocator_traits specializations The main fix here is to

[gcc r14-11191] libstdc++: Undeprecate std::pmr::polymorphic_allocator::destroy (P2875R4)

2025-01-09 Thread Jonathan Wakely via Libstdc++-cvs
https://gcc.gnu.org/g:734d7dae428a17647d49ed2734ccc1d7d9c9a3b5 commit r14-11191-g734d7dae428a17647d49ed2734ccc1d7d9c9a3b5 Author: Jonathan Wakely Date: Tue Jun 18 16:09:08 2024 +0100 libstdc++: Undeprecate std::pmr::polymorphic_allocator::destroy (P2875R4) This member function

[gcc r14-11193] libstdc++: Use feature test macro for pmr::polymorphic_allocator<>

2025-01-09 Thread Jonathan Wakely via Libstdc++-cvs
https://gcc.gnu.org/g:a4c0f16f048b64c1ab3b2521e3a1595afc64462b commit r14-11193-ga4c0f16f048b64c1ab3b2521e3a1595afc64462b Author: Jonathan Wakely Date: Tue Dec 10 14:35:07 2024 + libstdc++: Use feature test macro for pmr::polymorphic_allocator<> Che

[gcc r14-11190] libstdc++: Give std::memory_order a fixed underlying type [PR89624]

2025-01-09 Thread Jonathan Wakely via Gcc-cvs
https://gcc.gnu.org/g:72fe42c9a095ef9b4125bd65999cd1012dfb73b7 commit r14-11190-g72fe42c9a095ef9b4125bd65999cd1012dfb73b7 Author: Jonathan Wakely Date: Thu Apr 11 19:12:48 2024 +0100 libstdc++: Give std::memory_order a fixed underlying type [PR89624] Prior to C++20 this enum type

[gcc r14-11186] libstdc++: Document when std::string::shrink_to_fit was added

2025-01-09 Thread Jonathan Wakely via Libstdc++-cvs
https://gcc.gnu.org/g:b84070e7bdf1e3666953d008f30f2b7472d9174c commit r14-11186-gb84070e7bdf1e3666953d008f30f2b7472d9174c Author: Jonathan Wakely Date: Tue May 14 14:28:21 2024 +0100 libstdc++: Document when std::string::shrink_to_fit was added This section can be misread to say

[gcc r14-11189] libstdc++: Fix typo in comment in src/c++17/fs_dir.cc

2025-01-09 Thread Jonathan Wakely via Libstdc++-cvs
https://gcc.gnu.org/g:d05d583f80ce3595e417955019d434690295b332 commit r14-11189-gd05d583f80ce3595e417955019d434690295b332 Author: Jonathan Wakely Date: Thu Dec 12 20:38:54 2024 + libstdc++: Fix typo in comment in src/c++17/fs_dir.cc libstdc++-v3/ChangeLog

[gcc r14-11187] libstdc++: Fix some typos and grammatical errors in docs

2025-01-09 Thread Jonathan Wakely via Gcc-cvs
https://gcc.gnu.org/g:2f20d092fcf6d84128451278e7c3d53ff1671131 commit r14-11187-g2f20d092fcf6d84128451278e7c3d53ff1671131 Author: Jonathan Wakely Date: Wed Oct 30 21:10:58 2024 + libstdc++: Fix some typos and grammatical errors in docs Also remove some redundant '

[gcc r14-11188] libstdc++: Make std::println use locale from ostream (LWG 4088)

2025-01-09 Thread Jonathan Wakely via Libstdc++-cvs
https://gcc.gnu.org/g:0cdd4c97c40331eadbd3e0e08c3c6f122c765c87 commit r14-11188-g0cdd4c97c40331eadbd3e0e08c3c6f122c765c87 Author: Jonathan Wakely Date: Wed Dec 11 09:37:48 2024 + libstdc++: Make std::println use locale from ostream (LWG 4088) This was just approved in Wrocław

[gcc r14-11185] libstdc++: Remove __builtin_expect from consteval assertion

2025-01-09 Thread Jonathan Wakely via Libstdc++-cvs
https://gcc.gnu.org/g:cfe866ebfb94499b95107e79f3e910bbe8c4c321 commit r14-11185-gcfe866ebfb94499b95107e79f3e910bbe8c4c321 Author: Jonathan Wakely Date: Wed Nov 27 12:28:30 2024 + libstdc++: Remove __builtin_expect from consteval assertion libstdc++-v3/ChangeLog

[gcc r14-11184] libstdc++: Fix parallel std::exclusive_scan [PR108236]

2025-01-09 Thread Jonathan Wakely via Libstdc++-cvs
https://gcc.gnu.org/g:f0eb0ba218968715506c435ca4ff71043e86617c commit r14-11184-gf0eb0ba218968715506c435ca4ff71043e86617c Author: Jonathan Wakely Date: Tue Dec 3 16:36:05 2024 + libstdc++: Fix parallel std::exclusive_scan [PR108236] The standard says that std::exclusive_scan

  1   2   3   4   5   6   7   8   9   10   >