[committed] libstdc++: Implement std::out_ptr and std::inout_ptr for C++23 [PR111667]

2023-11-16 Thread Jonathan Wakely
Tested x86_64-linux. Pushe to trunk. -- >8 -- This implements that changes from P1132R8, including optimized paths for std::shared_ptr and std::unique_ptr. For std::shared_ptr we pre-allocate a new control block in the std::out_ptr_t constructor so that the destructor is non-throwing. This

[committed 1/2] libstdc++: Test for feature test macros more accurately

2023-11-16 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. -- >8 -- Tests which check for feature test macros should use the no_pch option, so that we're really testing for the definition being in the intended header, and not just testing that it's present in (which includes all the standard headers and so defines

[committed 2/2] libstdc++: Only declare feature test macros in standard headers

2023-11-16 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. -- >8 -- This change moves the definitions of feature test macros (or strictly speaking, the requests for to define them) so that only standard headers define them. For example, will no longer define macros related to std::shared_ptr, only and will

[committed 2/2] libstdc++: Use 202100L as feature test check for C++23

2023-11-16 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. -- >8 -- I noticed that our C++23 features were not being defined when using Clang 16 with -std=c++2b, because it only defines __cplusplus=202101L but uses 202302L since my r14-3252-g0c316669b092fb change. This changes to use 202100 instead of the final

[committed 1/2] libstdc++: Adjust feature test in and

2023-11-16 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. -- >8 -- We don't need any library concepts to define the constraints for rvalue stream overloads, only compiler support. So change the test from using __cpp_lib_concepts to __cpp_concepts >= 201907L. libstdc++-v3/ChangeLog: * include/std/istream

[committed] libstdc++: Fix std::deque::operator[] Xmethod [PR112491]

2023-11-15 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. Backports to follow. -- >8 -- The Xmethod for std::deque::operator[] has the same bug that I recently fixed for the std::deque::size() Xmethod. The first node might have unused capacity at the start, which needs to be accounted for when indexing into the

[committed] libstdc++: std::stacktrace tweaks

2023-11-15 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. Backports to follow. The new hash.cc test was failing for armv8l-unknown-linux-gnueabihf according to Linaro CI. This should fix it (but there are still other failures for std::stacktrace, so I opened PR 112541). -- >8 -- Fix a typo in a string literal and

Re: [PATCH] libstdc++: Improve operator-(weekday x, weekday y).

2023-11-14 Thread Jonathan Wakely
On Tue, 14 Nov 2023 at 00:27, Cassio Neri wrote: > > The current implementation calls __detail::__modulo which is relatively > expensive. > > A better implementation is possible if we assume that x.ok() && y.ok() == > true, > so that n = x.c_encoding() - y.c_encoding() is in [-6, 6]. In this

Re: [PATCH] Fix UB in weekday::weekday(sys_days) and add test.

2023-11-14 Thread Jonathan Wakely
On Sun, 12 Nov 2023 at 01:34, Cassio Neri wrote: > > The following has undefined behaviour (signed overflow) [1]: > weekday max{sys_days{days{numeric_limits::max()}}}; > > The issue is in this line when __n is very large and __n + 4 overflows: > return weekday(__n >= -4 ? (__n + 4) % 7 :

Re: [PATCH v3] libstdc++: Simplify year::is_leap().

2023-11-14 Thread Jonathan Wakely
On Sat, 11 Nov 2023 at 23:00, Cassio Neri wrote: > > The current implementation returns > (_M_y & (__is_multiple_of_100 ? 15 : 3)) == 0; > where __is_multiple_of_100 is calculated using an obfuscated algorithm which > saves one ror instruction when compared to _M_y % 100 == 0 [1]. > > In leap

Re: [PATCH v4] libstdc++: Remove unnecessary "& 1" from year_month_day_last::day().

2023-11-14 Thread Jonathan Wakely
On Sat, 11 Nov 2023 at 16:46, Cassio Neri wrote: > > When year_month_day_last::day() was implemented, Dr. Matthias Kretz realised > that the operation "& 1" wasn't necessary but we did not patch it at that > time. This patch removes the unnecessary operation. > > libstdc++-v3/ChangeLog: > >

[committed] libstdc++: Fix uses of signed types with functions

2023-11-14 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. Backports needed too. -- >8 -- In we pass the int __base parameter to our internal versions of functions, __bit_width and __countr_zero. Those functions are only defined for unsigned types, so we need to convert the base to unsigned. The base must be in

[committed] libstdc++: Fix std::hash [PR112348]

2023-11-14 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. Backports needed too. -- >8 -- libstdc++-v3/ChangeLog: PR libstdc++/112348 * include/std/stacktrace (hash>): Fix type of hash functio nfor entries. * testsuite/19_diagnostics/stacktrace/hash.cc: New test. ---

[committed] libstdc++: Fix std::deque::size() Xmethod [PR112491]

2023-11-14 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. Backports to follow. -- >8 -- The Xmethod for std::deque::size() assumed that the first element would be at the start of the first node. That's only true if elements are only added at the back. If an element is inserted at the front, or removed from the

[committed] libstdc++: Add dg-timeout-factor to remaining IO tests

2023-11-13 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. -- >8 -- I meant to add these changes as part of r14-4959-g7d06b29f814580 but missed these files out. libstdc++-v3/ChangeLog: * testsuite/std/time/clock/file/io.cc: Double timeout using dg-timeout-factor. *

[committed] libstdc++: Micro-optimization for std::optional [PR112480]

2023-11-13 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. -- >8 -- This small change removes a branch when clearing a std::optional for types with no-op destructors. For types where the destructor can be optimized away (e.g. because it's trivial, or empty and can be inlined) the _M_destroy() function does nothing

[PATCH] c++: Link extended FP conversion pedwarns to -Wnarrowing [PR111842]

2023-11-13 Thread Jonathan Wakely
Tested x86_64-linux. Does this make sense for trunk? These forbidden conversions are defined as narrowing conversions, and we already use -Wnarrowing to control other "ill-formed, but only warn by default" diagnostics required by the standard. -- >8 -- Several users have been confused by the

Re: [committed] libstdc++: Reformat Python code

2023-11-13 Thread Jonathan Wakely
On Mon, 13 Nov 2023 at 14:41, Romain GEISSLER wrote: > > > Le 28 sept. 2023 à 22:21, Jonathan Wakely a écrit : > > > > Tested x86_64-linux (GDB 13.2, Python 3.11). Pushed to trunk. > > > > -- >8 -- > > > > Some of these changes were suggest

[committed] libstdc++: Do not use assume attribute for Clang [PR112467]

2023-11-10 Thread Jonathan Wakely
Tested x86_64-linux (-m32 and -m64). Pushed to trunk. -- >8 -- Clang has an 'assume' attribute, but it's a function attribute not a statement attribute. The recently-added use of the statement form causes an error with Clang. libstdc++-v3/ChangeLog: PR libstdc++/112467 *

[committed] libstdc++: Simplify std::string_view comparisons (LWG 3950)

2023-11-10 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. -- >8 -- LWG 3950 points out that the comparisons of std::basic_string_view can be simplified to just a single overload of operator== and a single overload of operator<=>. Those overloads work fine for homogeneous comparisons of two string view objects.

[committed] libstdc++: Add static_assert to std::integer_sequence [PR112473]

2023-11-10 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. -- >8 -- C++20 allows class types as non-type template parameters, but std::integer_sequence explicitly disallows them. Enforce that. libstdc++-v3/ChangeLog: PR libstdc++/112473 * include/bits/utility.h (integer_sequence): Add

[committed] libstdc++: Fix broken tests for

2023-11-10 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. -- >8 -- When I added these tests I gave them .h file extensions, so they've never been run. They need to use the no_pch option, so that they only test the header and don't get via . libstdc++-v3/ChangeLog: *

[committed] libstdc++: Deprecate std::atomic_xxx overloads for std::shared_ptr

2023-11-10 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. -- >8 -- These overloads are deprecated in C++20 (and likely to be removed for C++26). The std::atomic> specialization should be preferred in new code. libstdc++-v3/ChangeLog: * include/bits/shared_ptr_atomic.h (atomic_is_lock_free)

[committed] libstdc++: Fix test that fails with -ffreestanding

2023-11-10 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. -- >8 -- The -ffreestanding option disables Debug Mode, forcibly #undef'ing _GLIBCXX_DEBUG. This means that the dangling checks in std::pair are disabled for -ffreestanding in C++17 and earlier, because they depend on _GLIBCXX_DEBUG. Adjust the target

[committed] libstdc++: Add [[nodiscard]] to std::span members

2023-11-10 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. -- >8 -- All std::span member functions are pure functions that have no side effects. They are only useful for their return value, so they should all warn if that value is not used. libstdc++-v3/ChangeLog: * include/std/span (span, as_bytes,

[committed] libstdc++: Add [[nodiscard]] to lock types

2023-11-10 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. -- >8 -- Adding this attribute means users get a warning when they accidentally create a temporary lock instead of creating an automatic variable with block scope. For std::lock_guard both constructors have side effects (they both take a mutex and so both

[committed] libstdc++: Remove handling for underscore-prefixed libm functions [PR111638]

2023-11-10 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. -- >8 -- The checks in linkage.m4 try to support math functions prefixed with underscores, like _acosf and _isinf. However, that doesn't work because they're renamed to the standard names using a macro, but then undefines that macro again. This simply

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

2023-11-10 Thread Jonathan Wakely
the patch to trunk - thanks for the work on it! On Wed, 17 May 2023 at 11:07, Jonathan Wakely wrote: > > > > On Wed, 17 May 2023 at 10:38, Nathaniel Shead > wrote: >> >> On Wed, May 17, 2023 at 10:05:59AM +0100, Jonathan Wakely wrote: >> > On Wed, 17 May

Re: [PATCH 1/2] libstdc++: declare std::allocator in !HOSTED as an extension

2023-11-09 Thread Jonathan Wakely
On Thu, 9 Nov 2023 at 19:32, Arsen Arsenović wrote: > > This allows us to add features to freestanding which allow specifying > non-default allocators (generators, collections, ...) without having to > modify them. > > libstdc++-v3/ChangeLog: > > * include/bits/memoryfwd.h: Remove HOSTED

Re: [PATCH 2/2] libstdc++: mark 20_util/scoped_allocator/noexcept.cc R-E-T hosted

2023-11-09 Thread Jonathan Wakely
On Thu, 9 Nov 2023 at 19:32, Arsen Arsenović wrote: > > libstdc++-v3/ChangeLog: > > * testsuite/20_util/scoped_allocator/noexcept.cc: Mark as > requiring hosted. OK for trunk, thanks. The test has been backported, but we don't have the hosted et there so this isn't needed on the

Re: [PATCH] libstdc++: Fix forwarding in __take/drop_of_repeat_view [PR112453]

2023-11-09 Thread Jonathan Wakely
On Thu, 9 Nov 2023 at 16:01, Patrick Palka wrote: > > Tested on x86_64-pc-linux-gnu, does this look OK for trunk/13? (The > && overloads are also missing on earlier branches, but I don't think > it makes a difference there since all uses of that operator* are on > lvalues before this fix.) OK

Re: [PATCH] libsupc++: try cxa_thread_atexit_impl at runtime

2023-11-09 Thread Jonathan Wakely
On Thu, 9 Nov 2023 at 01:56, Alexandre Oliva wrote: > > > g++.dg/tls/thread_local-order2.C fails when the toolchain is built for > a platform that lacks __cxa_thread_atexit_impl, even if the program is > built and run using that toolchain on a (later) platform that offers >

Re: [PATCH][_Hashtable] Use RAII to restore Rehash state

2023-11-09 Thread Jonathan Wakely
On Thu, 26 Oct 2023 at 21:52, François Dumont wrote: > > > On 26/10/2023 12:43, Jonathan Wakely wrote: > > On 26/10/23 07:18 +0200, François Dumont wrote: > >> libstdc++: [_Hashtable] Use RAII type to manage rehash functor state > >> > >> Repla

Re: [PATCH v2] libstdc++: optimize bit iterators assuming normalization [PR110807]

2023-11-08 Thread Jonathan Wakely
On Thu, 9 Nov 2023, 01:17 Alexandre Oliva, wrote: > On Nov 8, 2023, Jonathan Wakely wrote: > > > A single underscore prefix on __GLIBCXX_BUILTIN_ASSUME and > > __GLIBCXX_DISABLE_ASSUMPTIONS please. > > That's entirely

Re: [PATCH][_Hahstable] Use RAII to guard node pointer while constructing

2023-11-08 Thread Jonathan Wakely
On Wed, 8 Nov 2023 at 20:00, François Dumont wrote: > > Another proposal to use RAII rather than __try/__catch block. > > libstdc++: [_Hashtable] Use RAII type to guard node while constructing value > > libstdc++-v3/ChangeLog: > > * include/bits/hashtable_policy.h > (struct

Re: [PATCH] libstdc++: optimize bit iterators assuming normalization [PR110807]

2023-11-08 Thread Jonathan Wakely
On 08/11/23 13:10 -0300, Alexandre Oliva wrote: The representation of bit iterators, using a pointer into an array of words, and an unsigned bit offset into that word, makes for some optimization challenges: because the compiler doesn't know that the offset is always in a certain narrow range,

Re: testsuite: introduce hostedlib effective target

2023-11-08 Thread Jonathan Wakely
On Wed, 8 Nov 2023 at 15:48, Jonathan Wakely wrote: > > On Wed, 8 Nov 2023 at 15:30, Alexandre Oliva wrote: > > > > On Nov 7, 2023, Jonathan Wakely wrote: > > > > > An alternative approach for the g++ testsuite would be to provide a > > > set of dummy

Re: testsuite: introduce hostedlib effective target

2023-11-08 Thread Jonathan Wakely
On Wed, 8 Nov 2023 at 15:30, Alexandre Oliva wrote: > > On Nov 7, 2023, Jonathan Wakely wrote: > > > An alternative approach for the g++ testsuite would be to provide a > > set of dummy headers for the non-freestanding ones, so that all the > > hosted-only headers ar

Re: [PATCH][_Hashtable] Add missing destructor call

2023-11-08 Thread Jonathan Wakely
On Wed, 8 Nov 2023 at 05:39, François Dumont wrote: > > > On 07/11/2023 00:28, Jonathan Wakely wrote: > > On Mon, 6 Nov 2023 at 21:39, François Dumont wrote: > >> Noticed looking for other occasion to replace __try/__catch with RAII > >> helper. > >&

Re: [PATCH] libstdc++/112351 - deal with __gthread_once failure during locale init

2023-11-07 Thread Jonathan Wakely
On Mon, 6 Nov 2023 at 12:52, Richard Biener wrote: > > On Mon, 6 Nov 2023, Jonathan Wakely wrote: > > > On Mon, 6 Nov 2023 at 11:52, Richard Biener wrote: > > > > > > The following makes the C++98 locale init path follow the way the > > > C++11

Re: testsuite: introduce hostedlib effective target

2023-11-07 Thread Jonathan Wakely
On Tue, 7 Nov 2023 at 10:24, Jonathan Wakely wrote: > > On Tue, 7 Nov 2023 at 10:18, Jonathan Wakely wrote: > > > > On Tue, 7 Nov 2023 at 10:04, Alexandre Oliva wrote: > > > > > > [adding libstdc++@] > > > > > > On Nov 5, 2023, Mi

Re: testsuite: introduce hostedlib effective target

2023-11-07 Thread Jonathan Wakely
On Tue, 7 Nov 2023 at 10:18, Jonathan Wakely wrote: > > On Tue, 7 Nov 2023 at 10:04, Alexandre Oliva wrote: > > > > [adding libstdc++@] > > > > On Nov 5, 2023, Mike Stump wrote: > > > > > Ick. > > > > Indeed ;-) > > > >

Re: testsuite: introduce hostedlib effective target

2023-11-07 Thread Jonathan Wakely
On Tue, 7 Nov 2023 at 10:04, Alexandre Oliva wrote: > > [adding libstdc++@] > > On Nov 5, 2023, Mike Stump wrote: > > > Ick. > > Indeed ;-) > > > I wish there were fewer changed lines and not 1 per test > > case. It feels like we've painted ourselves into a corner. > > The libstdc++ testsuite

Re: [PATCH][_Hashtable] Add missing destructor call

2023-11-06 Thread Jonathan Wakely
On Mon, 6 Nov 2023 at 21:39, François Dumont wrote: > > Noticed looking for other occasion to replace __try/__catch with RAII > helper. > > libstdc++: [_Hashtable] Add missing node destructor call > > libstdc++-v3/ChangeLog: > > * include/bits/hashtable_policy.h >

Re: [PATCH][_Hashtable] Add missing destructor call

2023-11-06 Thread Jonathan Wakely
On Mon, 6 Nov 2023 at 21:39, François Dumont wrote: > > Noticed looking for other occasion to replace __try/__catch with RAII > helper. > > libstdc++: [_Hashtable] Add missing node destructor call > > libstdc++-v3/ChangeLog: > > * include/bits/hashtable_policy.h >

Re: [PATCH] libstdc++/112351 - deal with __gthread_once failure during locale init

2023-11-06 Thread Jonathan Wakely
On Mon, 6 Nov 2023 at 12:16, Jakub Jelinek wrote: > > On Mon, Nov 06, 2023 at 11:52:08AM +, Richard Biener wrote: > > The following makes the C++98 locale init path follow the way the > > C++11 performs initialization. This way we deal with pthread_once > > failing, falling back to

Re: [PATCH] libstdc++/112351 - deal with __gthread_once failure during locale init

2023-11-06 Thread Jonathan Wakely
On Mon, 6 Nov 2023 at 11:52, Richard Biener wrote: > > The following makes the C++98 locale init path follow the way the > C++11 performs initialization. This way we deal with pthread_once > failing, falling back to non-threadsafe initialization which, given we > initialize from the library,

Re: [PATCH] libstdc++/complex: Remove implicit type casts in complex

2023-11-06 Thread Jonathan Wakely
ded in GCC. Please, find my > comments below. Hi, Thanks for the updated patch, test etc. Yes, I think this still makes sense and I'll take care of committing it. > > On Thu, May 11, 2023 at 3:57 PM Jonathan Wakely wrote: >> >> >> >> On Mon, 27 Mar

Re: [PATCH] libstdc++: Improve static assert messages for monadic operations

2023-11-06 Thread Jonathan Wakely
On Thu, 2 Nov 2023 at 14:55, Jonathan Wakely wrote: > > Any objections or suggestions for better wording? > > Tested x86_64-linux. Pushed to trunk. > > -- >8 -- > > The monadic operations for std::optional and std::expected make use of > internal helper traits _

Re: Remove redundant partial specialization in _Nth_type

2023-11-04 Thread Jonathan Wakely
On Sat, 28 Oct 2023 at 14:15, Feng Jisen wrote: > > This patch remove a redundant partial specialization in class _Nth_type. Thanks for the patch, I've pushed it to trunk now. > > For the original metafunction _Nth_type code, > # 0 > template > struct _Nth_type<0, _Tp0, _Rest...> >

[committed] libstdc++: Use strerror_r in std::generic_category()::message(int) [PR110133]

2023-11-04 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. Probably worth backporting after some time on trunk. -- >8 -- Use strerror_r instead of strerror when available, due to the latter not being thread-safe. This is complicated by Glibc providing a GNU-specific strerror_r which is not compatible with POSIX

[committed] libstdc++: Replace "_N" in examples of naming conventions

2023-11-04 Thread Jonathan Wakely
Pushed to trunk. -- >8 -- The name "_N" is listed as a reserved name on Solaris, so we shouldn't use it as an example of our naming conventions. libstdc++-v3/ChangeLog: * doc/xml/manual/appendix_contributing.xml: Replace example that uses a BADNAME. *

Re: [PATCH] libstdc++: avoid uninitialized read in basic_string constructor

2023-11-03 Thread Jonathan Wakely
On Fri, 3 Nov 2023 at 13:51, Ben Sherman wrote: > > > This was https://gcc.gnu.org/PR109703 (and several duplicates) and > > should already be fixed in all affected branches. Where are you seeing > > this? > > I saw this on 13.1.0 and could not find the bug report or fix for it, so I > didn't

Re: libstdc++ patch RFA: Fix dl_iterate_phdr configury for libbacktrace

2023-11-03 Thread Jonathan Wakely
On Fri, 3 Nov 2023 at 03:04, Ian Lance Taylor wrote: > > The libbacktrace sources, as used by libstdc++-v3, fail to correctly > determine whether the system supports dl_iterate_phdr. The issue is > that the libbacktrace configure assumes that _GNU_SOURCE is defined > during compilation, but the

Re: [PATCH] libstdc++: avoid uninitialized read in basic_string constructor

2023-11-02 Thread Jonathan Wakely
On Thu, 2 Nov 2023 at 19:58, Ben Sherman wrote: > > Tested on x86_64-pc-linux-gnu, please let me know if there's anything > else needed. I haven't contributed before and don't have write access, so > apologies if I've missed anything. This was https://gcc.gnu.org/PR109703 (and several

[committed] libstdc++: Add assertion to std::string_view::remove_suffix [PR112314]

2023-11-02 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. Backports seem reasonable. -- >8 -- libstdc++-v3/ChangeLog: PR libstdc++/112314 * include/std/string_view (string_view::remove_suffix): Add debug assertion. *

[PATCH] libstdc++: Improve static assert messages for monadic operations

2023-11-02 Thread Jonathan Wakely
Any objections or suggestions for better wording? Tested x86_64-linux. -- >8 -- The monadic operations for std::optional and std::expected make use of internal helper traits __is_optional nad __is_expected, which are not very user-friendly when shown in diagnostics. Add messages to the

[committed] libstdc++: Fix warning during configure

2023-11-02 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. -- >8 -- The checks for snprintf give a -Wformat warning due to a missing argument. libstdc++-v3/ChangeLog: * acinclude.m4 (GLIBCXX_ENABLE_C99): Fix snprintf checks. * configure: Regenerate. --- libstdc++-v3/acinclude.m4 | 4 ++--

Re: [committed] libstdc++: Minor update to installation docs

2023-11-02 Thread Jonathan Wakely
On Wed, 1 Nov 2023 at 22:11, Gerald Pfeifer wrote: > > On Mon, 18 Sep 2023, Jonathan Wakely via Gcc-patches wrote: > > @@ -103,8 +103,10 @@ ln -s libiconv-1.16 libiconv > > > > If GCC 3.1.0 or later on is being used on GNU/Linux, an attempt > >

Re: [PATCH 2/4] maintainer-scripts/gcc_release: create index between snapshots <-> commits

2023-11-02 Thread Jonathan Wakely
On Thu, 2 Nov 2023 at 10:23, Andreas Schwab wrote: > > On Nov 02 2023, Jonathan Wakely wrote: > > > Git tags are cheap, but I can imagine a concern about hundreds of new > > tags "littering" the output of 'git tag -l'. I don't _think_ you can > > put tag

Re: [PATCH 2/4] maintainer-scripts/gcc_release: create index between snapshots <-> commits

2023-11-02 Thread Jonathan Wakely
On 02/11/23 08:39 +, Sam James wrote: Create and maintain a known_snapshots.txt index with space-separated format BRANCH-DATE COMMIT. For example: 8-20210107 5114ee0676e432493ada968e34071f02fb08114f 8-20210114 f9267925c648f2ccd9e4680b699e581003125bcf ... This is helpful for bisects and

Re: [committed][_GLIBCXX_INLINE_VERSION] Fix constract violation

2023-10-30 Thread Jonathan Wakely
On Mon, 30 Oct 2023, 18:31 François Dumont, wrote: > > On 30/10/2023 14:45, Jonathan Wakely wrote: > > On Sun, 29 Oct 2023 at 21:11, François Dumont > wrote: > >> This fixes handle_contract_violation under versioned namespace mode. > >> > >> Tested

Re: [committed][_GLIBCXX_INLINE_VERSION] Add emul TLS symbol exports

2023-10-30 Thread Jonathan Wakely
On Mon, 30 Oct 2023, 18:07 François Dumont, wrote: > > On 30/10/2023 14:58, Jonathan Wakely wrote: > > On Sun, 29 Oct 2023 at 21:25, François Dumont > wrote: > >> libstdc++: [_GLIBCXX_INLINE_VERSION] Add emul TLS symbols > >> > >> libstdc++-v3/Chang

[committed][wwwdocs] Uncomment link to "Porting to GCC 14"

2023-10-30 Thread Jonathan Wakely
Pushed to wwwdocs. -- >8 -- --- htdocs/gcc-14/changes.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/gcc-14/changes.html b/htdocs/gcc-14/changes.html index 5611fc4f..e5d3970c 100644 --- a/htdocs/gcc-14/changes.html +++ b/htdocs/gcc-14/changes.html @@ -17,11 +17,9 @@ This

[committed][wwwdocs] Add "Porting to GCC 14"

2023-10-30 Thread Jonathan Wakely
Pushed to wwwdocs. -- >8 -- --- htdocs/gcc-14/porting_to.html | 50 +++ 1 file changed, 50 insertions(+) create mode 100644 htdocs/gcc-14/porting_to.html diff --git a/htdocs/gcc-14/porting_to.html b/htdocs/gcc-14/porting_to.html new file mode 100644 index

Re: [committed][_GLIBCXX_INLINE_VERSION] Add emul TLS symbol exports

2023-10-30 Thread Jonathan Wakely
On Sun, 29 Oct 2023 at 21:25, François Dumont wrote: > > libstdc++: [_GLIBCXX_INLINE_VERSION] Add emul TLS symbols > > libstdc++-v3/ChangeLog: > > * config/abi/pre/gnu-versioned-namespace.ver: Add missing emul TLS > symbols. Please put a comment above the two new lines, the same as in

Re: [committed][_GLIBCXX_INLINE_VERSION] Fix constract violation

2023-10-30 Thread Jonathan Wakely
On Sun, 29 Oct 2023 at 21:11, François Dumont wrote: > > This fixes handle_contract_violation under versioned namespace mode. > > Tested under Linux x64 and confirmed to also fix Darwin build. > > libstdc++: [_GLIBCXX_INLINE_VERSION] Provide handle_contract_violation > symbol > >

Re: [PATCH htdocs v3] bugs: Mention -D_GLIBCXX_ASSERTIONS and -D_GLIBCXX_DEBUG

2023-10-27 Thread Jonathan Wakely
On Thu, 26 Oct 2023 at 23:40, Gerald Pfeifer wrote: > > On Thu, 26 Oct 2023, Sam James wrote: > > These options both enabled more checking within the C++ standard library > > and can expose errors in submitted code. > > This is a good addition, thank you! I was going to approve/push, but it's >

[committed] libstdc++: Fix exception thrown by std::shared_lock::unlock() [PR112089]

2023-10-26 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. Worth backporting to all active branches, I think. -- >8 -- The incorrect errc constant here looks like a copy error. libstdc++-v3/ChangeLog: PR libstdc++/112089 * include/std/shared_mutex (shared_lock::unlock): Change errc constant

[committed] libstdc++: Add dg-timeout-factor to IO tests

2023-10-26 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. Worth backporting to gcc-13 too. -- >8 -- This avoids failures due to compilation timeouts when testing with a low tool_timeout value. libstdc++-v3/ChangeLog: * testsuite/20_util/duration/io.cc: Double timeout using dg-timeout-factor.

Re: [PATCH htdocs] bugs: Mention -D_GLIBCXX_ASSERTIONS and -D_GLIBCXX_DEBUG

2023-10-26 Thread Jonathan Wakely
On Thursday, 26 October 2023, Sam James wrote: > These options both enabled more checking within the C++ standard library > and can expose errors in submitted code. > > -D_GLIBCXX_DEBUG is mentioned separately because while we want people to try it, > it's not always feasible because it requires

Re: [PATCH][_Hashtable] Use RAII to restore Rehash state

2023-10-26 Thread Jonathan Wakely
On 26/10/23 07:18 +0200, François Dumont wrote:     libstdc++: [_Hashtable] Use RAII type to manage rehash functor state     Replace usage of __try/__catch with a RAII type to restore rehash functor     state when needed. Generally I really like replacing try-catch with RAII but I have some

Re: [PATCH][_Hashtable] Use RAII to restore Rehash state

2023-10-26 Thread Jonathan Wakely
On Thu, 26 Oct 2023 at 06:18, François Dumont wrote: > libstdc++: [_Hashtable] Use RAII type to manage rehash functor state > > Replace usage of __try/__catch with a RAII type to restore rehash > functor > state when needed. > I'm reviewing this now, but could I request that you

[committed] libstdc++: Build libstdc++_libbacktrace.a as PIC [PR111936]

2023-10-25 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk, will backport to 12 and 13. -- >8 -- In order for std::stacktrace to be used in a shared library, the libbacktrace symbols need to be built with -fPIC. Add the libtool -prefer-pic flag to the commands in src/libbacktrace/Makefile so that the archive contains

Re: [PATCH] libstdc++ Add cstdarg to freestanding

2023-10-24 Thread Jonathan Wakely
On Sun, 22 Oct 2023 at 21:06, Arsen Arsenović wrote: > > "Paul M. Bendixen" writes: > > > Updated patch, added the requested files, hopefully wrote the commit > better. > > LGTM. Jonathan? > Yup, looks good. I've pushed it to trunk with a tweaked changelog entry. I'll backport it to gcc-13

Re: [PATCH v25 25/33] libstdc++: Optimize std::is_function compilation performance

2023-10-24 Thread Jonathan Wakely
On Tue, 24 Oct 2023 at 03:16, Ken Matsui wrote: > This patch optimizes the compilation performance of std::is_function > by dispatching to the new __is_function built-in trait. > > libstdc++-v3/ChangeLog: > > * include/std/type_traits (is_function): Use __is_function > built-in

Re: [PATCH] libstdc++: Ensure active union member is correctly set

2023-10-21 Thread Jonathan Wakely
On Fri, 29 Sept 2023 at 17:46, Jonathan Wakely wrote: > > On Fri, 29 Sept 2023 at 17:29, Nathaniel Shead > wrote: > > > > On Fri, Sep 29, 2023 at 04:06:33PM +0100, Jonathan Wakely wrote: > > > On Fri, 29 Sept 2023 at 10:32, Jonathan Wakely wrote: > > &

Re: [PATCH v2] libstdc++: Workaround for LLVM-61763 in ranges

2023-10-21 Thread Jonathan Wakely
On Sat, 21 Oct 2023 at 12:16, Jonathan Wakely wrote: > > On Mon, 16 Oct 2023 at 04:56, Benjamin Acker Brock wrote: > > > > > I don't think this patch counts as legally significant, but if you > > > contribute again in future you should be aware of > > &

Re: [PATCH v2] libstdc++: Workaround for LLVM-61763 in ranges

2023-10-21 Thread Jonathan Wakely
On Mon, 16 Oct 2023 at 04:56, Benjamin Acker Brock wrote: > > > I don't think this patch counts as legally significant, but if you > > contribute again in future you should be aware of > > https://gcc.gnu.org/contribute.html#legal and either complete the copyright > > assignment paperwork, or

Re: [PATCH v2] libstdc++: testsuite: Enhance codecvt_unicode with tests for length()

2023-10-21 Thread Jonathan Wakely
On Wed, 18 Oct 2023 at 11:52, Dimitrij Mijoski wrote: > > We can test codecvt::length() with the same data that we test > codecvt::in(). For each call of in() we add another call to length(). > Some additional small cosmentic changes are applied. Pushed to master, thanks! > >

[committed] libstdc++: Fix formatting of filesystem directory iterators

2023-10-21 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. -- >8 -- Fix indentation. libstdc++-v3/ChangeLog: * include/bits/fs_dir.h (operator==(default_sentinel_t)): Fix indentation. --- libstdc++-v3/include/bits/fs_dir.h | 16 1 file changed, 8 insertions(+), 8 deletions(-)

Re: [PATCH][_Hashtable] Fix merge

2023-10-19 Thread Jonathan Wakely
On Thursday, 19 October 2023, François Dumont wrote: > libstdc++: [_Hashtable] Do not reuse untrusted cached hash code > > On merge reuse merged node cached hash code only if we are on the same type of > hash and this hash is stateless. Usage of function pointers or std::function as > hash

Re: [PATCH] libstdc++: testsuite: Enhance codecvt_unicode with tests for length()

2023-10-18 Thread Jonathan Wakely
On Tue, 17 Oct 2023 at 23:51, Dimitrij Mijoski wrote: > > We can test codecvt::length() with the same data that we test > codecvt::in(). For each call of in() we add another call to length(). > Some additional small cosmentic changes are applied. Thanks! I'll get this applied. > >

Re: [PATCH] libstdc++: Workaround for LLVM-61763 in ranges

2023-10-14 Thread Jonathan Wakely
On Sat, 14 Oct 2023, 00:33 Benjamin Brock, wrote: > This is my first time submitting a patch, so my apologies if I'm > submitting incorrectly or missing something. > Thanks for contributing! I don't think this patch counts as legally significant, but if you contribute again in future you

Re: Ping: [PATCH v2 1/2] testsuite: Add dg-require-atomic-cmpxchg-word

2023-10-12 Thread Jonathan Wakely
On Thu, 12 Oct 2023, 17:11 Jeff Law, wrote: > > > On 10/12/23 08:38, Christophe Lyon wrote: > > LGTM but I'm not a maintainer ;-) > LGTM to as well -- I usually try to stay out of libstdc++, but this > looks simple enough. Both patches in this series are OK. > Thanks for stepping in, Jeff. The

Re: [PATCH] libstdc++: Fix tr1/8_c_compatibility/cstdio/functions.cc regression with recent glibc

2023-10-12 Thread Jonathan Wakely
On Thursday, 12 October 2023, Jakub Jelinek wrote: > Hi! > > The following testcase started FAILing recently after the > https://sourceware.org/git/?p=glibc.git;a=commit;h=64b1a44183a3094672ed304532bedb9acc707554 > glibc change which marked vfscanf with nonnull (1) attribute. > While vfwscanf

Re: [PATCH][_GLIBCXX_INLINE_VERSION] Add missing symbols

2023-10-05 Thread Jonathan Wakely
On Thu, 5 Oct 2023 at 18:04, François Dumont wrote: > > Here is a patch to fix following test case in gcc: > > gcc/testsuite/g++.dg/cpp23/ext-floating13.C > > libstdc++: [_GLIBCXX_INLINE_VERSION] Add missing float symbols > > libstdc++-v3/ChangeLog: > > *

Re: [PATCH] wwwdocs: Add ADL to C++ non-bugs

2023-10-05 Thread Jonathan Wakely
On Wed, 4 Oct 2023 at 20:17, Jason Merrill wrote: > > On 10/3/23 10:45, Jonathan Wakely wrote: > > We have a long history of INVALID bugs about std functions being > > available in the global namespace (PRs 27846, 67566, 82619, 99865, > > 110602, 111553, probably

Re: [PATCH 2/2] testsuite: Replace many dg-require-thread-fence with dg-require-atomic-exchange

2023-10-04 Thread Jonathan Wakely
On Wed, 4 Oct 2023 at 16:15, Hans-Peter Nilsson wrote: > > > From: Jonathan Wakely > > Date: Wed, 4 Oct 2023 09:29:43 +0100 > > > The new dg-require proc checks for __atomic_exchange, which is not the > > same as compare-exchange, and not the same as test-and-set on

Re: [committed] libstdc++: Define std::numeric_limits<_FloatNN> before C++23

2023-10-04 Thread Jonathan Wakely
On Wed, 4 Oct 2023 at 16:54, Stephan Bergmann wrote: > > On 8/17/23 22:32, Jonathan Wakely via Libstdc++ wrote: > > Tested x86_64-linux. Pushed to trunk. > > > > -- >8 -- > > > > The extended floating-point types such as _Float32 are supported by GCC

Re: [PATCH] libstdc++: Correctly call _string_types function

2023-10-04 Thread Jonathan Wakely
On Wed, 4 Oct 2023 at 16:10, Tom Tromey wrote: > > flake8 points out that the new call to _string_types from > StdExpAnyPrinter.__init__ is not correct -- it needs to be qualified. OK, thanks. > > libstdc++-v3/ChangeLog: > > * python/libstdcxx/v6/printers.py >

[PATCH] wwwdocs: Add ADL to C++ non-bugs

2023-10-04 Thread Jonathan Wakely
We have a long history of INVALID bugs about std functions being available in the global namespace (PRs 27846, 67566, 82619, 99865, 110602, 111553, probably others). Let's document it. Also de-prioritize the C++98-only bugs, which are unlikely to affect anybody nowadays. OK for wwwdocs? -- >8

[committed,gcc-11] libstdc++: Fix testsuite failures with -O0

2023-10-04 Thread Jonathan Wakely
I've pushed this to gcc-11 after testing on x86_64-linux. -- >8 -- Backport the prune.exp change from r12-4425-g1595fe44e11a96 to fix two testsuite failures when testing with -O0: FAIL: 20_util/uses_allocator/69293_neg.cc (test for excess errors) FAIL: 20_util/uses_allocator/cons_neg.cc (test

Re: [PATCH 2/2] testsuite: Replace many dg-require-thread-fence with dg-require-atomic-exchange

2023-10-04 Thread Jonathan Wakely
On Wed, 4 Oct 2023 at 04:11, Hans-Peter Nilsson wrote: > > > From: Christophe Lyon > > Date: Tue, 3 Oct 2023 15:20:39 +0200 > > > The patch passed almost all our CI configurations, except arm-eabi when > > testing with > > -mthumb/-march=armv6s-m/-mtune=cortex-m0/-mfloat-abi=soft/-mfpu=auto > >

Re: [PATCH 1/2] testsuite: Add dg-require-atomic-exchange non-atomic code

2023-10-04 Thread Jonathan Wakely
On Wed, 4 Oct 2023 at 03:56, Hans-Peter Nilsson wrote: > > > From: Christophe Lyon > > Date: Tue, 3 Oct 2023 15:20:39 +0200 > > > Maybe we need a new variant of dg-require-thread-fence ? > > Yes: many of the dg-require-thread-fence users need > something stronger. Tested arm-eabi together with

Re: [PATCH 1/2] libstdc++: Define _versioned_namespace in xmethods.py

2023-10-03 Thread Jonathan Wakely
On Tue, 3 Oct 2023, 18:19 Tom Tromey, wrote: > flake8 pointed out that is_specialization_of in xmethods.py looks at a > global that wasn't added to the file. This patch correct the > oversight. > OK, thanks > > libstdc++-v3/ChangeLog: > > * python/libstdcxx/v6/xmethods.py

Re: [PATCH 2/2] libstdc++: _versioned_namespace is always non-None

2023-10-03 Thread Jonathan Wakely
On Tue, 3 Oct 2023, 23:55 Jonathan Wakely, wrote: > > > On Tue, 3 Oct 2023, 19:27 Tom Tromey, wrote: > >> Some code in the pretty-printers seems to assume that the >> _versioned_namespace global might be None (or the empty string). >> However, doesn't occur, as th

Re: [PATCH 2/2] libstdc++: _versioned_namespace is always non-None

2023-10-03 Thread Jonathan Wakely
On Tue, 3 Oct 2023, 19:27 Tom Tromey, wrote: > Some code in the pretty-printers seems to assume that the > _versioned_namespace global might be None (or the empty string). > However, doesn't occur, as the variable is never reassigned. > ok for trunk, but we should just remove that bit from

Re: [PATCH] Fix coroutine tests for libstdc++ gnu-version-namespace mode

2023-10-03 Thread Jonathan Wakely
On Mon, 2 Oct 2023 at 18:07, François Dumont wrote: > > Hi > > Gentle reminder for this minor patch. It looks like you attached the wrong patch. > > Thanks > > On 23/09/2023 22:10, François Dumont wrote: > > I'm eventually fixing those tests the same way we manage this problem > > in libstdc++

Re: [PATCH] libstdc++: Ensure active union member is correctly set

2023-09-29 Thread Jonathan Wakely
On Fri, 29 Sept 2023 at 17:29, Nathaniel Shead wrote: > > On Fri, Sep 29, 2023 at 04:06:33PM +0100, Jonathan Wakely wrote: > > On Fri, 29 Sept 2023 at 10:32, Jonathan Wakely wrote: > > > > Thanks for the comments, here's an updated version of the patch. > >

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