Re: [PATCH 5/7] libstdc++: printf format string fix in testsuite

2023-02-15 Thread Jonathan Wakely via Gcc-patches
On Wed, 15 Feb 2023 at 20:52, Matthias Kretz via Libstdc++ wrote: > > > > Signed-off-by: Matthias Kretz > > libstdc++-v3/ChangeLog: > > * testsuite/experimental/simd/tests/bits/verify.h > (verify::verify): Use %zx for size_t in format string. > --- > libstdc++-v3/testsuite/experi

Re: [PATCH 3/7] libstdc++: Document timeout and timeout-factor of simd tests

2023-02-15 Thread Jonathan Wakely via Gcc-patches
On Wed, 15 Feb 2023 at 20:50, Matthias Kretz via Libstdc++ wrote: > > > > Signed-off-by: Matthias Kretz > > libstdc++-v3/ChangeLog: > > * testsuite/experimental/simd/README.md: Document the timeout > and timeout-factor directives. Minor typo fixed. OK for all relevant branches (

Re: [PATCH 7/7] libstdc++: Fix incorrect function call in -ffast-math optimization

2023-02-15 Thread Jonathan Wakely via Gcc-patches
On Wed, 15 Feb 2023 at 20:52, Matthias Kretz via Libstdc++ wrote: > > > > Signed-off-by: Matthias Kretz > > libstdc++-v3/ChangeLog: > > * include/experimental/bits/simd_math.h (__hypot): Bitcasting > between scalars requires the __bit_cast helper function instead > of simd

Re: [PATCH 1/7] libstdc++: Ensure __builtin_constant_p isn't lost on the way

2023-02-15 Thread Jonathan Wakely via Gcc-patches
On Wed, 15 Feb 2023 at 20:49, Matthias Kretz via Libstdc++ wrote: > > > > The more expensive code path should only be taken if it can be optimized > away. > > Signed-off-by: Matthias Kretz > > libstdc++-v3/ChangeLog: > > * include/experimental/bits/simd.h > (_SimdWrapper::_M_is_co

Re: [PATCH 6/7] libstdc++: Fix incorrect __builtin_is_constant_evaluated calls

2023-02-15 Thread Jonathan Wakely via Gcc-patches
On Wed, 15 Feb 2023 at 20:51, Matthias Kretz via Libstdc++ wrote: > > > > Signed-off-by: Matthias Kretz > > libstdc++-v3/ChangeLog: > > * include/experimental/bits/simd_x86.h > (_SimdImplX86::_S_not_equal_to, _SimdImplX86::_S_less) > (_SimdImplX86::_S_less_equal): Do not c

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

2023-02-16 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. These should be backported too. -- >8 -- The non-reserved names 'val' and 'dest' were being used in our headers but haven't been added to the 17_intro/names.cc test. That's because they are used by and respecitvely on glibc-based systems. libstdc++-v

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

2023-02-16 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * include/pstl/algorithm_fwd.h (__pattern_search_n) (__brick_unique_copy, __brick_adjacent_find) (__brick_generate_n, __pattern_generate_n): Use reserved names for parameters. * include

[committed] libstdc++: Add missing space after effective-target name in test

2023-02-16 Thread Jonathan Wakely via Gcc-patches
I only noticed this when sending the mail for he previous commit. Tested x86_64-linux and pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * testsuite/17_intro/names_pstl.cc: Add space after effective target name. --- libstdc++-v3/testsuite/17_intro/names_pstl.cc | 2 +- 1 fil

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

2023-02-16 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * include/ext/throw_allocator.h: Use reserved names for parameters. --- libstdc++-v3/include/ext/throw_allocator.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libstdc++-v3

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

2023-02-16 Thread Jonathan Wakely via Gcc-patches
On Thu, 16 Feb 2023 at 10:48, Jakub Jelinek wrote: > > On Thu, Feb 16, 2023 at 10:30:30AM +, Jonathan Wakely via Gcc-patches > wrote: > > Tested powerpc64le-linux. Pushed to trunk. > > > > These should be backported too. > > > > -- >8 -- > >

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

2023-02-16 Thread Jonathan Wakely via Gcc-patches
On Thu, 16 Feb 2023 at 11:45, Jakub Jelinek wrote: > > On Thu, Feb 16, 2023 at 11:47:54AM +0100, Jakub Jelinek via Gcc-patches wrote: > > On Thu, Feb 16, 2023 at 10:30:30AM +0000, Jonathan Wakely via Gcc-patches > > wrote: > > > Tested powerpc64le-linux. Pushed to trun

[committed] libstdc++: Make names_pstl.cc require et tbb_backend

2023-02-16 Thread Jonathan Wakely via Gcc-patches
Sigh ... this test still isn't right, because it fails on systems without a bug-fix for TBB 2020.3. We could just add -fpermissive to the test options, but let's just require tbb_backend (which isn't matched on systems with the buggy headers). Separately, I'm going to backport the TBB fix to Fedora

Re: [PATCH 2/7] libstdc++: Annotate most lambdas with always_inline

2023-02-16 Thread Jonathan Wakely via Gcc-patches
On Wed, 15 Feb 2023 at 20:50, Matthias Kretz via Libstdc++ wrote: > > > > All of the annotated lambdas are simply a necessary means for > implementing these functions and should never result in an actual > function call. Many of these lambdas would go away if C++ had better > language support for

Re: [PATCH 4/7] libstdc++: Use a PCH to speed up check-simd

2023-02-16 Thread Jonathan Wakely via Gcc-patches
On Wed, 15 Feb 2023 at 20:54, Matthias Kretz via Libstdc++ wrote: > > > Signed-off-by: Matthias Kretz > > libstdc++-v3/ChangeLog: > > * testsuite/experimental/simd/generate_makefile.sh: Generate and > pre-compile pch.h, which includes all headers that do not depend > on co

[committed] libstdc++: Enable CTAD for std::basic_format_args (LWG 3810)

2023-02-16 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. -- >8 -- This was just approved in Issaquah. libstdc++-v3/ChangeLog: * include/std/format (__format::_Arg_store): New class template. (basic_format_args): Remove nested type _Store and add deduction guide from _Arg_store.

[committed] libstdc++: Fix name of in comment

2023-02-16 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * include/experimental/optional: Fix header name in comment. --- libstdc++-v3/include/experimental/optional | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libstdc++-v3/include/experimental/o

[committed] libstdc++: Implement P2255R2 dangling checks for std::pair

2023-02-16 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. -- >8 -- This uses the new __reference_constructs_from_temporary built-in to identify when a std::pair constructor will bind a reference to a temporary that goes out of scope at the end of the constructor. For example, std::pair p(1, 2); will call the p

[committed] libstdc++: Implement (P0290)

2023-02-16 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- This was approved for the Concurrency TS v2 in Issaquah. Although the TS is based on C++20, this enables the new header for C++17 as well. This will make it available to more users, and I hope that will get more feedback on the feature. libstdc++-v

[committed] libstdc++: Replace non-ascii character in test

2023-02-16 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- This ensures the test will work with -fexec-charset=ascii. libstdc++-v3/ChangeLog: * testsuite/std/format/arguments/lwg3810.cc: Replace UTF-8 ellipsis character. --- libstdc++-v3/testsuite/std/format/arguments/lwg3810.cc | 2 +- 1

Re: [libstdc++] Use __gthread_join in jthread/95989

2023-02-17 Thread Jonathan Wakely via Gcc-patches
On Fri, 17 Feb 2023, 06:40 Alexandre Oliva via Libstdc++, < libstd...@gcc.gnu.org> wrote: > > Ref: https://gcc.gnu.org/pipermail/gcc-patches/2021-May/570617.html > > Bernd Edlinger reported that the 95989.cc > test fails without pthread_join at the end of main, Yes, but that doesn't mean we wan

Re: [libstdc++] [testsuite] intro/names.cc: undef func on vxw7krn

2023-02-17 Thread Jonathan Wakely via Gcc-patches
On Fri, 17 Feb 2023, 06:19 Alexandre Oliva via Libstdc++, < libstd...@gcc.gnu.org> wrote: > > The '#define func' added in 2021, to test that system headers don't > violate the user namespace, exposes such a bug in the vxworks sysLib.h > header, so add yet another such annotated workaround. > > Reg

Re: [PATCH] [libstdc++] xfail noreplace tests on vxworks

2023-02-17 Thread Jonathan Wakely via Gcc-patches
On Fri, 17 Feb 2023, 07:40 Alexandre Oliva via Libstdc++, < libstd...@gcc.gnu.org> wrote: > > vxworks ignores O_EXCL in open, so noreplace open succeeds when it is > expected to fail. xfail the tests. > > Regstrapped on x86_64-linux-gnu. > Tested on arm-vxworks7 (gcc-12) and arm-eabi (trunk). Ok

Re: [PATCH] [libstdc++] ensure mutex_pool survives _Safe_sequence_base

2023-02-17 Thread Jonathan Wakely via Gcc-patches
On Fri, 17 Feb 2023, 08:02 Alexandre Oliva via Libstdc++, < libstd...@gcc.gnu.org> wrote: > On Feb 17, 2023, Alexandre Oliva wrote: > > > On vxworks, after destroying the semaphore used to implement a mutex, > > __gthread_mutex_lock fails and __gnu_cxx::__mutex::lock calls > > __throw_concurrence

Re: [PATCH] Update baseline symbols for m68k-linux

2023-02-20 Thread Jonathan Wakely via Gcc-patches
On Sat, 18 Feb 2023 at 19:23, Andreas Schwab wrote: > > libstdc++-v3/: > * config/abi/post/m68k-linux-gnu/baseline_symbols.txt: Update. All the additions (and the one change) look correct, thanks.

Re: [PATCH] libstdc++: Add missing functions to [PR79700]

2023-02-20 Thread Jonathan Wakely via Gcc-patches
On Mon, 20 Feb 2023 at 11:23, Nathaniel Shead via Libstdc++ wrote: > > The comments on PR79700 mentioned that it was somewhat ambiguous whether > these functions were supposed to exist for C++11 or not. I chose to add > them there, since other resources (such as cppreference) seem to think > that

Re: [PATCH] libstdc++: Add missing functions to [PR79700]

2023-02-20 Thread Jonathan Wakely via Gcc-patches
On Mon, 20 Feb 2023 at 11:57, Nathaniel Shead wrote: > > On Mon, Feb 20, 2023 at 10:30 PM Jonathan Wakely wrote: > > > > On Mon, 20 Feb 2023 at 11:23, Nathaniel Shead via Libstdc++ > > wrote: > > > > > > The comments on PR79700 mentioned that it was somewhat ambiguous whether > > > these functio

Re: [PATCH] libstdc++: Update baseline symbols for riscv64-linux

2023-02-20 Thread Jonathan Wakely via Gcc-patches
On Mon, 20 Feb 2023 at 12:10, Andreas Schwab via Libstdc++ wrote: > > libstdc++-v3/ > * config/abi/post/riscv64-linux-gnu/baseline_symbols.txt: Update. Looks good, thanks.

Re: [committed] libstdc++: Fix uses of non-reserved names in simd header

2023-02-20 Thread Jonathan Wakely via Gcc-patches
On Mon, 20 Feb 2023 at 16:32, Matthias Kretz via Libstdc++ wrote: > > Tested x86_64-pc-linux. Pushed to trunk. OK for all relevant branches, thanks.

Re: [PATCH] tree: Add 3 argument fndecl_built_in_p

2023-02-22 Thread Jonathan Wakely via Gcc-patches
On Wed, 22 Feb 2023 at 11:49, Richard Biener wrote: > > On Wed, 22 Feb 2023, Jakub Jelinek wrote: > > > On Wed, Feb 22, 2023 at 09:52:06AM +, Richard Biener wrote: > > > > The following testcase ICEs because we still have some spots that > > > > treat BUILT_IN_UNREACHABLE specially but not BUI

Re: [PATCH] tree: Add 3 argument fndecl_built_in_p

2023-02-22 Thread Jonathan Wakely via Gcc-patches
On Wed, 22 Feb 2023 at 12:16, Jonathan Wakely wrote: > > On Wed, 22 Feb 2023 at 11:49, Richard Biener wrote: > > > > On Wed, 22 Feb 2023, Jakub Jelinek wrote: > > > > > On Wed, Feb 22, 2023 at 09:52:06AM +, Richard Biener wrote: > > > > > The following testcase ICEs because we still have some

Re: [PATCH 1/8] libstdc++: Simplify three helper functions into one

2023-02-23 Thread Jonathan Wakely via Gcc-patches
On Thu, 23 Feb 2023 at 08:53, Matthias Kretz via Libstdc++ wrote: > > > > Broadcast is a very common function. This should reduce compile-time > effort. OK for all branches. > Signed-off-by: Matthias Kretz > > libstdc++-v3/ChangeLog: > > PR libstdc++/108030 > * include/experimen

Re: [PATCH 2/8] libstdc++: Fix simd build failure on clang

2023-02-23 Thread Jonathan Wakely via Gcc-patches
On Thu, 23 Feb 2023 at 08:54, Matthias Kretz via Libstdc++ wrote: > > > > Clang does not support __attribute__ on lambdas. Therefore, only set > _GLIBCXX_SIMD_ALWAYS_INLINE_LAMBDA if __clang__ is not defined. OK for all branches. > Signed-off-by: Matthias Kretz > > libstdc++-v3/ChangeLog: > >

Re: [PATCH 4/8] libstdc++: Add missing constexpr on simd shift implementation

2023-02-23 Thread Jonathan Wakely via Gcc-patches
On Thu, 23 Feb 2023 at 08:55, Matthias Kretz via Libstdc++ wrote: > > > > Resolves -Wtautological-compare warnings about `if > (__builtin_is_constant_evaluated())` in the implementations of these > functions. The 'inline' is redundant now, because these are unconditionally constexpr which implies

Re: [PATCH 7/8] libstdc++: Fix -Wsign-compare issue

2023-02-23 Thread Jonathan Wakely via Gcc-patches
On Thu, 23 Feb 2023 at 08:51, Matthias Kretz via Libstdc++ wrote: > > OK for all branches. > Signed-off-by: Matthias Kretz > > libstdc++-v3/ChangeLog: > > * include/experimental/bits/simd_builtin.h (_S_set): Compare as > int. The actual range of these indexes is very small. > --

Re: [PATCH 8/8] libstdc++: Test that integral simd reductions are precise

2023-02-23 Thread Jonathan Wakely via Gcc-patches
On Thu, 23 Feb 2023 at 08:51, Matthias Kretz via Libstdc++ wrote: > OK for all branches. > > Signed-off-by: Matthias Kretz > > libstdc++-v3/ChangeLog: > > * testsuite/experimental/simd/tests/reductions.cc: Introduce > max_distance as the type-dependent max error. > --- > libstd

[PATCH] libstdc++: Add Doxygen comment for string::resize_and_overwite

2023-02-23 Thread Jonathan Wakely via Gcc-patches
Reviews of the resize_and_overwite description welcome. I've tried to strike a balance between pedantic precision and user-friendliness. -- >8 -- This is a complicated API that should be clearly documented. Also improve the comment on basic_ios::_M_setstate. libstdc++-v3/ChangeLog: * i

Re: [PATCH] libstdc++: Add Doxygen comment for string::resize_and_overwite

2023-02-23 Thread Jonathan Wakely via Gcc-patches
On Thu, 23 Feb 2023 at 17:42, Daniel Krügler wrote: > > Am Do., 23. Feb. 2023 um 18:38 Uhr schrieb Jonathan Wakely via > Libstdc++ : > > > > Reviews of the resize_and_overwite description welcome. I've tried to > > strike a balance between pedantic precision and user-friendliness. > > > > -- >8 --

Re: [PATCH] [PR77760] [libstdc++] encode __time_get_state in tm

2023-02-23 Thread Jonathan Wakely via Gcc-patches
On Thu, 23 Feb 2023 at 17:55, Alexandre Oliva wrote: > > On Feb 22, 2023, Alexandre Oliva wrote: > > >> Just curious, why doesn't the pmf hack work on arm-vxworks7? > > > At first, I thought we were running into this just because we have to > > define __clang__ because of some vxworks system head

Re: [PATCH] Avoid default-initializing auto_vec storage

2023-02-24 Thread Jonathan Wakely via Gcc-patches
On Fri, 24 Feb 2023 at 09:49, Jakub Jelinek wrote: > > Assuming a compiler handles the T m_vecdata[1]; as flexible array member > like (which we need because standard C++ doesn't have flexible array members > nor [0] arrays), I wonder if we instead of the m_auto followed by m_data > trick couldn't

Re: [PATCH] Avoid default-initializing auto_vec storage

2023-02-24 Thread Jonathan Wakely via Gcc-patches
On Fri, 24 Feb 2023 at 09:50, Jonathan Wakely wrote: > > On Fri, 24 Feb 2023 at 09:49, Jakub Jelinek wrote: > > > > Assuming a compiler handles the T m_vecdata[1]; as flexible array member > > like (which we need because standard C++ doesn't have flexible array members > > nor [0] arrays), I wonde

Re: [PATCH] Avoid default-initializing auto_vec storage

2023-02-24 Thread Jonathan Wakely via Gcc-patches
On Fri, 24 Feb 2023 at 10:24, Jakub Jelinek wrote: > > On Fri, Feb 24, 2023 at 11:02:07AM +0100, Jakub Jelinek via Gcc-patches wrote: > > Maybe this would work, vl_relative even could be vl_embed. > > Because vl_embed I believe is used in two spots, part of > > auto_vec where it is followed by m_d

Re: [PATCH 2/2] Avoid default-initializing auto_vec storage, fix vec

2023-02-24 Thread Jonathan Wakely via Gcc-patches
On Fri, 24 Feb 2023 at 11:52, Jakub Jelinek wrote: > > On Fri, Feb 24, 2023 at 12:44:44PM +0100, Richard Biener wrote: > > --- a/gcc/vec.h > > +++ b/gcc/vec.h > > @@ -586,8 +586,8 @@ public: > >unsigned allocated (void) const { return m_vecpfx.m_alloc; } > >unsigned length (void) const { r

[committed] libstdc++: Reorder dg-options before dg-do

2023-02-24 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- The options need to be set first, so that -std=gnu++20 is used when checking the c++20 effective target. libstdc++-v3/ChangeLog: * testsuite/std/format/arguments/lwg3810.cc: Move dg-options before dg-do. --- libstdc++-v3/testsuite/

[committed] libstdc++: Suppress warnings about use of deprecated std::aligned_storage

2023-02-24 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * include/ext/aligned_buffer.h (__aligned_buffer): Add diagnostic pragmas. --- libstdc++-v3/include/ext/aligned_buffer.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libstdc++-v3/include/ext/al

[committed 1/5] libstdc++: Optimize net::ip::address_v4::to_string()

2023-02-24 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- This is an order of magnitude faster than calling inet_ntop (and not only because we now avoid allocating a string that is one byte larger than the SSO buffer). libstdc++-v3/ChangeLog: * include/experimental/internet (address_v4::to_string)

[committed 5/5] libstdc++: Constrain net::executor constructors

2023-02-24 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- The TS says the arguments to these constructors shall meet the Executor requirements, so it's undefined if they don't. Constraining on a subset of those requirements won't affect valid cases, but prevents the majority of invalid cases from trying to

[committed 4/5] libstdc++: Make net::ip::basic_endpoint comparisons constexpr

2023-02-24 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * include/experimental/internet (basic_endpoint): Add missing constexpr to comparison operators. * testsuite/experimental/net/internet/endpoint/cons.cc: New test. --- libstdc++-v3/include/experimental

[committed 3/5] libstdc++: Fix members of net::ip::network_v4

2023-02-24 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * include/experimental/internet (network_v4::netmask()): Avoid undefined shift. (network_v4::broadcast()): Optimize and fix for targets with uint_least32_t wider than 32 bits. (network_

[committed 2/5] libstdc++: Fix conversion to/from net::ip::address_v4::bytes_type

2023-02-24 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- I messed up the endianness of the address_v4::bytes_type array, which should always be in network byte order. We can just use bit_cast to convert the _M_addr member to/from bytes_type. libstdc++-v3/ChangeLog: * include/experimental/internet

Re: [PATCH 3/8] libstdc++: More efficient masked inc-/decrement implementation

2023-02-24 Thread Jonathan Wakely via Gcc-patches
On Thu, 23 Feb 2023 at 08:55, Matthias Kretz via Libstdc++ wrote: > OK for trunk (and maybe backport later if you want to). > > Signed-off-by: Matthias Kretz > > libstdc++-v3/ChangeLog: > > PR libstdc++/108856 > * include/experimental/bits/simd_builtin.h > (_SimdImplBu

Re: [PATCH 5/8] libstdc++: Always-inline most of non-cmath fixed_size implementation

2023-02-24 Thread Jonathan Wakely via Gcc-patches
On Thu, 23 Feb 2023 at 08:54, Matthias Kretz via Libstdc++ wrote: > > > > For simd, the inlining behavior should be similar to builtin types. (No > operator on buitin types is ever translated into a function call.) > Therefore, always_inline is the right choice (i.e. inline on -O0 as > well). OK

Re: [PATCH 6/8] libstdc++: Fix formatting

2023-02-24 Thread Jonathan Wakely via Gcc-patches
On Thu, 23 Feb 2023 at 08:54, Matthias Kretz via Libstdc++ wrote: > > > > Whitespace changes only. Looks like there are a few remaining spaces that could be removed where you've joined lines, e.g. +{ return static_cast<_Up*>( __builtin_assume_aligned(__ptr, _S_alignment<_Tp, _Up>)); } and

[committed] libstdc++: Add Doxygen comment for string::resize_and_overwite

2023-02-27 Thread Jonathan Wakely via Gcc-patches
Here's what I committed, including the fix for the typo Daniel spotted. Pushed to trunk. -- >8 -- This is a complicated API that should be clearly documented. Also improve the comment on basic_ios::_M_setstate. libstdc++-v3/ChangeLog: * include/bits/basic_ios.h (basic_ios::_M_setstate

[committed] libstdc++: Fix uses_allocator_construction_args for pair [PR108952]

2023-02-28 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. -- >8 -- This implements LWG 3527 which fixes the handling of pair in std::uses_allocator_construction_args. libstdc++-v3/ChangeLog: PR libstdc++/108952 * include/bits/uses_allocator_args.h (uses_allocator_construction_args): Im

[committed] libstdc++: Add likely/unlikely attributes to implementation

2023-02-28 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. -- >8 -- For the common case of converting valid text this improves performance significantly. libstdc++-v3/ChangeLog: * src/c++11/codecvt.cc: Add [[likely]] and [[unlikely]] attributes. --- libstdc++-v3/src/c++11/codecvt.cc | 92 +

[committed] libstdc++: Do not use memmove for 1-element ranges [PR108846]

2023-02-28 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. -- >8 -- This avoids overwriting tail padding when algorithms like std::copy are used to write a single value through a pointer to a base subobject. The pointer arithmetic on a Base* is valid for N==1, but the copy/move operation needs to be done using

[wwwdocs] Document synchronized_value addition to libstdc++

2023-02-28 Thread Jonathan Wakely via Gcc-patches
Pushed to wwwdocs. --- htdocs/gcc-13/changes.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/gcc-13/changes.html b/htdocs/gcc-13/changes.html index a803f501..811d9bdf 100644 --- a/htdocs/gcc-13/changes.html +++ b/htdocs/gcc-13/changes.html @@ -324,6 +324,9 @@ a work-in-progres

[committed] libstdc++: Make std::chrono::current_zone() default to UTC

2023-03-01 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux and powerpc-aix. Pushed to trunk. -- >8 -- This is consistent with the behaviour of glibc, which assumes UTC when /etc/localtime and TZ do not identify a valid time zone. The fallback tzdb used when no valid tzdata exists always contains the UTC zone, so this change means we h

[committed] libstdc++: Fix typo in comment in bits/cow_string.h

2023-03-01 Thread Jonathan Wakely via Gcc-patches
Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * include/bits/cow_string.h: Fix typo in comment. --- libstdc++-v3/include/bits/cow_string.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/include/bits/cow_string.h b/libstdc++-v3/include/bits/cow_

Re: [PATCH] libstdc++: Limit allocations in _Rb_tree 2/2

2023-03-02 Thread Jonathan Wakely via Gcc-patches
On Thu, 2 Mar 2023 at 05:40, François Dumont via Libstdc++ wrote: > > Just forget about this patch, bad idea. > > The key_type might have additional data not used for the comparison. > This data would not be preserved if we were inserting the already stored > equivalent key instead of the user pro

[wwwdocs] Document allocator_traits::rebind_alloc assertion with GCC 13

2023-03-02 Thread Jonathan Wakely via Gcc-patches
Pushed to wwwdocs. --- htdocs/gcc-13/porting_to.html | 60 +++ 1 file changed, 60 insertions(+) diff --git a/htdocs/gcc-13/porting_to.html b/htdocs/gcc-13/porting_to.html index 5cbeefb6..f0ccef69 100644 --- a/htdocs/gcc-13/porting_to.html +++ b/htdocs/gcc-13/porti

Re: [libstdc++] Use __gthread_join in jthread/95989

2023-03-03 Thread Jonathan Wakely via Gcc-patches
On Fri, 3 Mar 2023 at 08:20, Alexandre Oliva via Libstdc++ < libstd...@gcc.gnu.org> wrote: > On Feb 17, 2023, Jonathan Wakely wrote: > > > The proper fix is to ensure the program has a non-weak reference to > > pthread_join without extra help (or use a recent glibc where it always > > works). > >

Re: [libstdc++] Use __gthread_join in jthread/95989

2023-03-03 Thread Jonathan Wakely via Gcc-patches
On Fri, 3 Mar 2023 at 09:33, Jonathan Wakely wrote: > > > On Fri, 3 Mar 2023 at 08:20, Alexandre Oliva via Libstdc++ < > libstd...@gcc.gnu.org> wrote: > >> On Feb 17, 2023, Jonathan Wakely wrote: >> >> > The proper fix is to ensure the program has a non-weak reference to >> > pthread_join withou

Re: [PATCH] libstdc++: Update Solaris baselines for GCC 13.0

2023-03-03 Thread Jonathan Wakely via Gcc-patches
On Tue, 21 Feb 2023 at 08:34, Rainer Orth wrote: > This patch updates the libstdc++ Solaris baselines for GCC 13. > > Tested on i386-pc-solaris2.11 and sparc-sun-solaris2.11 (Solaris 11.3 > and 11.4). > > Ok for trunk? > OK, thanks.

[PATCH] gcc: Adjust gdbhooks.py VecPrinter for vec layout changes

2023-03-03 Thread Jonathan Wakely via Gcc-patches
OK for trunk? gcc/ChangeLog: * gdbhooks.py (VecPrinter): Adjust for new vec layout. --- gcc/gdbhooks.py | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/gdbhooks.py b/gcc/gdbhooks.py index c9dea9bf828..78e6c97c30d 100644 --- a/gcc/gdbhooks.py +++ b/gcc/gdbhook

Re: [PATCH] gcc: Adjust gdbhooks.py VecPrinter for vec layout changes

2023-03-03 Thread Jonathan Wakely via Gcc-patches
On Fri, 3 Mar 2023 at 17:01, Jakub Jelinek wrote: > On Fri, Mar 03, 2023 at 05:45:59PM +0100, Jakub Jelinek via Gcc-patches > wrote: > > On Fri, Mar 03, 2023 at 04:44:39PM +0000, Jonathan Wakely via > Gcc-patches wrote: > > > OK for trunk? > > > > > &g

[PATCH] gcc: Fix gdbhooks.py VecPrinter for vec<> as well as vec<>* [PR109006]

2023-03-03 Thread Jonathan Wakely via Gcc-patches
This fixes Jakub's second testcase. The printer needs to do slightly different things depending on whether the gdbval obejct is a vec or a pointer to a vec. OK for trunk? -- >8 -- gcc/ChangeLog: PR middle-end/109006 * gdbhooks.py (VecPrinter): Handle vec as well as vec*. --- gc

Re: [PATCH] [libstdc++] [prettyprint] add local std::string use to more tests

2023-03-03 Thread Jonathan Wakely via Gcc-patches
On Fri, 3 Mar 2023 at 17:50, Alexandre Oliva via Libstdc++ < libstd...@gcc.gnu.org> wrote: > > We're getting regressions after ugprading to GDB 13 in a few of the > libstdc++ pretty-printing tests. It might seem like a GDB regression, > but that update has a new symbol reader, and Tom Tromey says

Re: [libstdc++] Use __gthread_join in jthread/95989

2023-03-03 Thread Jonathan Wakely via Gcc-patches
On Fri, 3 Mar 2023 at 17:47, Alexandre Oliva wrote: > On Mar 3, 2023, Jonathan Wakely wrote: > > > On Fri, 3 Mar 2023 at 09:33, Jonathan Wakely wrote: > >> Jakub previously suggested doing this for PR 61841, which was a similar > >> problem with pthread_create: > >> > >> __asm ("" : : "r" (&pt

Re: [libstdc++] Use __gthread_join in jthread/95989

2023-03-03 Thread Jonathan Wakely via Gcc-patches
On Fri, 3 Mar 2023 at 18:12, Jonathan Wakely wrote: > > > On Fri, 3 Mar 2023 at 17:47, Alexandre Oliva wrote: > >> On Mar 3, 2023, Jonathan Wakely wrote: >> >> > On Fri, 3 Mar 2023 at 09:33, Jonathan Wakely >> wrote: >> >> Jakub previously suggested doing this for PR 61841, which was a simila

Re: [PATCH] [RFC] RAII auto_mpfr and autp_mpz

2023-03-06 Thread Jonathan Wakely via Gcc-patches
On Mon, 6 Mar 2023 at 10:11, Richard Biener wrote: > > The following adds two RAII classes, one for mpz_t and one for mpfr_t > making object lifetime management easier. Both formerly require > explicit initialization with {mpz,mpfr}_init and release with > {mpz,mpfr}_clear. > > I've converted two

Re: [PATCH] [RFC] RAII auto_mpfr and autp_mpz

2023-03-06 Thread Jonathan Wakely via Gcc-patches
On Mon, 6 Mar 2023 at 11:01, Richard Biener wrote: > > On Mon, 6 Mar 2023, Jonathan Wakely wrote: > > > On Mon, 6 Mar 2023 at 10:11, Richard Biener wrote: > > > > > > The following adds two RAII classes, one for mpz_t and one for mpfr_t > > > making object lifetime management easier. Both former

Re: [PATCH] libstdc++: Limit allocations in _Rb_tree 1/2

2023-03-06 Thread Jonathan Wakely via Gcc-patches
On Wed, 22 Feb 2023 at 06:06, François Dumont via Libstdc++ wrote: > > Here is eventually a working proposal. > > Compared to the unordered container approach we need to find out what > type is going to be used to call the comparer. Otherwise we might > reinstantiate a temporary each time we call

Re: [PATCH 2/2] libstdc++: use copy_file_range

2023-03-07 Thread Jonathan Wakely via Gcc-patches
On 06/03/23 23:11 +0100, Jannik Glückert wrote: copy_file_range is a recent-ish syscall for copying files. It is similar to sendfile but allows filesystem-specific optimizations. Common are: Reflinks: BTRFS, XFS, ZFS (does not implement the syscall yet) Server-side copy: NFS, SMB If copy_file_ra

[committed] libstdc++: Fix comment typo in eh_personality.cc

2023-03-07 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * libsupc++/eh_personality.cc: Fix spelling in comment. --- libstdc++-v3/libsupc++/eh_personality.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libstdc++-v3/libsupc++/eh_personality.cc

[committed] libstdc++: Fix symver for __gnu_cxx11_ieee128::__try_use_facet [PR108882]

2023-03-07 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: PR libstdc++/108882 * config/abi/pre/gnu.ver (GLIBCXX_3.4.31): Adjust patterns to not match symbols in namespace std::__gnu_cxx11_ieee128. * config/os/gnu-linux/ldbl-ieee128-extra.ver: Add

Re: [PATCH] libstdc++: Some baseline_symbols.txt updates

2023-03-07 Thread Jonathan Wakely via Gcc-patches
On Mon, 20 Feb 2023 at 11:54, Jakub Jelinek via Libstdc++ wrote: > > Hi! Sorry for the delay. > This updates baseline_symbols.txt for the Fedora 39 arches. > Most of the added symbols are added to all 6 files, exceptions are > DF16_ rtti stuff (only added on x86 and aarch64 which supports those)

Re: [PATCH] [RFC] RAII auto_mpfr and autp_mpz

2023-03-07 Thread Jonathan Wakely via Gcc-patches
On Tue, 7 Mar 2023 at 19:15, Alexander Monakov wrote: > > Hi, > > On Mon, 6 Mar 2023, Richard Biener via Gcc-patches wrote: > > > --- a/gcc/realmpfr.h > > +++ b/gcc/realmpfr.h > > @@ -24,6 +24,26 @@ > > #include > > #include > > > > +class auto_mpfr > > +{ > > +public: > > + auto_mpfr () { mpf

Re: [PATCH] [RFC] RAII auto_mpfr and autp_mpz

2023-03-07 Thread Jonathan Wakely via Gcc-patches
On Tue, 7 Mar 2023 at 21:52, Alexander Monakov wrote: > > > On Tue, 7 Mar 2023, Jonathan Wakely wrote: > > > > Shouldn't this use the idiom suggested in ansidecl.h, i.e. > > > > > > private: > > > DISABLE_COPY_AND_ASSIGN (auto_mpfr); > > > > > > Why? A macro like that (or a base class like bo

Re: [PATCH] [RFC] RAII auto_mpfr and autp_mpz

2023-03-08 Thread Jonathan Wakely via Gcc-patches
On Wed, 8 Mar 2023 at 07:25, Richard Biener wrote: > > On Wed, 8 Mar 2023, Alexander Monakov wrote: > > > > > On Tue, 7 Mar 2023, Jonathan Wakely wrote: > > > > > > Shouldn't this use the idiom suggested in ansidecl.h, i.e. > > > > > > > > private: > > > > DISABLE_COPY_AND_ASSIGN (auto_mpfr);

[committed] libstdc++: Really fix symver for __gnu_cxx11_ieee128::__try_use_facet [PR108882]

2023-03-09 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: PR libstdc++/108882 * config/os/gnu-linux/ldbl-ieee128-extra.ver: Fix incorrect patterns. --- libstdc++-v3/config/os/gnu-linux/ldbl-ieee128-extra.ver | 4 ++-- 1 file changed, 2 insertions(+), 2

Re: [PATCH] libstdc++: Make views::single/iota/istream SFINAE-friendly [PR108362]

2023-03-09 Thread Jonathan Wakely via Gcc-patches
On Wed, 8 Mar 2023 at 14:36, Patrick Palka via Libstdc++ wrote: > > Tested on x86_64-pc-linux-gnu, does this look OK for trunk and perhaps 12? Yes, OK for trunk and 12. > > PR libstdc++/108362 > > libstdc++-v3/ChangeLog: > > * include/std/ranges (__detail::__can_single_view): New

Re: [PATCH] libstdc++: Implement LWG 3715 changes to view_interface::empty

2023-03-09 Thread Jonathan Wakely via Gcc-patches
On Wed, 8 Mar 2023 at 15:53, Patrick Palka via Libstdc++ wrote: > > Tested on x86_64-pc-linux-gnu, does this look OK for trunk? OK. I think this would make sense for 12 too. > > libstdc++-v3/ChangeLog: > > * include/bits/ranges_util.h (view_interface::empty): Add > preferred over

Re: [PATCH] libstdc++: Implement P2520R0 changes to move_iterator's iterator_concept

2023-03-09 Thread Jonathan Wakely via Gcc-patches
On Wed, 8 Mar 2023 at 16:47, Patrick Palka via Libstdc++ wrote: > > Tested on x86_64-pc-linux-gnu, does this look OK for trunk and perhaps > backports? Yes for all. > > libstdc++-v3/ChangeLog: > > * include/bits/stl_iterator.h (move_iterator::_S_iter_concept): > Define. >

Re: [PATCH] libstdc++: extraneous begin in cartesian_product_view::end [PR107572]

2023-03-09 Thread Jonathan Wakely via Gcc-patches
On Tue, 7 Mar 2023 at 20:49, Patrick Palka via Libstdc++ wrote: > > On Tue, 7 Mar 2023, Patrick Palka wrote: > > > ranges::begin() isn't guaranteed to be equality-preserving for > > non-forward ranges, so in cartesian_product_view::end we need to be > > careful about calling begin() on the first r

Re: [PATCH] libstdc++: Implement LWG 3820/3849 changes to cartesian_product_view

2023-03-09 Thread Jonathan Wakely via Gcc-patches
On Wed, 8 Mar 2023 at 15:13, Patrick Palka via Libstdc++ wrote: > > The LWG 3820 testcase revealed a bug in _M_advance, which this patch > also fixes. > > Tested on x86_64-pc-linux-gnu, does this look OK for trunk? OK > > libstdc++-v3/ChangeLog: > > * include/std/ranges > (cartes

[committed] libstdc++: Fix GDB Xmethod for std::shared_ptr::use_count() [PR109064]

2023-03-10 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux (GDB 13.1). Pushed to trunk for now, will do backports too. -- >8 -- libstdc++-v3/ChangeLog: PR libstdc++/109064 * python/libstdcxx/v6/xmethods.py (SharedPtrUseCountWorker): Remove self-recursion in __init__. Add missing _supports. * testsuite

[PATCH] gcc: Add deleted assignment operators to non-copyable types

2023-03-10 Thread Jonathan Wakely via Gcc-patches
Bootstrapped and regtested on powerpc64le-linux. OK for trunk? It's safe to do now rather than waiting for Stage 1, because if we were actually relying on copy-assigning these types it would have failed to compile with this change. So it has no functional change, but will help prevent any future

Re: [PATCH] update copyright year in libstdc++ manual

2023-03-12 Thread Jonathan Wakely via Gcc-patches
On Sun, 12 Mar 2023 at 18:46, Sandra Loosemore wrote: > > On 3/10/23 16:08, Jonny Grant wrote: > > docs: update copyright year in libstdc++ manual > > > > gcc/ChangeLog > > * libstdc++-v3/doc/xml/faq.xml: update copyright year in > > libstdc++ manual > > This change looks trivial

Re: [PATCH] libstdc++: Another baseline_symbols.txt update

2023-03-13 Thread Jonathan Wakely via Gcc-patches
On Mon, 13 Mar 2023 at 09:10, Jakub Jelinek wrote: > > Hi! > > On Tue, Mar 07, 2023 at 05:50:39PM +0000, Jonathan Wakely via Gcc-patches > wrote: > > I guess you want to regenerate the powerpc64 ones now. The others are > > all OK for trunk. > > So the following

[committed] libstdc++: Fix typo in comment

2023-03-13 Thread Jonathan Wakely via Gcc-patches
Pushed to trunk. -- >8 -- Reported by Jonny Grant. libstdc++-v3/ChangeLog: * include/bits/allocator.h: Fix typo in comment. --- libstdc++-v3/include/bits/allocator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libstdc++-v3/include/bits/allocator.h b/libstdc++-v

Re: [PATCH] update copyright year in libstdc++ manual

2023-03-13 Thread Jonathan Wakely via Gcc-patches
On Fri, 10 Mar 2023 at 23:09, Jonny Grant wrote: > > docs: update copyright year in libstdc++ manual Thanks for the patch. > gcc/ChangeLog > * libstdc++-v3/doc/xml/faq.xml: update copyright year in > libstdc++ manual This should be in the libstdc++-v3/ChangeLog file, not gcc/Cha

[committed] libstdc++: Refer to documentation hacking docs from Makefile

2023-03-13 Thread Jonathan Wakely via Gcc-patches
I've pushed this to trunk, so that it's easier to find the docs on maintaining the docs. -- >8 -- pick fdcba7a9088 libstdc++: Update copyright year in FAQ pick 6d8325681ef libstdc++: Regenerate HTML docs libstdc++-v3/ChangeLog: * doc/Makefile.am: Add comment referring to documentation.

[committed] libstdc++: Add assertions to std::mask_array operations [PR62196]

2023-03-14 Thread Jonathan Wakely via Gcc-patches
The PR has an example where we currently just read off the end of a heap buffer. We can check the preconditions and assert instead. Tested x86_64-linux. Pushed to trunk. -- >8 -- Add assertions to diagnose incorrect uses of valarray masks. The assignment operators of std::mask_array do not have

[committed] libstdc++: Fix preprocessor condition for inline variables

2023-03-14 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- Although variable templates are valid in C++14, inline ones aren't. These are only used in C++17 (or later) code, so they don't need to be defined for C++14. libstdc++-v3/ChangeLog: * include/bits/chrono.h (__is_duration_v, __is_time_point_

[committed] libstdc++: Add comment about symver linker scripts to makefile

2023-03-14 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * src/Makefile.am: Add comment about linker script fragments. * src/Makefile.in: Regenerate. --- libstdc++-v3/src/Makefile.am | 1 + libstdc++-v3/src/Makefile.in | 1 + 2 files changed, 2 insertions(+) diff

Re: [committed] libstdc++: Fix preprocessor condition for inline variables

2023-03-14 Thread Jonathan Wakely via Gcc-patches
On Tue, 14 Mar 2023 at 10:51, Daniel Krügler wrote: > Apologies for the late response: > > I only just committed the change, so it's not delayed :-) > What about changing the test to check for __cpp_inline_variables or > combining it with __cpp_variable_templates instead? > > We could do that,

[committed] libstdc++: Fix pretty printers and add tests

2023-05-09 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. I'll backport to gcc-13 too. -- >8-- This fixes a couple of errors in the printers for chrono types, and adds tests to ensure they keep working. libstdc++-v3/ChangeLog: * python/libstdcxx/v6/printers.py (StdChronoDurationPrinter): Prin

Re: [PATCH] _Hashtable implementation cleanup

2023-05-10 Thread Jonathan Wakely via Gcc-patches
On Wed, 10 May 2023 at 05:59, François Dumont via Libstdc++ < libstd...@gcc.gnu.org> wrote: > Hi > > Rather than providing a series of patches for _Hashtable I prefer to > submit them one by one. It will maximize the chances to have some of > them in gcc 14. > > I'm starting with this simple patch

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

2023-05-10 Thread Jonathan Wakely via Gcc-patches
This patch would avoid TSan false positives when using timed waiting functions on mutexes and condvars, but as noted below, it changes the semantics. I'm not sure whether we want this workaround in place until tsan gets fixed. On one hand, there's no guarantee that those functions use the right c

<    1   2   3   4   5   6   7   8   9   10   >