Re: [PATCH 1/2] libstdc++: Atomic wait/notify ABI stabilization

2023-12-14 Thread Thomas Rodgers
I need to look at this a bit more (and not on my phone, at lunch). Ultimately, C++26 expects to add predicate waits and returning a ‘tri-state’ result isn’t something that’s been considered or likely to be approved. On Mon, Dec 11, 2023 at 12:18 PM Jonathan Wakely wrote: > CCing Tom's current ad

Re: [PATCH] libstdc++: Split up pstl/set.cc testcase

2023-07-05 Thread Thomas Rodgers via Gcc-patches
Comment added to each file. Tested x86_64-linux. Pushed to trunk. On Mon, Jul 3, 2023 at 4:16 PM Jonathan Wakely wrote: > On Mon, 3 Jul 2023 at 23:14, Thomas Rodgers via Libstdc++ > wrote: > > > > This testcase is causing some timeout issues. This patch splits the

[PATCH] libstdc++: Split up pstl/set.cc testcase

2023-07-03 Thread Thomas Rodgers via Gcc-patches
This testcase is causing some timeout issues. This patch splits the testcase up by individual set algorithm. From 857359b72f8886b6e90db3b596d04f08559d2b51 Mon Sep 17 00:00:00 2001 From: Thomas Rodgers Date: Mon, 3 Jul 2023 15:04:45 -0700 Subject: [PATCH] libstdc++: Split up pstl/set.cc testcase

Re: [PATCH] libstdc++: Synchronize PSTL with upstream

2023-06-26 Thread Thomas Rodgers via Gcc-patches
On Wed, May 17, 2023 at 12:32 PM Jonathan Wakely wrote: > -template > - _OutputIterator > -__brick_generate_n(_OutputIterator __first, _Size __count, _Generator > __g, /* is_vector = */ std::true_type) noexcept > +template > > Missing uglification on Size. > > +_RandomAccessIterator > +__brick

Re: [PATCH v2] libstdc++: Do not use pthread_mutex_clocklock with ThreadSanitizer

2023-05-15 Thread Thomas Rodgers via Gcc-patches
On Thu, May 11, 2023 at 1:52 PM Jonathan Wakely wrote: > On Thu, 11 May 2023 at 13:42, Jonathan Wakely wrote: > >> >> >> On Thu, 11 May 2023 at 13:19, Mike Crowe wrote: >> >>> However, ... >>> >>> > > diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 >>> > > index 89e7f5f5f45..

Re: [RFC] libstdc++: Do not use pthread_mutex_clocklock with ThreadSanitizer

2023-05-11 Thread Thomas Rodgers via Gcc-patches
On Thu, May 11, 2023 at 5:21 AM Mike Crowe via Libstdc++ < libstd...@gcc.gnu.org> wrote: > On Wednesday 10 May 2023 at 12:31:12 +0100, Jonathan Wakely wrote: > > On Wed, 10 May 2023 at 12:20, Jonathan Wakely via Libstdc++ < > > libstd...@gcc.gnu.org> wrote: > > > > > This patch would avoid TSan fa

[PATCH] libstdc++: Synchronize PSTL with upstream (2nd attempt)

2023-04-20 Thread Thomas Rodgers via Gcc-patches
The attached (gzipped) patch brings libstdc++'s PSTL implementation up to the current upstream version. Tested x86_64-pc-linux-gnu, specifically with TBB 2020.3 (fedora 37 + tbb-devel). 0001-libstdc-Synchronize-PSTL-with-upstream.patch.gz Description: application/gzip

Re: [PATCH] libstdc++: Add missing free functions for atomic_flag [PR103934]

2023-03-09 Thread Thomas Rodgers via Gcc-patches
The second patch has now been backported and pushed to releases/gcc-12 and releases/gcc-11. On Mon, Feb 13, 2023 at 6:06 PM Thomas Rodgers wrote: > Tested x86_64-pc-linux-gnu. Pushed to trunk. > > The first patch has also been backported and pushed to releases/gcc-12 and > rel

Re: [PATCH] libstdc++: Add missing free functions for atomic_flag [PR103934]

2023-02-13 Thread Thomas Rodgers via Gcc-patches
at 18:25, Thomas Rodgers wrote: > > > > This patch did not get committed in a timely manner after it was OK'd. > In revisiting the patch some issues were found that have lead me to > resubmit for review - > > > > Specifically - > > > > The orig

Re: [PATCH] libstdc++: Add missing free functions for atomic_flag [PR103934]

2023-02-10 Thread Thomas Rodgers via Gcc-patches
This patch did not get committed in a timely manner after it was OK'd. In revisiting the patch some issues were found that have lead me to resubmit for review - Specifically - The original commit to add C++20 atomic_flag::test did not include the free functions for atomic_flag_test[_explicit] The

Re: [RFA] choosing __platform_wait_t on targets without lock-free 64 atomics

2023-01-11 Thread Thomas Rodgers via Gcc-patches
I agree with this change. On Thu, Jan 5, 2023 at 4:22 PM Jonathan Wakely wrote: > How about this? > > I don't think we should worry about targets without atomic int, so don't > bother using types smaller than int. > > > -- >8 -- > > For non-futex targets the __platform_wait_t type is currently u

Re: Patch ping (was Re: [PATCH] libstdc++: Clear padding bits in atomic compare_exchange)

2022-09-09 Thread Thomas Rodgers via Gcc-patches
s/__weak/__is_weak/g perhaps? On Fri, Sep 9, 2022 at 11:46 AM Iain Sandoe via Libstdc++ < libstd...@gcc.gnu.org> wrote: > > > > On 9 Sep 2022, at 19:36, Rainer Orth > wrote: > > > > >> Here's a complete patch that combines the various incremental patches > >> that have been going around. I'm te

Re: Patch ping (was Re: [PATCH] libstdc++: Clear padding bits in atomic compare_exchange)

2022-09-07 Thread Thomas Rodgers via Gcc-patches
Looks good to me. Tom. On Wed, Sep 7, 2022 at 4:56 AM Jonathan Wakely wrote: > Here's a complete patch that combines the various incremental patches > that have been going around. I'm testing this now. > > Please take a look. >

Re: [committed] libstdc++: Add missing runtime exception to licence notice

2022-09-07 Thread Thomas Rodgers via Gcc-patches
Looks good to me. Tom. On Wed, Sep 7, 2022 at 12:27 PM Jonathan Wakely via Gcc-patches < gcc-patches@gcc.gnu.org> wrote: > Tested powerpc64le-linux, pushed to trunk. > > Backports to gcc-11 and gcc-12 needed too. > > -- >8 -- > > This file is missing the GCC Runtime Library Exception text in the

Re: Patch ping (was Re: [PATCH] libstdc++: Clear padding bits in atomic compare_exchange)

2022-09-01 Thread Thomas Rodgers via Gcc-patches
than later. On Thu, Aug 25, 2022 at 3:11 AM Jakub Jelinek wrote: > On Tue, Jan 18, 2022 at 09:48:19PM +, Jonathan Wakely via Gcc-patches > wrote: > > On Tue, 2 Nov 2021 at 01:26, Thomas Rodgers wrote: > > > > > This should address Jonathan's feedb

Re: libstdc++: Minor codegen improvement for atomic wait spinloop

2022-07-26 Thread Thomas Rodgers via Gcc-patches
This is now committed to trunk, backported to releases/gcc-12 and releases/gcc-11. Apologies for the delay, it's been a wild couple of weeks. Tom. On Thu, Jul 7, 2022 at 2:31 AM Jonathan Wakely wrote: > On Wed, 6 Jul 2022 at 22:42, Thomas Rodgers wrote: > > > > Ok

Re: libstdc++: Minor codegen improvement for atomic wait spinloop

2022-07-06 Thread Thomas Rodgers via Gcc-patches
Ok for trunk? backport? On Wed, Jul 6, 2022 at 1:56 PM Jonathan Wakely wrote: > On Wed, 6 Jul 2022 at 02:05, Thomas Rodgers via Libstdc++ > wrote: > > > > This patch merges the spin loops in the atomic wait implementation which > is > > a > > minor codegen

libstdc++: Minor codegen improvement for atomic wait spinloop

2022-07-05 Thread Thomas Rodgers via Gcc-patches
This patch merges the spin loops in the atomic wait implementation which is a minor codegen improvement. libstdc++-v3/ChangeLog: * include/bits/atomic_wait.h (__atomic_spin): Merge spin loops. 0001-libstdc-Minor-codegen-improvement-for-atomic-wait-sp.patch Description: Binary data

Re: [PATCH] libstdc++: Make atomic notify_one and notify_all non-const

2022-04-22 Thread Thomas Rodgers via Gcc-patches
Committed to trunk, backported to releases/gcc-11. On Fri, Feb 11, 2022 at 12:22 PM Jonathan Wakely wrote: > On Fri, 11 Feb 2022 at 17:40, Thomas Rodgers via Libstdc++ > wrote: > > > > > > PR102994 "atomics: std::atomic::wait is not marked const" raises the

Re: [PATCH] libstdc++: Reduce header dependencies from PSTL headers [PR92546]

2022-03-17 Thread Thomas Rodgers via Gcc-patches
Looks ok to me. I just am curious, does the change to src/c++17/fs_path.cc need to be part of this change (It's not obvious to me that it is related to the other changes in the patch). On Thu, Mar 17, 2022 at 12:01 PM Jonathan Wakely wrote: > Tested x86_64-linux. Tom, any objection? > > -- >8 --

[PATCH] libstdc++: Make atomic notify_one and notify_all non-const

2022-02-11 Thread Thomas Rodgers via Gcc-patches
to account for change in notify_one/notify_all signature. Tested x86_64-pc-linux-gnu. From 7ed6dfae5a0a7a9e56291d780e44f99d644847e0 Mon Sep 17 00:00:00 2001 From: Thomas Rodgers Date: Thu, 10 Feb 2022 18:55:16 -0800 Subject: [PATCH] libstdc++: Make atomic notify_one and notify_all non-const

Re: [PATCH] libstdc++: Strengthen memory order for atomic::wait/notify

2022-02-10 Thread Thomas Rodgers via Gcc-patches
Committed to trunk, backported to gcc-11. On Wed, Feb 9, 2022 at 12:37 PM Jonathan Wakely wrote: > On Wed, 9 Feb 2022 at 17:35, Thomas Rodgers via Libstdc++ > wrote: > > > > This patch changes the memory order used in the spin wait code to match > > that of libc++. >

Re: [PATCH] libstdc++: Fix deadlock in atomic wait [PR104442]

2022-02-09 Thread Thomas Rodgers via Gcc-patches
Tested x86_64-pc-linux-gnu, committed to master, backported to gcc-11. On Wed, Feb 9, 2022 at 9:14 AM Jonathan Wakely wrote: > On Wed, 9 Feb 2022 at 17:10, Thomas Rodgers wrote: > > > > Updated patch. I reverted the memory order change (and will submit that > as another pat

[PATCH] libstdc++: Strengthen memory order for atomic::wait/notify

2022-02-09 Thread Thomas Rodgers via Gcc-patches
This patch changes the memory order used in the spin wait code to match that of libc++. From 92caa08b272520ec4a272b302b37d8fb47afb2ab Mon Sep 17 00:00:00 2001 From: Thomas Rodgers Date: Wed, 9 Feb 2022 09:26:00 -0800 Subject: [PATCH] libstdc++: Strengthen memory order for atomic::wait/notify

Re: [PATCH] libstdc++: Fix deadlock in atomic wait [PR104442]

2022-02-09 Thread Thomas Rodgers via Gcc-patches
Updated patch. I reverted the memory order change (and will submit that as another patch) and fixed some spelling and grammar errors. On Wed, Feb 9, 2022 at 2:43 AM Jonathan Wakely wrote: > On Wed, 9 Feb 2022 at 00:57, Thomas Rodgers via Libstdc++ > wrote: > > > > This issue

Re: [PATCH] libstdc++: Fix deadlock in atomic wait [PR104442]

2022-02-09 Thread Thomas Rodgers via Gcc-patches
Excessively enthusiastic refactoring. I expect to rewrite most of this as part of the work I'm starting now for GCC13 stage1. On Wed, Feb 9, 2022 at 2:43 AM Jonathan Wakely wrote: > On Wed, 9 Feb 2022 at 00:57, Thomas Rodgers via Libstdc++ > wrote: > > > > This

[PATCH] libstdc++: Fix deadlock in atomic wait [PR104442]

2022-02-08 Thread Thomas Rodgers via Gcc-patches
Sep 17 00:00:00 2001 From: Thomas Rodgers Date: Tue, 8 Feb 2022 16:33:36 -0800 Subject: [PATCH] libstdc++: Fix deadlock in atomic wait [PR104442] This issue was observed as a deadloack in 29_atomics/atomic/wait_notify/100334.cc on vxworks. When a wait is "laundered" (e.g. type T* does no

Re: [PATCH] Strengthen memory memory order for atomic::wait/notify

2022-02-01 Thread Thomas Rodgers via Gcc-patches
Tested x86_64-pc-linux-gnu, committed to master. Backported to GCC-11. On Sun, Jan 16, 2022 at 12:31 PM Jonathan Wakely wrote: > > > On Sun, 16 Jan 2022 at 01:48, Thomas Rodgers via Libstdc++ < > libstd...@gcc.gnu.org> wrote: > >> This patch updates the memory orde

[PATCH] Strengthen memory memory order for atomic::wait/notify

2022-01-15 Thread Thomas Rodgers via Gcc-patches
This patch updates the memory order of atomic accesses to the waiter's count to match libc++'s usage. It should be backported to GCC11. Tested x86_64-pc-linux-gnu. From f5ed7674f86283db4f4ff49a2cc65d4f852413a1 Mon Sep 17 00:00:00 2001 From: Thomas Rodgers Date: Sat, 15 Jan 2022 17:4

[PATCH] libstdc++: Add missing free functions for atomic_flag [PR103934]

2022-01-14 Thread Thomas Rodgers via Gcc-patches
From c2b74fd7cf2668d288f46da42565e5eb954e5e1f Mon Sep 17 00:00:00 2001 From: Thomas Rodgers Date: Fri, 14 Jan 2022 18:30:27 -0800 Subject: [PATCH] libstdc++: Add missing free functions for atomic_flag [PR103934] libstdc++-v3/ChangeLog: PR103934 * include/std/atomic: Add missing free

Re: libstdc++: Make atomic::wait() const [PR102994]

2021-12-09 Thread Thomas Rodgers via Gcc-patches
Tested uild-x86_64-pc-linux-gnu, pushed to trunk and gcc-11. On Thu, Nov 25, 2021 at 1:24 PM Jonathan Wakely wrote: > On Wed, 24 Nov 2021 at 01:27, Thomas Rodgers wrote: > > > > const qualification was also missing in the free functions for > wait/wait_explicit/notify_one/n

Re: libstdc++: Make atomic::wait() const [PR102994]

2021-11-23 Thread Thomas Rodgers via Gcc-patches
const qualification was also missing in the free functions for wait/wait_explicit/notify_one/notify_all. Revised patch attached. On Tue, Nov 9, 2021 at 11:40 AM Jonathan Wakely wrote: > On Tue, 9 Nov 2021 at 18:09, Thomas Rodgers wrote: > >> Revised patch attached. >> > &

Re: libstdc++: Make atomic::wait() const [PR102994]

2021-11-09 Thread Thomas Rodgers via Gcc-patches
ease add something when you commit, it can be dumb and > simple, it just needs to verify that it can be called. > > > > > > > > On Fri, 5 Nov 2021 at 21:46, Thomas Rodgers via Libstdc++ < > > libstd...@gcc.gnu.org> wrote: > > > > > > > > >

libstdc++: Make atomic::wait() const [PR102994]

2021-11-05 Thread Thomas Rodgers via Gcc-patches
From 360c094a0725bb0cc444115c0377db10e5e9ae1f Mon Sep 17 00:00:00 2001 From: Thomas Rodgers Date: Fri, 5 Nov 2021 14:30:24 -0700 Subject: [PATCH] libstdc++: Make atomic::wait() const [PR102994] This was an oversight in the original commit adding wait/notify to atomic. libstdc++-v3/ChangeLog

Re: [PATCH] libstdc++: Clear padding bits in atomic compare_exchange

2021-11-02 Thread Thomas Rodgers
Jelinek wrote: > On Mon, Nov 01, 2021 at 06:25:45PM -0700, Thomas Rodgers via Gcc-patches > wrote: > > +template > > + constexpr bool > > + __maybe_has_padding() > > + { > > +#if __has_builtin(__has_unique_object_representations) > > + r

Re: [PATCH] libstdc++: Clear padding bits in atomic compare_exchange

2021-11-01 Thread Thomas Rodgers via Gcc-patches
This should address Jonathan's feedback and adds support for atomic_ref On Wed, Sep 29, 2021 at 5:14 AM Jonathan Wakely wrote: > On Mon, 27 Sept 2021 at 15:11, Thomas Rodgers > wrote: > > > > From: Thomas Rodgers > > > > Now with checks for __has_builtin(__

Re: [PATCH] libstdc++: Clear padding bits in atomic compare_exchange

2021-09-29 Thread Thomas Rodgers via Gcc-patches
On Wed, Sep 29, 2021 at 5:14 AM Jonathan Wakely wrote: > On Mon, 27 Sept 2021 at 15:11, Thomas Rodgers > wrote: > > > > From: Thomas Rodgers > > > > Now with checks for __has_builtin(__builtin_clear_padding) > > > > This change implements

[PATCH] libstdc++: Clear padding bits in atomic compare_exchange

2021-09-27 Thread Thomas Rodgers
From: Thomas Rodgers Now with checks for __has_builtin(__builtin_clear_padding) This change implements P0528 which requires that padding bits not participate in atomic compare exchange operations. All arguments to the generic template are 'sanitized' by the __builtin_clearpaddin

Re: [PATCH] libstdc++: Clear padding bits in atomic compare_exchange

2021-09-23 Thread Thomas Rodgers via Gcc-patches
Agreed, I'll revise the patch to do so. On Thu, Sep 23, 2021 at 12:07 PM Jakub Jelinek wrote: > On Thu, Sep 23, 2021 at 11:08:37AM -0700, Thomas Rodgers wrote: > > From: Thomas Rodgers > > > > This change implements P0528 which requires that padding bits not > &g

[PATCH] libstdc++: Clear padding bits in atomic compare_exchange

2021-09-23 Thread Thomas Rodgers
From: Thomas Rodgers This change implements P0528 which requires that padding bits not participate in atomic compare exchange operations. All arguments to the generic template are 'sanitized' by the __builtin_clear_padding intrinsic before they are used in atomic compare_exch

[PATCH] libstdc++: Implement C++20 atomic and atomic

2021-09-17 Thread Thomas Rodgers
From: Thomas Rodgers Let's try this one instead. Signed-off-by: Thomas Rodgers libstdc++-v3/ChangeLog: * acinclude.m4: Update ABI version. * config/abi/pre/gnu.ver (GLIBCXX_3.4.21): Do not match new _Sp_locker constructor. (GLIBCXX_3.4.30): Export _Sp_l

[PATCH] libstdc++: Implement C++20 atomic and atomic

2021-09-17 Thread Thomas Rodgers
From: Thomas Rodgers Signed-off-by: Thomas Rodgers libstdc++-v3/ChangeLog: * config/abi/pre/gnu.ver (GLIBCXX_3.4.21): Do not match new _Sp_locker constructor. (GLIBCXX_3.4.30): Export _Sp_locker::_M_wait/_M_notify and new constructor. * include/bits

[PATCH] libstdc++: Fix UB in atomic_ref/wait_notify.cc [PR101761]

2021-09-16 Thread Thomas Rodgers
From: Thomas Rodgers Remove UB in atomic_ref/wait_notify test. Signed-off-by: Thomas Rodgers libstdc++-v3/ChangeLog: PR libstdc++/101761 * testsuite/29_atomics/atomic_ref/wait_notify.cc (test): Use va and vb as arguments to wait/notify, remove unused bb local. Tested

Re: [PATCH] libstdc++: Define macro before it is first checked

2021-09-02 Thread Thomas Rodgers via Gcc-patches
Agreed. On Thu, Sep 2, 2021 at 10:58 AM Jonathan Wakely wrote: > Signed-off-by: Jonathan Wakely > > libstdc++-v3/ChangeLog: > > * include/bits/atomic_wait.h (_GLIBCXX_HAVE_PLATFORM_WAIT): > Define before first attempt to check it. > > Tested x86_64-linux and powerpc64-linux, not

Re: [PATCH] c++: implement C++17 hardware interference size

2021-07-20 Thread Thomas Rodgers
On 2021-07-17 06:32, Jonathan Wakely via Gcc-patches wrote: On Sat, 17 Jul 2021, 09:15 Matthias Kretz, wrote: On Friday, 16 July 2021 21:58:36 CEST Jonathan Wakely wrote: On Fri, 16 Jul 2021 at 20:26, Matthias Kretz wrote: On Friday, 16 July 2021 18:54:30 CEST Jonathan Wakely wrote: On Fri,

Re: [PATCH] libstdc++: Fix for deadlock in std::counting_semaphore [PR100806]

2021-06-22 Thread Thomas Rodgers via Gcc-patches
Tested x86_64-pc-linux-gnu. Committed to master, backported to releases/gcc-11. On Thu, Jun 17, 2021 at 9:46 AM Jonathan Wakely wrote: > On Wed, 16 Jun 2021 at 20:53, Thomas Rodgers > wrote: > > > > Same as previous version except removing the copyright notice

[PATCH] libstdc++: Fix for deadlock in std::counting_semaphore [PR100806]

2021-06-16 Thread Thomas Rodgers
Same as previous version except removing the copyright notice from the test. libstdc++-v3/ChangeLog: libstdc++/PR100806 * include/bits/semaphore_base.h (__atomic_semaphore::_M_release(): Force _M_release() to wake all waiting threads. * testsuite/30_threads/semaphor

[PATCH] libstdc++: Fix for deadlock in std::counting_semaphore [PR100806]

2021-06-16 Thread Thomas Rodgers
This is an 'interim' fix. For now it forces all waiting threads to wake on _M_release(). This isn't exactly efficient but resolves the issue in the immediate term. libstdc++-v3/ChangeLog: libstdc++/PR100806 * include/bits/semaphore_base.h (__atomic_semaphore::_M_release():

[committed] libstdc++: Only support atomic_ref::wait tests which are always lockfree

2021-06-09 Thread Thomas Rodgers
Fixes a regression on arm32 targets. libstdc++/ChangeLog: * testsuite/29_atomics/atomic_ref/wait_notify.cc: Guard test logic with constexpr check for is_always_lock_free. As discussed on IRC. Tested x86_64-pc-linux-gnu, committed to master, backported to releases/gcc-11. --- ...

Re: [PATCH] Document that -fno-trampolines is for Ada only [PR100735]

2021-06-09 Thread Thomas Rodgers
On 2021-06-09 09:23, Jeff Law via Gcc-patches wrote: On 5/25/2021 2:23 PM, Paul Eggert wrote: The GCC manual's documentation of -fno-trampolines was apparently written from an Ada point of view. However, when I read it I understandably mistook it to say that -fno-trampolines also works for C,

Re: [PATCH] libstdc++: Fix Wrong param type in :atomic_ref<_Tp*>::wait [PR100889]

2021-06-09 Thread Thomas Rodgers via Gcc-patches
Pretty sure I know this is, I'll work on a fix today. On Wed, Jun 9, 2021 at 7:30 AM Christophe Lyon wrote: > Hi, > > > On Wed, 9 Jun 2021 at 01:05, Thomas Rodgers via Gcc-patches > wrote: > > > > Tested x86_64-pc-linux-gnu, committed to master, backported to

Re: [PATCH] [libstdc++] Remove unused hasher instance.

2021-06-08 Thread Thomas Rodgers via Gcc-patches
Tested x86_64-pc-linux-gnu, committed to master, backported to releases/gcc-11. On Fri, Jun 4, 2021 at 1:30 PM Jonathan Wakely wrote: > > > On Fri, 4 Jun 2021 at 20:54, Thomas Rodgers wrote: > >> This is a remnant of poorly executed refactoring. >> > > O

Re: [PATCH] libstdc++: Fix Wrong param type in :atomic_ref<_Tp*>::wait [PR100889]

2021-06-08 Thread Thomas Rodgers via Gcc-patches
Tested x86_64-pc-linux-gnu, committed to master, backported to releases/gcc-11. On Tue, Jun 8, 2021 at 8:44 AM Jonathan Wakely wrote: > On Tue, 8 Jun 2021 at 01:29, Thomas Rodgers wrote: > >> This time without the repeatred [PR] in the subject line. >> >> Fixes libs

[PATCH] libstdc++: Fix Wrong param type in :atomic_ref<_Tp*>::wait [PR100889]

2021-06-07 Thread Thomas Rodgers
This time without the repeatred [PR] in the subject line. Fixes libstdc++/100889 libstdc++-v3/ChangeLog: * include/bits/atomic_base.h (atomic_ref<_Tp*>::wait): Change parameter type from _Tp to _Tp*. * testsuite/29_atomics/atomic_ref/wait_notify.cc: Extend cov

[PATCH] libstdc++: Fix Wrong param type in :atomic_ref<_Tp*>::wait [PR100889] [PR100889]

2021-06-07 Thread Thomas Rodgers
Fixes libstdc++/100889 libstdc++-v3/ChangeLog: * include/bits/atomic_base.h (atomic_ref<_Tp*>::wait): Change parameter type from _Tp to _Tp*. * testsuite/29_atomics/atomic_ref/wait_notify.cc: Extend coverage of types tested. --- libstdc++-v3/include/bits/atomic_ba

[PATCH] [libstdc++] Fix Wrong param type in :atomic_ref<_Tp*>::wait [PR100889]

2021-06-04 Thread Thomas Rodgers
Fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100889 libstdc++-v3/ChangeLog: * include/bits/atomic_base.h (atomic_ref<_Tp*>::wait): Change parameter type from _Tp to _Tp*. * testsuite/29_atomics/atomic_ref/100889.cc: New test. --- libstdc++-v3/include/bits/atomic_bas

[PATCH] PR libstdc++/100889: Fix wrong param type in atomic_ref<_Tp*>::wait

2021-06-04 Thread Thomas Rodgers
Fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100889 libstdc++-v3/ChangeLog: * include/bits/atomic_base.h (atomic_ref<_Tp*>::wait): Change parameter type from _Tp to _Tp*. * testsuite/29_atomics/atomic_ref/deduction.cc: Add reproducer case from PR. --- libstd

[PATCH] [libstdc++] Cleanup atomic timed wait implementation

2021-06-04 Thread Thomas Rodgers
This cleans up the implementation of atomic_timed_wait.h and fixes the accidental pessimization of spinning after waiting in __timed_waiter_pool::_M_do_wait_until. libstdc++-v3/ChangeLog: * include/bits/atomic_timed_wait.h (__wait_clock_t): Define conditionally. (__cond_wa

[PATCH] [libstdc++] Remove unused hasher instance.

2021-06-04 Thread Thomas Rodgers
This is a remnant of poorly executed refactoring. libstdc++-v3/ChangeLog: * include/std/barrier (__tree_barrier::_M_arrive): Remove unnecessary hasher instantiation. --- libstdc++-v3/include/std/barrier | 1 - 1 file changed, 1 deletion(-) diff --git a/libstdc++-v3/include/std/b

Re: [PATCH] libstdc++: Fix wrong thread waking on notify [PR100334]

2021-05-17 Thread Thomas Rodgers
On 2021-05-17 09:43, Jonathan Wakely wrote: On 14/05/21 18:09 +0100, Jonathan Wakely wrote: On 13/05/21 18:54 -0700, Thomas Rodgers wrote: From: Thomas Rodgers Please ignore the previous patch. This one removes the need to carry any extra state in the case of a 'laundered' a

[PATCH] libstdc++: Fix wrong thread waking on notify [PR100334]

2021-05-13 Thread Thomas Rodgers
From: Thomas Rodgers Please ignore the previous patch. This one removes the need to carry any extra state in the case of a 'laundered' atomic wait. libstdc++/ChangeLog: * include/bits/atomic_wait.h (__waiter::_M_do_wait_v): loop until value chang

[PATCH] libstdc++: Fix wrong thread waking on notify [PR100334]

2021-05-13 Thread Thomas Rodgers
From: Thomas Rodgers libstdc++/ChangeLog: * include/bits/atomic_wait.h (__waiter::_M_do_wait_v): loop until value change observed. (__waiter_base::_M_a): Renamed member from _M_addr, changed type to uintptr_t. (__waiter_base::_S_wait_addr): Change return

[PATCH] libstdc++: Fix wrong thread waking on notify [PR100334]

2021-05-03 Thread Thomas Rodgers
From: Thomas Rodgers This should also be backported to gcc-11 libstdc++/ChangeLog: * include/bits/atomic_wait.h (__waiter::_M_do_wait_v): loop until observe value change. (__waiter_base::_M_laundered): New member. (__watier_base::_M_notify): Check _M_laundered to

Re: [PATCH] [libstdc++] Fix "bare" notifications dropped by waiters check

2021-04-22 Thread Thomas Rodgers
On 2021-04-22 02:23, Jonathan Wakely wrote: On 21/04/21 18:29 -0700, Thomas Rodgers wrote: From: Thomas Rodgers NOTE - This patch also needs to be backported to gcc-11 in order for semaphore release() to work correctly on non-futex platforms. Tested sparc-sun-solaris2.11 For types that

Re: [PATCH] [libstdc++] Fix test timeout in stop_calback/destroy.cc

2021-04-21 Thread Thomas Rodgers
On 2021-04-21 14:22, Jakub Jelinek wrote: On Wed, Apr 21, 2021 at 07:23:30PM +0100, Jonathan Wakely via Gcc-patches wrote: We should do this for gcc-11 too if an RM approves it, since acquire() is currently broken. Ok, but please commit it soon, we'll need to do a RC2 tomorrow or on Friday

[PATCH] [libstdc++] Fix "bare" notifications dropped by waiters check

2021-04-21 Thread Thomas Rodgers
From: Thomas Rodgers NOTE - This patch also needs to be backported to gcc-11 in order for semaphore release() to work correctly on non-futex platforms. Tested sparc-sun-solaris2.11 For types that track whether or not there extant waiters (e.g. semaphore) internally, the

Re: [PATCH] [libstdc++] Fix test timeout in stop_calback/destroy.cc

2021-04-21 Thread Thomas Rodgers
On 2021-04-21 11:23, Jonathan Wakely wrote: On 21/04/21 10:10 -0700, Thomas Rodgers wrote: [...snip...] Please commit your patch to trunk, since that's what you had in your original patch before I asked you to change it (causing the bug). We should do this for gcc-11 too if an RM app

[PATCH] [libstdc++] Fix test timeout in stop_calback/destroy.cc

2021-04-21 Thread Thomas Rodgers
From: Thomas Rodgers A change was made to __atomic_semaphore::_S_do_try_acquire() to (ideally) let the compare_exchange reload the value of __old rather than always reloading it twice. This causes _M_acquire to spin indefinitely if the value of __old is already 0. libstdc++/ChangeLog

Re: GCC 11.1 Release Candidate available from gcc.gnu.org

2021-04-21 Thread Thomas Rodgers
On 2021-04-21 05:12, Jonathan Wakely wrote: On 21/04/21 12:38 +0100, Jonathan Wakely wrote: On 20/04/21 22:12 -0700, Thomas Rodgers wrote: @@ -86,6 +88,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } } +_GLIBCXX_ALWAYS_INLINE bool +_M_try_acquire() noexcept +{ + for

[PATCH] [libstdc++] Refactor/cleanup of atomic wait implementation

2021-04-19 Thread Thomas Rodgers
From: Thomas Rodgers This patch address jwakely's feedback from 2021-04-15. This is a substantial rewrite of the atomic wait/notify (and timed wait counterparts) implementation. The previous __platform_wait looped on EINTR however this behavior is not required by the standard.

Re: [PATCH 0/3] Uncontroversial improvements to C++20 wait-related implementation

2021-03-26 Thread Thomas Rodgers
On 2021-03-23 09:35, Jonathan Wakely wrote: On 23/03/21 09:26 -0700, Thiago Macieira via Libstdc++ wrote: On Tuesday, 23 March 2021 08:39:43 PDT Thomas Rodgers wrote: I will be submitting a new patch for the atomic.wait/barrier/latch/semaphore functionality a bit later today that subsumes

[PATCH] [libstdc++] Refactor/cleanup of atomic wait implementation

2021-03-23 Thread Thomas Rodgers
From: Thomas Rodgers * This patch addresses jwakely's previous feedback. * This patch also subsumes thiago.macie...@intel.com 's 'Uncontroversial improvements to C++20 wait-related implementation'. * This patch also changes the atomic semaphore implementation to avoi

Re: [PATCH 0/3] Uncontroversial improvements to C++20 wait-related implementation

2021-03-23 Thread Thomas Rodgers
On 2021-03-22 08:29, Thiago Macieira via Libstdc++ wrote: Discussion at: https://gcc.gnu.org/pipermail/libstdc++/2021-February/052043.html This patch set includes the uncontroversial parts that improve performance but don't otherwise change ABI. Please note we still need to decide on how to de

Re: [PATCH 4/5] barrier: use int instead of unsigned char for the phase state

2021-03-01 Thread Thomas Rodgers
On 2021-03-01 10:06, Thiago Macieira wrote: On Monday, 1 March 2021 09:38:58 PST Thomas Rodgers wrote: And _M_phase, despite being non-atomic, is never accessed without the atomic_ref, aside from the constructor. Both arrive() and wait() start off by creating the atomic_ref. If it's non-a

Re: [PATCH 4/5] barrier: use int instead of unsigned char for the phase state

2021-03-01 Thread Thomas Rodgers
Botched replying to the list, sending again On 2021-03-01 09:38, Thomas Rodgers wrote: On 2021-03-01 09:24, Thiago Macieira via Libstdc++ wrote: On Sunday, 28 February 2021 07:05:47 PST Hans-Peter Nilsson wrote: On Fri, 26 Feb 2021, Thiago Macieira via Gcc-patches wrote: ints can be used in

Re: [PATCH 4/5] barrier: use int instead of unsigned char for the phase state

2021-03-01 Thread Thomas Rodgers
On 2021-03-01 09:24, Thiago Macieira via Libstdc++ wrote: On Sunday, 28 February 2021 07:05:47 PST Hans-Peter Nilsson wrote: On Fri, 26 Feb 2021, Thiago Macieira via Gcc-patches wrote: ints can be used in futexes. chars can't. Shouldn't that be an atomic type instead of a bare int then? The

Re: [PATCH 1/5] std::latch: reduce internal implementation from ptrdiff_t to int

2021-03-01 Thread Thomas Rodgers
On 2021-02-28 13:31, Hans-Peter Nilsson wrote: On Fri, 26 Feb 2021, Thiago Macieira via Gcc-patches wrote: On Friday, 26 February 2021 11:31:00 PST Andreas Schwab wrote: On Feb 26 2021, Thiago Macieira wrote: On Friday, 26 February 2021 10:14:42 PST Andreas Schwab wrote: On Feb 26 2021, Thiag

Re: [PATCH 4/5] barrier: use int instead of unsigned char for the phase state

2021-03-01 Thread Thomas Rodgers
On 2021-02-28 07:05, Hans-Peter Nilsson wrote: On Fri, 26 Feb 2021, Thiago Macieira via Gcc-patches wrote: ints can be used in futexes. chars can't. Shouldn't that be an atomic type instead of a bare int then? It's an atomic_ref. --- libstdc++-v3/include/std/barrier | 21 ---

[PATCH] [libstdc++] Refactor/cleanup of atomic wait implementation

2021-02-23 Thread Thomas Rodgers
From: Thomas Rodgers * This revises the previous version to fix std::__condvar::wait_until() usage. This is a substantial rewrite of the atomic wait/notify (and timed wait counterparts) implementation. The previous __platform_wait looped on EINTR however this behavior is not required by the

[PATCH] [libstdc++] Refactor/cleanup of atomic wait implementation

2021-02-22 Thread Thomas Rodgers
From: Thomas Rodgers This is a substantial rewrite of the atomic wait/notify (and timed wait counterparts) implementation. The previous __platform_wait looped on EINTR however this behavior is not required by the standard. A new _GLIBCXX_HAVE_PLATFORM_WAIT macro now controls whether wait/notify

Re: [PATCH] libstdc++: Fix up parallel_backend_serial.h [PR97549]

2021-02-22 Thread Thomas Rodgers via Gcc-patches
- Original Message - > Hi! > > In GCC 10, parallel_backend.h just included parallel_backend_{serial,tbb}.h > and > did nothing beyond that, and parallel_backend_tbb.h provided directly > namespace __pstl { namespace __par_backend { ... } } > and defined everything in there, while parall

Re: [PATCH] libstdc++: Add support for C++20 barriers

2021-01-07 Thread Thomas Rodgers via Gcc-patches
Tested x86_64-pc-linux-gnu, committed to master. Jonathan Wakely writes: > On 17/12/20 15:37 -0800, Thomas Rodgers wrote: >>From: Thomas Rodgers >> >>Cleans up a few things mentioned on IRC. >> >>Adds >> >>libstdc++/ChangeLog: >>

[PATCH] libstdc++: Add support for C++20 barriers

2020-12-17 Thread Thomas Rodgers
From: Thomas Rodgers Cleans up a few things mentioned on IRC. Adds libstdc++/ChangeLog: * doc/doxygen/user.cfg.in: Add new header. * include/Makefile.am (std_headers): likewise. * include/Makefile.in: Regenerate. * include/precompiled/stdc++.h: Add new header

[PATCH] libstdc++: Add support for C++20 barriers

2020-12-17 Thread Thomas Rodgers
From: Thomas Rodgers Let's see if this one sticks... Adds libstdc++/ChangeLog: * doc/doxygen/user.cfg.in: Add new header. * include/Makefile.am (std_headers): likewise. * include/Makefile.in: Regenerate. * include/precompiled/stdc++.h: Add new h

Re: [PATCH] Add feature test macro for atomic::wait

2020-12-01 Thread Thomas Rodgers via Gcc-patches
Tested x86_64-pc-linux-gnu, committed to trunk. Jonathan Wakely writes: > On 30/11/20 10:17 -0800, Thomas Rodgers wrote: >>From: Thomas Rodgers >> >>Adds __cpp_lib_atomic_wait feature test macro which was overlooked in >>the initial commit of thi

[PATCH] Add feature test macro for atomic::wait

2020-11-30 Thread Thomas Rodgers
From: Thomas Rodgers Adds __cpp_lib_atomic_wait feature test macro which was overlooked in the initial commit of this feature. Replaces uses of _GLIBCXX_HAVE_ATOMIC_WAIT. libstdc++-v3/ChangeLog: * include/bits/atomic_base.h: Replace usage of _GLIBCXX_HAVE_ATOMIC_WAIT with

[PATCH] libstdc++: Add support for C++20 barriers

2020-11-20 Thread Thomas Rodgers
From: Thomas Rodgers Should include all discussion on and off list to date. Adds libstdc++/ChangeLog: * include/Makefile.am (std_headers): Add new header. * include/Makefile.in: Regenerate. * include/std/barrier: New file. * include/std/version: Add

Re: [PATCH] libstdc++: Add C++2a synchronization support

2020-11-20 Thread Thomas Rodgers
Tested x86_64-pc-linux-gnu, committed. > On Oct 27, 2020, at 3:23 AM, Jonathan Wakely wrote: > > On 26/10/20 14:48 -0700, Thomas Rodgers wrote: >> +#include >> + >> +#if __has_include() >> +#define _GLIBCXX_HAVE_POSIX_SEMAPHORE 1 >> +#include > >

Re: [PATCH] libstdc++: Enable without gthreads

2020-11-16 Thread Thomas Rodgers
This patch looks good to me. It would be great to find a way to do a similar refactoring of condition_variable. > On Nov 12, 2020, at 9:07 AM, Jonathan Wakely via Libstdc++ > wrote: > > On 11/11/20 17:31 +, Jonathan Wakely wrote: >> On 11/11/20 16:13 +, Jonathan Wakely wrote: >>> This

Re: [PATCH] libstdc++: Implement C++20 features for

2020-11-04 Thread Thomas Rodgers
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97719 > On Nov 4, 2020, at 11:54 AM, Stephan Bergmann wrote: > > On 07/10/2020 18:55, Thomas Rodgers wrote: >> From: Thomas Rodgers >> New ctors and ::view() accessor for - >> * basic_stingbuf >> * basic_istring

Re: [PATCH] libstdc++: Add support for C++20 barriers

2020-11-04 Thread Thomas Rodgers
> On Nov 4, 2020, at 10:50 AM, Jonathan Wakely wrote: > > On 04/11/20 09:29 -0800, Thomas Rodgers wrote: >> From: Thomas Rodgers >> >> Adds >> >> libstdc++/ChangeLog: >> >> * include/Makefile.am (std_headers): Add ne

Re: [PATCH] libstdc++: Add support for C++20 barriers

2020-11-04 Thread Thomas Rodgers
> On Nov 4, 2020, at 10:52 AM, Jonathan Wakely wrote: > > On 04/11/20 10:41 -0800, Thomas Rodgers wrote: >> From: Thomas Rodgers >> >> IGNORE the previous version of this patch please. > > OK, but all my comments seem to apply to this one too. >

[PATCH] libstdc++: Add support for C++20 barriers

2020-11-04 Thread Thomas Rodgers
From: Thomas Rodgers IGNORE the previous version of this patch please. Adds libstdc++/ChangeLog: * include/Makefile.am (std_headers): Add new header. * include/Makefile.in: Regenerate. * include/std/barrier: New file. * testsuite/30_thread/barrier/1.cc: New

[PATCH] libstdc++: Add support for C++20 barriers

2020-11-04 Thread Thomas Rodgers
From: Thomas Rodgers Adds libstdc++/ChangeLog: * include/Makefile.am (std_headers): Add new header. * include/Makefile.in: Regenerate. * include/std/barrier: New file. * testsuite/30_thread/barrier/1.cc: New test. * testsuite/30_thread/barrier/2.cc

Re: [PATCH] libstdc++: Add c++2a

2020-11-02 Thread Thomas Rodgers via Gcc-patches
Testsed x86_64-pc-linux-gnu, committed to master. Jonathan Wakely writes: > On 02/11/20 08:10 -0800, Thomas Rodgers wrote: >>From: Thomas Rodgers >> >>IGNORE the previous patch. >> >>Changes implementation to use a private __mutex type as discussed o

[PATCH] libstdc++: Add c++2a

2020-11-02 Thread Thomas Rodgers
From: Thomas Rodgers IGNORE the previous patch. Changes implementation to use a private __mutex type as discussed on IRC. libstdc++/ChangeLog: libstdc++-v3/doc/doxygen/user.cfg.in (INPUT): Add new header. libstdc++-v3/include/Makefile.am (std_headers): Add new header

[PATCH] libstdc++: Add c++2a

2020-11-02 Thread Thomas Rodgers
From: Thomas Rodgers Changes implementation to use a private __mutex type as discussed on IRC. libstdc++/ChangeLog: libstdc++-v3/doc/doxygen/user.cfg.in (INPUT): Add new header. libstdc++-v3/include/Makefile.am (std_headers): Add new header. libstdc++-v3/include

[PATCH] libstdc++: Add c++2a

2020-10-29 Thread Thomas Rodgers
From: Thomas Rodgers Addresses latest patch feedback. Changes to also work on single threaded configurations. libstdc++/ChangeLog: libstdc++-v3/doc/doxygen/user.cfg.in (INPUT): Add new header. libstdc++-v3/include/Makefile.am (std_headers): Add new header. libstdc++-v3

[PATCH] libstdc++: Add C++2a synchronization support

2020-10-26 Thread Thomas Rodgers
From: Thomas Rodgers Add support for - * atomic_flag::wait/notify_one/notify_all * atomic::wait/notify_one/notify_all * counting_semaphore * binary_semaphore * latch libstdc++-v3/ChangeLog: * include/Makefile.am (bits_headers): Add new header. * include/Makefile.in

[PATCH] libstdc++: Implement C++20 features for

2020-10-26 Thread Thomas Rodgers
From: Thomas Rodgers New ctors and ::view() accessor for - * basic_stingbuf * basic_istringstream * basic_ostringstream * basic_stringstreamm New ::get_allocator() accessor for basic_stringbuf. libstdc++-v3/ChangeLog: * acinclude.m4 (glibcxx_SUBDIRS): Add src/c++20

  1   2   3   >