Re: [PATCH, libstdc++] Improve the performance of std::uniform_int_distribution (fewer divisions)

2020-10-05 Thread Jonathan Wakely via Gcc-patches
On 06/10/20 00:25 +0100, Jonathan Wakely wrote: I'm sorry it's taken a year to review this properly. Comments below ... On 27/09/19 14:18 -0400, Daniel Lemire wrote: (This is a revised patch proposal. I am revising both the description and the code itself.) Even on recent processors, integer d

Re: [PATCH, libstdc++] Improve the performance of std::uniform_int_distribution (fewer divisions)

2020-10-05 Thread Jonathan Wakely via Gcc-patches
On 06/10/20 00:25 +0100, Jonathan Wakely wrote: I'm sorry it's taken a year to review this properly. Comments below ... On 27/09/19 14:18 -0400, Daniel Lemire wrote: (This is a revised patch proposal. I am revising both the description and the code itself.) Even on recent processors, integer d

Re: [committed] libstdc++: Add deduction guide for std::ranges::join_view [LWG 3474]

2020-10-06 Thread Jonathan Wakely via Gcc-patches
On 06/10/20 00:05 -0500, Tim Song via Libstdc++ wrote: I thought LWG approved the other option in the PR (changing views::join to not use CTAD)? Oops, good point. Fixed like so. Tested powerpc64le-linux, pushed. On Mon, Aug 24, 2020 at 10:22 AM Jonathan Wakely via Gcc-patches < gcc-patc

[committed] libstdc++: Inline std::exception_ptr members [PR 90295]

2020-10-06 Thread Jonathan Wakely via Gcc-patches
This inlines most members of std::exception_ptr so that all operations on a null exception_ptr can be optimized away. This benefits code like std::future and coroutines where an exception_ptr object is present to cope with exceptional cases, but is usually not used and remains null. Since those fu

Re: [PATCH, libstdc++] Improve the performance of std::uniform_int_distribution (fewer divisions)

2020-10-06 Thread Jonathan Wakely via Gcc-patches
On 06/10/20 15:55 -0400, Daniel Lemire via Libstdc++ wrote: The updated patch looks good to me. It is indeed cleaner to have a separate (static) function. It might be nice to add a comment to explain the _S_nd function maybe with a comment like "returns a random value in [0,__range) without any

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

2020-10-07 Thread Jonathan Wakely via Gcc-patches
On 07/10/20 09:55 -0700, Thomas Rodgers wrote: 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 (

[committed] libstdc++: Fix non-reserved names in headers

2020-10-07 Thread Jonathan Wakely via Gcc-patches
My recent changes to std::exception_ptr moved some members to be inline in the header but didn't replace the variable names with reserved names. The "tmp" variable must be fixed. The "other" parameter is actually a reserved name because of std::allocator::rebind::other but should be fixed anyway.

[committed] libstdc++: Fix divide by zero in default template argument

2020-10-07 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: * include/bits/random.h (__detail::_Mod): Avoid divide by zero. * testsuite/26_numerics/random/linear_congruential_engine/operators/call.cc: New test. Tested powerpc64le-linux. Committed to trunk. commit 6ae17a3b6835b30102607d45ac89c7a668e2c8d4 Au

[committed] libstdc++: Add C++11 member functions for ios::failure in old ABI

2020-10-08 Thread Jonathan Wakely via Gcc-patches
The new constructors that C++11 added to std::ios_base::failure were missing for the old ABI. This adds them, but just ignores the std::error_code argument (because there's nowhere to store it). This also adds a code() member, which should be provided by the std::system_error base class, but that

Re: [committed] libstdc++: Fix divide by zero in default template argument

2020-10-08 Thread Jonathan Wakely via Gcc-patches
On 08/10/20 00:45 +0100, Jonathan Wakely wrote: libstdc++-v3/ChangeLog: * include/bits/random.h (__detail::_Mod): Avoid divide by zero. * testsuite/26_numerics/random/linear_congruential_engine/operators/call.cc: New test. That didn't work properly in all cases. Here'

Re: [PATCH] libstdc++: Diagnose visitors with different return types [PR95904]

2020-10-08 Thread Jonathan Wakely via Gcc-patches
On 05/10/20 22:35 +0300, Ville Voutilainen via Libstdc++ wrote: On Mon, 5 Oct 2020 at 01:15, Ville Voutilainen wrote: The patch is borked, doesn't pass tests, fixing... Unborked, ok for trunk if full testsuite passes? Assuming it has passed by now, OK. Thanks.

[committed] libstdc++: Add assertions for preconditions in sampling distributions [PR 82584]

2020-10-08 Thread Jonathan Wakely via Gcc-patches
These three distributions all require 0 < S where S is the sum of the weights. When the sum is zero there's an undefined FP division by zero. Add assertions to help users diagnose the problem. libstdc++-v3/ChangeLog: PR libstdc++/82584 * include/bits/random.tcc (discrete_d

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

2020-10-08 Thread Jonathan Wakely via Gcc-patches
On 07/10/20 18:15 -0700, Thomas Rodgers wrote: @@ -500,6 +576,40 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 } #endif +#if __cplusplus > 201703L && _GLIBCXX_USE_CXX11_ABI + basic_istringstream(ios_base::openmode __mode, const allocator_type& __a) + : __istream_type(), _M_stringbuf(__mode |

Re: [PATCH] libstdc++: Make ranges::construct_at constexpr-friendly [PR95788]

2020-10-08 Thread Jonathan Wakely via Gcc-patches
On 07/10/20 12:10 -0400, Patrick Palka via Libstdc++ wrote: On Wed, 30 Sep 2020, Patrick Palka wrote: This rewrites ranges::construct_at in terms of std::construct_at so that we can piggy back on the compiler's existing support for recognizing placement new within std::construct_at during const

[committed] libstdc++: Fix unused variable warning

2020-10-09 Thread Jonathan Wakely via Gcc-patches
libstdc++-v3/ChangeLog: * testsuite/util/testsuite_performance.h (report_header): Remove unused variable. Tested powerpc64le-linux. Committed to trunk. commit afcbeb35e0b9fb0251d04362a1bd4031520ff7f8 Author: Jonathan Wakely Date: Fri Oct 9 11:52:56 2020 libstdc++: Fix unu

[committed] libstdc++: Pass CXXFLAGS to check_performance script

2020-10-09 Thread Jonathan Wakely via Gcc-patches
It looks like our check-performance target runs completely unoptimized, which is a bit silly. This exports the CXXFLAGS from the parent make process to the check_performance script. libstdc++-v3/ChangeLog: * scripts/check_performance: Use gnu++11 instead of gnu++0x. * testsuite/Ma

[committed] libstdc++: Add performance test for

2020-10-09 Thread Jonathan Wakely via Gcc-patches
This tests std::uniform_int_distribution with various parameters and engines. libstdc++-v3/ChangeLog: * testsuite/performance/26_numerics/random_dist.cc: New test. Tested powerpc64le-linux. Committed to trunk. commit f9919ba717dfaf6018b7e625bebc84a461477b52 Author: Jonathan Wakely Date

Re: [committed] libstdc++: Pass CXXFLAGS to check_performance script

2020-10-09 Thread Jonathan Wakely via Gcc-patches
On 09/10/20 14:02 +0100, Jonathan Wakely wrote: It looks like our check-performance target runs completely unoptimized, which is a bit silly. This exports the CXXFLAGS from the parent make process to the check_performance script. libstdc++-v3/ChangeLog: * scripts/check_performance: Use

Re: [PATCH, libstdc++] Improve the performance of std::uniform_int_distribution (fewer divisions)

2020-10-09 Thread Jonathan Wakely via Gcc-patches
On 06/10/20 15:55 -0400, Daniel Lemire via Libstdc++ wrote: The updated patch looks good to me. It is indeed cleaner to have a separate (static) function. It might be nice to add a comment to explain the _S_nd function maybe with a comment like "returns a random value in [0,__range) without any

[committed] libstdc++: Fix incorrect results in std::seed_seq::generate [PR 97311]

2020-10-09 Thread Jonathan Wakely via Gcc-patches
This ensures that intermediate results are done in uint32_t values, meeting the requirement for operations to be done modulo 2^32. If the target doesn't define __UINT32_TYPE__ then substitute uint32_t with a class type that uses uint_least32_t and masks the value to UINT32_MAX. I've also split th

[PATCH] libstdc++: Simplify metaprogramming in

2020-10-09 Thread Jonathan Wakely via Gcc-patches
This removes the __detail::_Shift class template, replacing it with a constexpr function template __pow2m1. Instead of using the _Mod class template to calculate a modulus just perform a bitwise AND with the result of __pow2m1. This works because the places that change all perform a modulus operati

Re: [PATCH] libstdc++: Simplify metaprogramming in

2020-10-10 Thread Jonathan Wakely via Gcc-patches
On 09/10/20 18:09 +0100, Jonathan Wakely wrote: This removes the __detail::_Shift class template, replacing it with a constexpr function template __pow2m1. Instead of using the _Mod class template to calculate a modulus just perform a bitwise AND with the result of __pow2m1. This works because th

Re: [PATCH] libstdc++: Diagnose visitors with different return types [PR95904]

2020-10-10 Thread Jonathan Wakely via Gcc-patches
On 05/10/20 22:35 +0300, Ville Voutilainen via Libstdc++ wrote: On Mon, 5 Oct 2020 at 01:15, Ville Voutilainen wrote: The patch is borked, doesn't pass tests, fixing... Unborked, ok for trunk if full testsuite passes? 2020-10-05 Ville Voutilainen PR libstdc++/95904 * include/std/va

[committed] libstdc++: Replace use of reserved name that clashes [PR 97362]

2020-10-10 Thread Jonathan Wakely via Gcc-patches
The name __deref is defined as a macro by Windows headers. This renames the __deref() helper function to __ref. It doesn't actually dereference an iterator. it just has the same type as the iterator's reference type. libstdc++-v3/ChangeLog: PR libstdc++/97362 * doc/html/manual/so

Re: [PATCH 3/4] libstdc++: Implement ranges::chunk_view from P2442R1

2022-09-13 Thread Jonathan Wakely via Gcc-patches
On Mon, 12 Sept 2022 at 17:48, Patrick Palka via Libstdc++ wrote: > > This also implements the LWG 3707, 3710 and 3712 changes to chunk_view. > + > + template > +requires input_range<_Vp> > + class chunk_view<_Vp>::_OuterIter > + { > +chunk_view* _M_parent; > + > +constexpr explic

Re: [PATCH 4/4] libstdc++: Implement ranges::slide_view from P2442R1

2022-09-13 Thread Jonathan Wakely via Gcc-patches
On Mon, 12 Sept 2022 at 17:48, Patrick Palka via Libstdc++ wrote: > > This also implements the LWG 3711 and 3712 changes to slide_view. OK, thanks.

Re: [PATCH v2] libstdc++: Add pretty printer for std::stringstreams

2022-09-14 Thread Jonathan Wakely via Gcc-patches
On Tue, 6 Sept 2022 at 22:25, Philipp Fent wrote: > > To display (o-,i-)stringstreams in the common case, we just print the > underlying stringbuf, without the many ios_base members. In the > unconventional case that the underlying streambuf was redirected, we > report the redirected target. > > S

[committed] libstdc++: Document LWG 1203 API change in manual

2022-09-14 Thread Jonathan Wakely via Gcc-patches
Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * doc/xml/manual/intro.xml: Document LWG 1203. * doc/html/*: Regenerate. --- libstdc++-v3/doc/html/manual/bugs.html | 3 +++ libstdc++-v3/doc/html/manual/debug_mode_using.html | 7 ++- libstdc++-v3/doc/html/manual

[committed] libstdc++: Add comment to 17_intro/names.cc test

2022-09-14 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * testsuite/17_intro/names.cc: Explain why poison pragma can't be used. --- libstdc++-v3/testsuite/17_intro/names.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libstdc++-v3/testsuite/17_intro/names

[committed] libstdc++: Add assertion to std::promise::set_exception (LWG 2276)

2022-09-14 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. -- >8 -- Without this assertion, the shared state is made ready, but contains neither a value nor an exception. Add an assertion to prevent users from accessing a value that was never initialized in the shared state. libstdc++-v3/ChangeLog: * includ

[committed] libstdc++: Add missing header to

2022-09-14 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. -- >8 -- This is needed for std::nothrow and the nothrow operator new overload, so should be included explicitly. libstdc++-v3/ChangeLog: * include/bits/stl_tempbuf.h: Include . --- libstdc++-v3/include/bits/stl_tempbuf.h | 1 + 1 file changed

[committed] libstdc++: Add TSan annotations to std::atomic>

2022-09-14 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. -- >8 -- This adds annotations to std::atomic> to enable TSan to understand the custom locking. Without this, TSan reports data races for accesses to the _M_ptr member, even though those are correctly synchronized using atomic operations on the tagged po

Re: [committed] libstdc++: Add TSan annotations to std::atomic>

2022-09-14 Thread Jonathan Wakely via Gcc-patches
On Wed, 14 Sept 2022 at 23:05, Jonathan Wakely via Libstdc++ wrote: > > Tested powerpc64le-linux, pushed to trunk. > > -- >8 -- > > This adds annotations to std::atomic> to enable TSan to > understand the custom locking. Without this, TSan reports data races for > accesses to the _M_ptr member, ev

Re: [committed] libstdc++: Add TSan annotations to std::atomic>

2022-09-14 Thread Jonathan Wakely via Gcc-patches
On Wed, 14 Sept 2022 at 23:25, Jonathan Wakely wrote: > > On Wed, 14 Sept 2022 at 23:05, Jonathan Wakely via Libstdc++ > wrote: > > > > Tested powerpc64le-linux, pushed to trunk. > > > > -- >8 -- > > > > This adds annotations to std::atomic> to enable TSan to > > understand the custom locking. Wit

Re: [PATCH][_GLIBCXX_INLINE_VERSION] Cleanup gnu-versioned-namespace.ver

2022-09-15 Thread Jonathan Wakely via Gcc-patches
On Wed, 14 Sept 2022 at 18:22, François Dumont via Libstdc++ wrote: > > libstdc++: [_GLIBCXX_INLINE_VERSION] Cleanup > gnu-versioned-namespace.ver > > Remove expressions for symbols in std::__detail::__8 namespace, > they are obsolete since > version namespace applies only at std::

Re: [PATCH][_GLIBCXX_INLINE_VERSION] Fix test dg-prune-output

2022-09-15 Thread Jonathan Wakely via Gcc-patches
On Wed, 14 Sept 2022 at 18:26, François Dumont via Libstdc++ wrote: > > libstdc++: [_GLIBCXX_INLINE_VERSION] Fix test dg-prune-output > > libstdc++-v3/ChangeLog: > > * > testsuite/20_util/is_complete_or_unbounded/memoization_neg.cc: Adapt Please put the "Adapt" on the next

Re: [PATCH] libstdc++: Implement ranges::chunk_by_view from P2443R1

2022-09-15 Thread Jonathan Wakely via Gcc-patches
On Wed, 14 Sept 2022 at 15:19, Patrick Palka via Libstdc++ wrote: > > Tested on x86_64-pc-linux-gnu, does this look OK for trunk? OK, thanks.

[committed] libstdc++: Tweak TSan annotations for std::atomic>

2022-09-15 Thread Jonathan Wakely via Gcc-patches
On Wed, 14 Sept 2022 at 23:28, Jonathan Wakely wrote: > > On Wed, 14 Sept 2022 at 23:25, Jonathan Wakely wrote: > > > > On Wed, 14 Sept 2022 at 23:05, Jonathan Wakely via Libstdc++ > > wrote: > > > @@ -377,6 +401,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > > > ~_Atomic_count() > > > {

[committed] libstdc++: Remove unnecessary header from

2022-09-15 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. -- >8 -- Previously included so that std::copy, std::fill etc. could be used by . But that includes it explicitly now, so that it can be compiled as a header unit. There's no need to include it in , where its purpose isn't obvious. libstdc++-v3/Change

[committed] libstdc++: Document new libstdc++.so symbol versions

2022-09-16 Thread Jonathan Wakely via Gcc-patches
Pushed to trunk. I'll backport the first line to gcc-12 too. -- >8 -- libstdc++-v3/ChangeLog: * doc/xml/manual/abi.xml: Document GLIBCXX_3.4.30 and GLIBCXX_3.4.31 versions. * doc/html/manual/abi.html: Regenerate. --- libstdc++-v3/doc/html/manual/abi.html | 2 +- libstdc+

[committed] libstdc++: Fix Doxygen commands

2022-09-16 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. -- >8 -- Remove the bogus -D__allocator_base=std::__new_allocator macro definition for Doxygen, because that's an alias template for C++11 and later, not a macro. Fix the @cond/@endcond pair that span the end of an @addtogroup group. Add another @endcond ins

[committed] libstdc++: Do not use nullptr in C++03-compatible code

2022-09-16 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. -- >8 -- This has to be valid as C++98/C++03. libstdc++-v3/ChangeLog: * include/debug/formatter.h [_GLIBCXX_DEBUG_BACKTRACE] (_Error_formatter): Use 0 as null pointer constant. --- libstdc++-v3/include/debug/formatter.h | 3 +-- 1 file chan

[committed] libstdc++: Remove __alloc_neq helper

2022-09-16 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. -- >8 -- This class template and partial specialization were added 15 years ago to optimize allocator equality comparisons in std::list. I think it's safe to assume that GCC is now capable of optimizing an inline operator!= that just returns false at least as

[committed] libstdc++: Fix tr1::variate_generator::engine_value_type

2022-09-16 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. -- >8 -- The tr1/5_numerical_facilities/random/variate_generator/37986.cc test fails for strict -std=c++98 mode because _Adaptor(const _Engine&) is ill-formed in C++98 when _Engine is a reference type. Rather than attempt to make the _Adaptor handle referenc

[committed] libstdc++: Fix compare_exchange_padding.cc test for std::atomic_ref

2022-09-16 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. The test was only failing for me with -m32 (and not -m64), so I didn't notice until now. That probably means we should make the test fail more reliably if the padding isn't being cleared. -- >8 -- This test was written assuming that std::atomic_ref clears it

[committed] libstdc++: Make more internal headers include their own dependencies

2022-09-16 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. -- >8 -- This adds required headers to a few internal headers that currently assume their deps will be included first. It's more robust to make them include their own dependencies, so that later refactoring or reuse of those headers in new contexts doesn't br

[committed] libstdc++: Move allocator-related helpers to

2022-09-16 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. -- >8 -- The __alloc_swap and __shrink_to_fit_aux helpers are not specific to std::allocator, so don't belong in . This also simplifies enabling for freestanding, as now we can just omit the whole of for freestanding. libstdc++-v3/ChangeLog: * inc

[committed] libstdc++: Add preprocessor conditions for freestanding [PR106953]

2022-09-16 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. This doesn't actually change anything for the freestanding build, so is effectively a no-op. _GLIBCXX_HOSTED is always defined to 1 when these headers are included. However, somebody else is working on installing the additional headers for freestanding, so thi

Re: [patch, avr] Fix PR target/99184: Wrong cast from double to 16-bit and 32-bit ints.

2022-09-19 Thread Jonathan Wakely via Gcc-patches
On Mon, 19 Sept 2022 at 10:06, Richard Biener wrote: > > On Mon, Sep 19, 2022 at 10:57 AM Georg Johann Lay wrote: > > > > > > > > Am 19.09.22 um 09:51 schrieb Richard Biener: > > > On Sun, Sep 18, 2022 at 7:40 PM Georg Johann Lay wrote: > > >> > > >> Hello, > > >> > > >> this patch fixed PR targe

[committed] libstdc++: Fix typo in for freestanding

2022-09-20 Thread Jonathan Wakely via Gcc-patches
I messed this up last week. Tested x86_64-linux, pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * include/c_global/cstdlib [!_GLIBCXX_HOSTED] (quick_exit): Fix missing space. --- libstdc++-v3/include/c_global/cstdlib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[committed] libstdc++: Add to ranges_base.h header

2022-09-21 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. -- >8 -- The header should be included explicitly to use std::initializer_list. With the upcoming changes to make available for freestanding this becomes an error, because is no longer provided by any of the other headers involved here. libstdc++-v3/C

[committed] libstdc++: Add _Exit to for freestanding

2022-09-21 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. -- >8 -- When I added std::_Exit to the freestanding declarations in I should also have added it to . libstdc++-v3/ChangeLog: * include/c_compatibility/stdlib.h [!_GLIBCXX_HOSTED]: Add using-declaration for _Exit. --- libstdc++-v3/inc

[committed] libstdc++: Remove trailing whitespace in documentation sources

2022-09-21 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * doc/xml/manual/documentation_hacking.xml: Remove trailing whitespace. * doc/xml/manual/policy_data_structures.xml: Likewise. --- .../doc/xml/manual/documentation_hacking.xml | 4 ++--

[committed] libstdc++: Qualify std::abort() in test

2022-09-21 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. -- >8 -- This test includes so should use std::abort not ::abort. libstdc++-v3/ChangeLog: * testsuite/18_support/uncaught_exception/14026.cc: Qualify call to std::abort. --- libstdc++-v3/testsuite/18_support/uncaught_exception/14026.c

[wwwdocs] Add C++23 library additions to GCC 13 release notes

2022-09-21 Thread Jonathan Wakely via Gcc-patches
Pushed to wwwdocs. --- htdocs/gcc-13/changes.html | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/htdocs/gcc-13/changes.html b/htdocs/gcc-13/changes.html index 390193ca..a7d88038 100644 --- a/htdocs/gcc-13/changes.html +++ b/htdocs/gcc-13/changes.html @@ -158

[wwwdocs] Add reference to pp_format to Coding Conventions

2022-09-21 Thread Jonathan Wakely via Gcc-patches
Finding the docs for the GCC-specific diagnostic formats isn't easy. This might help. OK for wwwdocs? --- htdocs/codingconventions.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/codingconventions.html b/htdocs/codingconventions.html index e4d30510..f1d1f165 100

[committed] libstdc++: Update synopsis test for C++11 and later

2022-09-21 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * testsuite/20_util/headers/memory/synopsis.cc: Add declarations from C++11 and later. --- .../20_util/headers/memory/synopsis.cc| 66 +-- 1 file changed, 59 insertions(+), 7 dele

[committed] libstdc++: Fix accidental duplicate test [PR91456]

2022-09-21 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. -- >8 -- It looks like I committed the testcase for std::function twice, instead of one for std::function and one for std::is_invocable_r. This replaces the is_invocable_r one with the example from the PR. libstdc++-v3/ChangeLog: PR libstdc++/91456

[committed] libstdc++: Remove main() from some compile-only tests

2022-09-21 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * testsuite/17_intro/headers/c++1998/all_attributes.cc: Remove unnecessary main function. * testsuite/17_intro/headers/c++2011/all_attributes.cc: Likewise. * testsuite/17_intro/hea

Re: [PATCH] Cleanup gdb printers.py

2022-09-21 Thread Jonathan Wakely via Gcc-patches
On Wed, 21 Sept 2022 at 20:57, François Dumont via Libstdc++ wrote: > > I stopped my research to find out if those types ever existed in 2001. > Clearly they do not exist now. > > libstdc++: Remove useless gdb printer registrations. > > libstdc++-v3/ChangeLog: > > * python/l

[committed 1/2] libstdc++: Rearrange tests for

2022-09-22 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- In C++03 std::bitset was in the Container clause, but since C++11 it has been in the Utilties clause. This moves the tests to the 20_util directory, where most people probably expect to find them. Also create 'access', 'observers', and 'io' subdirec

[committed 2/2] libstdc++: Implement constexpr std::bitset for C++23 (P2417R2)

2022-09-22 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- Also add _GLIBCXX_HOSTED checks to simplify making freestanding in the near future. libstdc++-v3/ChangeLog: * include/std/bitset (bitset): Add constexpr for C++23. Guard members using std::string with _GLIBCXX_HOSTED. * inc

[committed] libiberty: Refer to Bugzilla in README

2022-09-22 Thread Jonathan Wakely via Gcc-patches
Approved by Richi on IRC. Pushed to trunk. -- >8 -- We want bugs reported to Bugzilla, not emailed to gcc-bugs. libiberty/ChangeLog: * README: Replace gcc-bugs email address with Bugzilla URL. --- libiberty/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libi

Re: [committed 2/2] libstdc++: Implement constexpr std::bitset for C++23 (P2417R2)

2022-09-22 Thread Jonathan Wakely via Gcc-patches
On Thu, 22 Sept 2022 at 15:26, Jonathan Wakely via Libstdc++ wrote: > > Tested x86_64-linux. Pushed to trunk. > > -- >8 -- > > Also add _GLIBCXX_HOSTED checks to simplify making > freestanding in the near future. > > libstdc++-v3/ChangeLog: > > * include/std/bitset (bitset): Add constexpr

[committed] libstdc++: Optimize std::bitset::to_string

2022-09-23 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- This makes to_string approximately twice as fast at any optimization level. Instead of iterating through every bit, jump straight to the next bit that is set, by using _Find_first and _Find_next. libstdc++-v3/ChangeLog: * include/std/bitset

[committed] libstdc++: Enable constexpr std::bitset for debug mode

2022-09-23 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. As I said in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107015 I think we should just get rid of __debug::bitset, it is useless except for C++98, where it's ABI-incompatible with C++11 and later. -- >8 -- We already disable all debug mode checks for C++11

[committed] libstdc++: Micro-optimizaion for std::bitset stream extraction

2022-09-23 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. -- >8 -- Don't bother trying to copy any characters for bitset<0>. libstdc++-v3/ChangeLog: * include/std/bitset (operator>>): Do not copy for N==0. * testsuite/20_util/bitset/io/input.cc: Add comment. --- libstdc++-v3/include/std/bitset

Re: [PATCH] c++: Implement __is_{nothrow_,}convertible [PR106784]

2022-09-23 Thread Jonathan Wakely via Gcc-patches
On Thu, 22 Sept 2022 at 23:14, Jason Merrill wrote: > On 9/22/22 09:39, Marek Polacek wrote: > > This patch doesn't make libstdc++ use the new built-ins, but I had to > > rename a class otherwise its name would clash with the new built-in. > > Sigh, that's going to be a hassle when comparing compil

Re: [PATCH] c++: Implement __is_{nothrow_,}convertible [PR106784]

2022-09-23 Thread Jonathan Wakely via Gcc-patches
On Fri, 23 Sept 2022 at 15:34, Marek Polacek wrote: > > On Thu, Sep 22, 2022 at 06:14:44PM -0400, Jason Merrill wrote: > > On 9/22/22 09:39, Marek Polacek wrote: > > > To improve compile times, the C++ library could use compiler built-ins > > > rather than implementing std::is_convertible (and _not

Re: [PATCH] c++: Implement __is_{nothrow_,}convertible [PR106784]

2022-09-23 Thread Jonathan Wakely via Gcc-patches
On Fri, 23 Sept 2022 at 15:43, Jonathan Wakely wrote: > > On Fri, 23 Sept 2022 at 15:34, Marek Polacek wrote: > > > > On Thu, Sep 22, 2022 at 06:14:44PM -0400, Jason Merrill wrote: > > > On 9/22/22 09:39, Marek Polacek wrote: > > > > To improve compile times, the C++ library could use compiler buil

[committed] libstdc++: Fix std::is_nothrow_invocable_r for uncopyable prvalues [PR91456]

2022-09-23 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. -- >8 -- This is the last missing piece of PR 91456. This also removes the only use of the C++11 version of std::is_nothrow_invocable, which was just renamed to __is_nothrow_invocable_lib. We can remove that now. libstdc++-v3/ChangeLog: PR lib

[committed] libstdc++: Add test for type traits not having friend access

2022-09-23 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. -- >8 -- This ensures that the std::is_assignable and std::is_assignable_v traits are evaluated "in a context unrelated" to the argument types. libstdc++-v3/ChangeLog: * testsuite/20_util/is_assignable/requirements/access.cc: New test.

[committed] libstdc++: Simplify detection idiom using concepts

2022-09-24 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. -- >8 -- Add a simpler definition of std::__detected_or using concepts. This also replaces the __detector::value_t member which should have been using a reserved name. Use __detected_or in pointer_traits. libstdc++-v3/ChangeLog: * include/bit

[committed] libstdc++: Add #if around non-C++03 code in std::bitset [PR107037]

2022-09-26 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: PR libstdc++/107037 * include/std/bitset (_Base_bitset::_M_do_reset): Use preprocessor conditional around non-C++03 code. * testsuite/20_util/bitset/107037.cc: New test. --- libstdc++-v3/inclu

Re: [PATCH] c++: Instantiate less when evaluating __is_convertible

2022-09-26 Thread Jonathan Wakely via Gcc-patches
On Mon, 26 Sept 2022 at 16:23, Marek Polacek wrote: > > Jon reported that evaluating __is_convertible in this test leads to > instantiating char_traits::eq, which is invalid (because we > are trying to call a member function on a char) N.B. in the original code wasn't trying to do something dumb l

[committed] libstdc++: Update std::pointer_traits to match new LWG 3545 wording

2022-09-26 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. -- >8 -- It was pointed out in recent LWG 3545 discussion that having a constrained partial specialization of std::pointer_traits can cause ambiguities with program-defined specializations. For example, the addition to the testcase has: template require

[committed] libstdc++: Use new built-ins for std::is_convertible traits

2022-09-26 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * include/std/type_traits (is_convertible, is_convertible_v): Define using new built-in. (is_nothrow_convertible is_nothrow_convertible_v): Likewise. --- libstdc++-v3/include/std/type_traits | 27

[PATCH] c++: Make __is_{, nothrow_}convertible SFINAE on access [PR107049]

2022-09-27 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. OK for trunk? -- >8 -- The is_convertible built-ins should return false if the conversion fails an access check, not report an error. PR c++/107049 gcc/cp/ChangeLog: * method.cc (is_convertible_helper): Use access check sentinel. gcc/testsuite/ChangeL

[committed] libstdc++: Adjust deduction guides for static operator() [PR106651]

2022-09-27 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- Adjust the deduction guides for std::function and std::packaged_task to work with static call operators. This finishes the implementation of P1169R4 for C++23. libstdc++-v3/ChangeLog: PR c++/106651 * include/bits/std_function.h (__f

Re: [PATCH 2/2] c++: implement __remove_cv, __remove_reference and __remove_cvref

2022-09-27 Thread Jonathan Wakely via Gcc-patches
On Tue, 27 Sept 2022 at 20:50, Patrick Palka via Libstdc++ wrote: > libstdc++-v3/ChangeLog: > > * include/bits/unique_ptr.h (unique_ptr<_Tp[], _Dp>): Remove > __remove_cv and use __remove_cv_t instead. This part is OK. I added that __remove_cv in 2012, and could have replaced it w

Re: [PATCH][_GLIBCXX_DEBUG][_GLIBCXX_INLINE_VERSION] Add missing printers

2022-09-28 Thread Jonathan Wakely via Gcc-patches
On Thu, 22 Sept 2022 at 18:06, François Dumont via Libstdc++ wrote: > > Hi > > This patch fix failures when _GLIBCXX_INLINE_VERSION mode and running: > > make check-debug RUNTESTFLAGS=prettyprinters.exp > > libstdc++: [_GLIBCXX_INLINE_VERSION] Add gdb pretty print for > _GLIBCXX_DEBUG >

[committed] libstdc++: Make INVOKE refuse to create dangling references [PR70692]

2022-09-28 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. -- >8 -- This is the next part of the library changes from P2255R2. This makes INVOKE ill-formed if converting the INVOKE expression to R would bind a reference to a temporary object. The is_invocable_r trait is now false if the invocation would create

[committed] libstdc++: Disable volatile-qualified std::bind for C++20

2022-09-28 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. -- >8 -- LWG 2487 added a precondition to std::bind for C++17, making volatile-qualified uses undefined. We still support it, but with a deprecated warning. P1065R2 made it explicitly ill-formed for C++20, so we should no longer accept it as deprecated.

[committed] libstdc++: Guard use of new built-in with __has_builtin

2022-09-29 Thread Jonathan Wakely via Gcc-patches
This fixes libstdc++ for Clang and other non-GCC compilers. Tested powerpc64le-linux. Pushed to trunk as r13-2954-gdf7f2736509cfe. -- >8 -- I forgot that non-GCC compilers don't have this built-in yet. For Clang we could do something like the check below (as described in P2255), but for now I'm

[committed] libstdc++: Add missing include to

2022-09-30 Thread Jonathan Wakely via Gcc-patches
From: Arsen Arsenović Tested x86_64-linux. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * include/std/bitset: Include . --- libstdc++-v3/include/std/bitset | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libstdc++-v3/include/std/bitset b/libstdc++-v3/include/std/bitset inde

Re: [PATCH] testsuite: Windows paths use \ and not /

2022-09-30 Thread Jonathan Wakely via Gcc-patches
On Fri, 30 Sept 2022 at 17:04, Torbjörn SVENSSON wrote: > > libstdc++-v3/testsuite: > > * 20_util/bind/ref_neg.cc: Prune Windows paths too. Please CC the libstdc++ for libstdc++ patches. OK for trunk, thanks. > > Co-Authored-By: Yvan ROUX > Signed-off-by: Torbjörn SVENSSON > --- >

Re: [PATCH] testsuite: Windows paths use \ and not /

2022-09-30 Thread Jonathan Wakely via Gcc-patches
On Fri, 30 Sept 2022 at 17:26, Jonathan Wakely wrote: > > On Fri, 30 Sept 2022 at 17:04, Torbjörn SVENSSON > wrote: > > > > libstdc++-v3/testsuite: > > > > * 20_util/bind/ref_neg.cc: Prune Windows paths too. > > Please CC the libstdc++ for libstdc++ patches. > > OK for trunk, thanks. I'm

Re: [PATCH] testsuite: Windows paths use \ and not /

2022-09-30 Thread Jonathan Wakely via Gcc-patches
On Fri, 30 Sept 2022 at 18:55, Jakub Jelinek wrote: > > On Fri, Sep 30, 2022 at 06:47:07PM +0100, Jonathan Wakely via Gcc-patches > wrote: > > On Fri, 30 Sept 2022 at 17:26, Jonathan Wakely wrote: > > > > > > On Fri, 30 Sept 2022 at 17:04, Torbjörn SVENSSON >

Re: [PATCH] testsuite: Windows paths use \ and not /

2022-09-30 Thread Jonathan Wakely via Gcc-patches
On Fri, 30 Sept 2022 at 19:04, Jonathan Wakely wrote: > > On Fri, 30 Sept 2022 at 18:55, Jakub Jelinek wrote: > > > > On Fri, Sep 30, 2022 at 06:47:07PM +0100, Jonathan Wakely via Gcc-patches > > wrote: > > > On Fri, 30 Sept 2022 at 17:26, Jonathan Wakely wrote

Re: [PATCH] testsuite: Windows paths use \ and not /

2022-09-30 Thread Jonathan Wakely via Gcc-patches
On Fri, 30 Sept 2022 at 19:07, Jonathan Wakely wrote: > > On Fri, 30 Sept 2022 at 19:04, Jonathan Wakely wrote: > > > > On Fri, 30 Sept 2022 at 18:55, Jakub Jelinek wrote: > > > > > > On Fri, Sep 30, 2022 at 06:47:07PM +0100, Jonathan Wakely via Gcc-patches

Re: [PATCH 00/10] c-family,libstdc++: P1642 and related changes

2022-09-30 Thread Jonathan Wakely via Gcc-patches
On Fri, 30 Sept 2022 at 17:46, Arsen Arsenović via Libstdc++ wrote: > > Hi, > > This patchset: > - Implements the P1642 WG21 paper, with a fair few extensions, > - Fixes libstdc++' build system on systems --without-headers, > - Ports (a large chunk of) the libstdc++ testsuite to freestanding, and

Re: [RFC PATCH] c++, i386, arm, aarch64, libgcc: std::bfloat16_t and __bf16 arithmetic support

2022-09-30 Thread Jonathan Wakely via Gcc-patches
On Fri, 30 Sept 2022 at 19:38, Jakub Jelinek wrote: > > On Fri, Sep 30, 2022 at 06:21:04PM +, Joseph Myers wrote: > > On Fri, 30 Sep 2022, Jakub Jelinek via Gcc-patches wrote: > > > > > What isn't in the patch but I think we'll need to also change are some > > > minimal set of __builtin_*bf16

[committed] libstdc++: Optimize operator>> for std::bitset

2022-09-30 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- We can improve performance by using a char buffer instead of basic_string. The loop bound already means we can't overflow the buffer, and we don't need to keep writing a null character after every character written to the buffer. We could just use b

[committed] libstdc++: Remove non-standard public members in std::bitset

2022-09-30 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- This makes _M_copy_from_ptr, _M_copy_from_string and _M_copy_to_string private, and declares operator<< and operator>> as friends. Also remove the historical _M_copy_from_string and _M_copy_to_string overloads. Those were used before DR 396 was impl

[committed] libstdc++: Remove dependency from std::bitset::to_ulong() test

2022-09-30 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- There's no need to use a stringstream to test the to_ulong() member. This will allow the test to be used in freestanding mode. libstdc++-v3/ChangeLog: * testsuite/20_util/bitset/access/to_ulong.cc: Construct bitset from binary liter

Re: [PATCH] testsuite: Windows paths use \ and not /

2022-09-30 Thread Jonathan Wakely via Gcc-patches
gt; > > > > > > On Fri, Sep 30, 2022 at 06:47:07PM +0100, Jonathan Wakely via > > > > Gcc-patches wrote: > > > > > On Fri, 30 Sept 2022 at 17:26, Jonathan Wakely wrote: > > > > > > > > > > > &

Re: [PATCH] Fix gdb printers for std::string

2022-10-01 Thread Jonathan Wakely via Gcc-patches
On Sat, 1 Oct 2022 at 08:20, François Dumont via Libstdc++ wrote: > > I had forgotten to re-run tests after I removed the #define > _GLIBCXX_USE_CXX11_ABI 0. > > The comment was misleading, it could also impact output of std::list. > > I am also restoring the correct std::string alias for > std::_

Re: [PATCH] Fix gdb printers for std::string

2022-10-01 Thread Jonathan Wakely via Gcc-patches
On Sat, 1 Oct 2022 at 11:43, François Dumont wrote: > > On 01/10/22 12:06, Jonathan Wakely wrote: > > On Sat, 1 Oct 2022 at 08:20, François Dumont via Libstdc++ > > wrote: > >> I had forgotten to re-run tests after I removed the #define > >> _GLIBCXX_USE_CXX11_ABI 0. > >> > >> The comment was mis

Re: [PATCH] libstdc++: Use ///< for inline documentation

2022-10-03 Thread Jonathan Wakely via Gcc-patches
On Sat, 1 Oct 2022 at 19:43, Arsen Arsenović via Libstdc++ wrote: > > I accidentally that some variables were misdocumented when using > trailing comment for documentation. I ran a search with a relatively > simple regex[1] to look for any ///s following some code that did not > have a <, and cam

Re: [PATCH] libstdc++: Use ///< for inline documentation

2022-10-03 Thread Jonathan Wakely via Gcc-patches
On Mon, 3 Oct 2022 at 10:29, Arsen Arsenović wrote: > > On Monday, 3 October 2022 10:37:00 CEST Jonathan Wakely wrote: > > I did look into this after you pointed it out on IRC. Unless I fumbled > > my doxygen roll, the results are the same for /// and ///< so maybe > > at some point Doxygen started

<    3   4   5   6   7   8   9   10   11   12   >