[committed] libstdc++: Fix some -Wunused-parameter warnings

2023-08-09 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * include/bits/alloc_traits.h (allocate): Add [[maybe_unused]] attribute. * include/bits/regex_executor.tcc: Remove name of unused parameter. * include/bits/shared_ptr_atomic.h

[committed] libstdc++: Minor fixes for some warnings in

2023-08-09 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * include/std/format: Fix some warnings. (__format::__write(Ctx&, basic_string_view)): Remove unused function template. --- libstdc++-v3/include/std/format | 28 +--- 1 file

Re: [PATCH v10 4/5] libstdc++: Use new built-in trait __is_function for std::is_function

2023-08-08 Thread Jonathan Wakely via Gcc-patches
On Thu, 13 Jul 2023 at 03:41, Ken Matsui via Libstdc++ < libstd...@gcc.gnu.org> wrote: > This patch gets std::is_function to dispatch to new built-in trait > __is_function. > > libstdc++-v3/ChangeLog: > > * include/std/type_traits (is_function): Use __is_function built-in > trait.

Re: [PATCH v4 4/4] libstdc++: Optimize is_compound trait performance

2023-08-08 Thread Jonathan Wakely via Gcc-patches
On Tue, 18 Jul 2023 at 08:44, Ken Matsui via Libstdc++ < libstd...@gcc.gnu.org> wrote: > This patch optimizes the performance of the is_compound trait by > dispatching to the new __is_arithmetic built-in trait. > > libstdc++-v3/ChangeLog: > > * include/std/type_traits (is_compound): Use

Re: [PATCH v2 2/3] libstdc++: Optimize is_arithmetic performance by __is_arithmetic built-in

2023-08-08 Thread Jonathan Wakely via Gcc-patches
On Tue, 8 Aug 2023 at 21:09, Jonathan Wakely wrote: > > > On Sat, 15 Jul 2023 at 05:57, Ken Matsui via Libstdc++ < > libstd...@gcc.gnu.org> wrote: > >> This patch optimizes the performance of the is_arithmetic trait by >> dispatching to the new __is_arithmetic b

Re: [PATCH v2] libstdc++: Define _GLIBCXX_HAS_BUILTIN_TRAIT

2023-08-08 Thread Jonathan Wakely via Gcc-patches
On Wed, 19 Jul 2023 at 20:33, Ken Matsui via Libstdc++ < libstd...@gcc.gnu.org> wrote: > This patch defines _GLIBCXX_HAS_BUILTIN_TRAIT macro, which will be used > as a flag to toggle the use of built-in traits in the type_traits header > through _GLIBCXX_NO_BUILTIN_TRAITS macro, without needing

Re: [PATCH] libstdc++: Define _GLIBCXX_HAS_BUILTIN_TRAIT

2023-08-08 Thread Jonathan Wakely via Gcc-patches
On Wed, 19 Jul 2023 at 19:48, Patrick Palka via Libstdc++ < libstd...@gcc.gnu.org> wrote: > On Tue, 18 Jul 2023, Ken Matsui via Libstdc++ wrote: > > > This patch defines _GLIBCXX_HAS_BUILTIN_TRAIT, which will be used as a > > flag to toggle built-in traits in the type_traits header. Through this

Re: [PATCH v2 3/3] libstdc++: Optimize is_fundamental performance by __is_arithmetic built-in

2023-08-08 Thread Jonathan Wakely via Gcc-patches
On Tue, 18 Jul 2023 at 07:25, Ken Matsui via Libstdc++ < libstd...@gcc.gnu.org> wrote: > Hi, > > I took a benchmark for this. > > > https://github.com/ken-matsui/gcc-benches/blob/main/is_fundamental-disjunction.md#mon-jul-17-105937-pm-pdt-2023 > > template > struct is_fundamental > : public

Re: [PATCH v2 3/3] libstdc++: Optimize is_fundamental performance by __is_arithmetic built-in

2023-08-08 Thread Jonathan Wakely via Gcc-patches
On Tue, 18 Jul 2023 at 07:28, Ken Matsui via Libstdc++ < libstd...@gcc.gnu.org> wrote: > I will eventually work on disjunction to somehow optimize, but in the > meantime, this might be a better implementation. Of course, my > benchmark could be wrong. > You should use __or_ internally in

Re: [PATCH v2 2/3] libstdc++: Optimize is_arithmetic performance by __is_arithmetic built-in

2023-08-08 Thread Jonathan Wakely via Gcc-patches
On Sat, 15 Jul 2023 at 05:57, Ken Matsui via Libstdc++ < libstd...@gcc.gnu.org> wrote: > This patch optimizes the performance of the is_arithmetic trait by > dispatching to the new __is_arithmetic built-in trait. > > libstdc++-v3/ChangeLog: > > * include/std/type_traits (is_arithmetic):

Re: [PATCH] libstdc++: Use __bool_constant entirely

2023-08-08 Thread Jonathan Wakely via Gcc-patches
On Sat, 15 Jul 2023 at 04:02, Ken Matsui via Libstdc++ < libstd...@gcc.gnu.org> wrote: > This patch uses __bool_constant entirely instead of integral_constant > in the type_traits header, specifically for true_type, false_type, > and bool_constant. > > libstdc++-v3/ChangeLog: > > *

Re: [PATCH v3 1/3] c++, libstdc++: Implement __is_arithmetic built-in trait

2023-08-08 Thread Jonathan Wakely via Gcc-patches
On Sat, 22 Jul 2023 at 14:51, François Dumont via Libstdc++ < libstd...@gcc.gnu.org> wrote: > > On 18/07/2023 08:27, Ken Matsui via Libstdc++ wrote: > > This patch implements built-in trait for std::is_arithmetic. > > > > gcc/cp/ChangeLog: > > > > * cp-trait.def: Define __is_arithmetic. > >

[committed] libstdc++: Constrain __format::_Iter_sink for contiguous iterators [PR110917]

2023-08-07 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. gcc-13 backport to follow. -- >8 -- We can't write to a span<_CharT> if the contiguous iterator has a value type that isn't _CharT. libstdc++-v3/ChangeLog: PR libstdc++/110917 * include/std/format (__format::_Iter_sink): Constrain

[committed] libstdc++: Fix incorrect use of abs and log10 in std::format [PR110860]

2023-08-07 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. gcc-13 backport to follow. -- >8 -- The std::formatter implementation for floating-point types uses __builtin_abs and __builtin_log10 to avoid including all of , but those functions are not generic. The result of abs(2e304) is -INT_MIN which is undefined,

[committed] i386: Fix grammar typo in diagnostic

2023-08-07 Thread Jonathan Wakely via Gcc-patches
Committed as obvious. Less obvious (to me) is whether it's correct to say "GCC V13" here. I don't think we refer to a version that way anywhere else, do we? Would "since GCC 13.1.0" be better? -- >8 -- gcc/ChangeLog: * config/i386/i386.cc (ix86_invalid_conversion): Fix grammar. ---

[committed] libstdc++: Fix past-the-end increment in std::format [PR110862]

2023-08-07 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. gcc-13 backport to follow. -- >8 -- At the end of a replacement field we should check that the closing brace is actually present before incrementing past it. libstdc++-v3/ChangeLog: PR libstdc++/110862 * include/std/format

Re: [committed] Fix several preprocessor directives

2023-08-07 Thread Jonathan Wakely via Gcc-patches
On Sun, 30 Jul 2023 at 14:55, François Dumont via Libstdc++ < libstd...@gcc.gnu.org> wrote: > Committed as obvious. > > libstdc++: Fix several preprocessor directives > > A wrong usage of #define in place of a #error seems to have been > replicated > at different places in source

[committed] libstdc++: Fix std::format alternate form for floating-point [PR108046]

2023-07-27 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. Backport to gcc-13 to follow. -- >8 -- A decimal point was being added to the end of the string for {:#.0} because the __expc character was not being set, for the _Pres_none presentation type, so __s.find(__expc) didn't the 'e' in "1e+01" and so we created

[committed] libstdc++: Require C++11 for 23_containers/vector/bool/110807.cc [PR110807]

2023-07-26 Thread Jonathan Wakely via Gcc-patches
Pushed to trunk. -- >8 -- This new test uses uniform initialization syntax, so requires C++11 or later. libstdc++-v3/ChangeLog: PR libstdc++/110807 * testsuite/23_containers/vector/bool/110807.cc: Require c++11. --- libstdc++-v3/testsuite/23_containers/vector/bool/110807.cc |

[committed] libstdc++: Avoid bogus overflow warnings in std::vector [PR110807]

2023-07-26 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. Backport to gcc-13 will come after the 13.2 release. -- >8 -- GCC thinks the allocation can alter the object being copied if it's globally reachable, so doesn't realize that [x.begin(), x.end()) after the allocation is the same as x.size() before it. This

[committed] libstdc++: Add deprecated attribute to std::random_shuffle declarations

2023-07-26 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. Probably worth backporting to 12 and 13. -- >8 -- We already have these attributes on the definitions in but they don't work due to PR c++/84542. Add the attributes to the declarations in as well, and add a test. libstdc++-v3/ChangeLog: *

Re: [PATCH] libstdc++: Add missing constexpr specifier and function overloads

2023-07-24 Thread Jonathan Wakely via Gcc-patches
On 23/07/23 20:28 -0700, Deev Patel wrote: Hi, A couple of virtual functions in the libstdc++ format header are marked constexpr in the base class, but not in the derived class. This was causing build failures when trying to compile latest gcc libstd with clang 16 using c++20. Adding the

[PATCH] libstdc++: Reuse double overload of __convert_to_v if possible

2023-07-24 Thread Jonathan Wakely via Gcc-patches
This seems like a worthwhile change. In theory we could make it even smaller by using a symbol alias, but I'm not sure that's supported on the targets where this will actually help. Any objections? -- >8 -- For targets where double and long double have the same representation we can reuse the

[committed] libstdc++; Do not use strtold for hppa-hpux [PR110653]

2023-07-24 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. I hope this bug can be closed now, ut will have to wait for Dave Angling to post results. -- >8 -- When I switched std::stold to depend on HAVE_STRTOLD that enabled it for hppa-hpux which defines HAVE_BROKEN_STRTOLD. Add a check for that macro so that we

[committed] libstdc++: Do not define inaccurate from_chars for _Float128 [PR110077]

2023-07-19 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux and sparc-solaris. Pushed to trunk. -- >8 -- I think r14-1431-g7037e7b6e4ac41 was wrong to try to define the _Float128 overload unconditionally. Not all targets need it, so defining the lossy fallback using long double is not useful (and caused an ABI change on Solaris x86).

[committed] libstdc++: Check for std::ratio in arithmetic and comparisons [PR110593]

2023-07-19 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- The standard says that it should be ill-formed to use std::ratio_equal etc. with types which are not specializations of std::ratio. This implements that requirement. We don't need to add assertions to every one of the class templates, because many

[PATCH] libstdc++: Fix preprocessor conditions for std::from_chars [PR109921]

2023-07-19 Thread Jonathan Wakely via Gcc-patches
I'm testing this patch for gcc-13 as a better fix for PR109921, without the breakage that r14-1431-g7037e7b6e4ac41 caused on trunk. If testing goes well I'll push this before the 13.2 release candidate. -- >8 -- We use the from_chars_strtod function with __strtof128 to read a _Float128 value,

[committed] libstdc++: Fix formatting of negative chrono::hh_mm_ss

2023-07-19 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- When formatting with an empty chrono spec ("{}") two minus signs were being added to hh_mm_ss values. This is because the __is_neg flag was checked to add one explicitly, and then the ostream operator added another one. We should only check the

[committed] libstdc++: Fix locale-specific duration formatting [PR110719]

2023-07-19 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- The r14-2640-gf4bce119f617dc commit only removed fractional seconds for time points, but it needs to be done for durations and hh_mm_ss types too. libstdc++-v3/ChangeLog: PR libstdc++/110719 * include/bits/chrono_io.h

[committed] libstdc++: Avoid warning in std::format

2023-07-19 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- With -Wmaybe-uninitialized -Wsystem-headers there's a warning about creating a string_view from an uninitalized array. Initializing the first element of the array avoids the warning. libstdc++-v3/ChangeLog: * include/std/format

[committed] libstdc++: Implement correct locale-specific chrono formatting [PR110719]

2023-07-19 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. I'll backport it to gcc-13 some time after the 13.2 release. -- >8 -- This fixes some TODOs in the C++20 format support, where the locale-specific output was incorrect or unimplemented. The approach taken here is to either use the formatting locale's

[committed] libstdc++: Check for multiple modifiers in chrono format string [PR110708]

2023-07-19 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. This should be backported to gcc-13 too, but it can wait until 13.3 (it's just an accepts-invalid and unlikely to affect anybody in practice). -- >8 -- The logic for handling modified chrono specs like %Ey was just restarting the loop after each modifier,

[committed 2/3] libstdc++: Define std::stof fallback in terms of std::stod [PR110653]

2023-07-19 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- For targets without std::strtof we can define std::stof by calling std::stod and then checking if the result is out of range of float. libstdc++-v3/ChangeLog: PR libstdc++/110653 * include/bits/basic_string.h

[committed 3/3] libstdc++: Enable tests for std::stoi etc. unconditionally [PR110653]

2023-07-19 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- Since the narrow string versions of std::stoi, std::stol, std::stoul, std::stof and std::stod are now always defined, we don't need to check dg-require-string-conversions in the relevant tests. libstdc++-v3/ChangeLog: PR libstdc++/110653

[committed 1/3] libstdc++: Check autoconf macros for strtof and strtold [PR110653]

2023-07-19 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- As well as the _GLIBCXX_USE_C99_STDLIB check, we also have a separate check in linkage.m4 for just strtof and strtold. We can use that to declare std::strtof and std::strtold in for additional targets. That allows us to enable std::stold on

Re: [PATCH v2 1/2] c++, libstdc++: implement __is_pointer built-in trait

2023-07-14 Thread Jonathan Wakely via Gcc-patches
On Fri, 14 Jul 2023 at 11:48, Jonathan Wakely wrote: > > On Thu, 13 Jul 2023 at 21:04, Ken Matsui wrote: > > > > On Thu, Jul 13, 2023 at 2:22 AM Jonathan Wakely wrote: > > > > > > On Wed, 12 Jul 2023 at 21:42, Ken Matsui > > > wrote: > > &

Re: [PATCH v2 1/2] c++, libstdc++: implement __is_pointer built-in trait

2023-07-14 Thread Jonathan Wakely via Gcc-patches
On Thu, 13 Jul 2023 at 21:04, Ken Matsui wrote: > > On Thu, Jul 13, 2023 at 2:22 AM Jonathan Wakely wrote: > > > > On Wed, 12 Jul 2023 at 21:42, Ken Matsui wrote: > > > > > > On Wed, Jul 12, 2023 at 3:01 AM Jonathan Wakely > > > wrote: > > &

[committed] libstdc++: std::stoi etc. do not need C99 support [PR110653]

2023-07-13 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. -- >8 -- std::stoi, std::stol, std::stoul, and std::stod only depend on C89 functions, so don't need to be guarded by _GLIBCXX_USE_C99_STDLIB std::stoll and std::stoull don't need C99 strtoll and strtoull if sizeof(long) == sizeof(long long).

Re: [PATCH v2 1/2] c++, libstdc++: implement __is_pointer built-in trait

2023-07-13 Thread Jonathan Wakely via Gcc-patches
On Wed, 12 Jul 2023 at 21:42, Ken Matsui wrote: > > On Wed, Jul 12, 2023 at 3:01 AM Jonathan Wakely wrote: > > > > On Mon, 10 Jul 2023 at 06:51, Ken Matsui via Libstdc++ > > wrote: > > > > > > Hi, > > > > > > Here is the benchmark resu

[committed] libstdc++: Check conversion from filesystem::path to wide strings [PR95048]

2023-07-12 Thread Jonathan Wakely via Gcc-patches
Tested powerp64le-linux. Pushed to trunk. This can be backported too. -- >8 -- The testcase added for this bug only checks conversion from wide strings on construction, but the fix also covered conversion to wide stings via path::wstring(). Add checks for that, and u16string() and u32string().

Re: [PATCH v2 2/2] libstdc++: use new built-in trait __is_scalar for std::is_scalar

2023-07-12 Thread Jonathan Wakely via Gcc-patches
On Wed, 12 Jul 2023, 19:33 Ken Matsui via Libstdc++, wrote: > On Wed, Jul 12, 2023 at 2:50 AM Jonathan Wakely > wrote: > > > > On Sat, 8 Jul 2023 at 05:47, Ken Matsui via Libstdc++ > > wrote: > > > > > > This patch gets std::is_scalar to dispat

Re: [PATCH v2 2/2] libstdc++: use new built-in trait __remove_pointer

2023-07-12 Thread Jonathan Wakely via Gcc-patches
On Sat, 8 Jul 2023 at 06:31, Ken Matsui via Libstdc++ wrote: > > This patch lets libstdc++ use new built-in trait __remove_pointer. > > libstdc++-v3/ChangeLog: > > * include/std/type_traits (remove_pointer): Use __remove_pointer > built-in trait. > > Signed-off-by: Ken Matsui OK for

Re: [PATCH 1/2] c++, libstdc++: implement __is_signed built-in trait

2023-07-12 Thread Jonathan Wakely via Gcc-patches
On Sun, 9 Jul 2023 at 09:50, Ken Matsui via Libstdc++ wrote: > > This patch implements built-in trait for std::is_signed. > > gcc/cp/ChangeLog: > > * cp-trait.def: Define __is_signed. > * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_SIGNED. > * semantics.cc

Re: [PATCH v8 4/6] libstdc++: use new built-in trait __is_function for std::is_function

2023-07-12 Thread Jonathan Wakely via Gcc-patches
On Sat, 8 Jul 2023 at 06:15, Ken Matsui via Libstdc++ wrote: > > This patch gets std::is_function to dispatch to new built-in trait > __is_function. > > libstdc++-v3/ChangeLog: > > * include/std/type_traits (is_function): Use __is_function built-in > trait. >

Re: [PATCH v8 2/6] libstdc++: use new built-in trait __is_reference for std::is_reference

2023-07-12 Thread Jonathan Wakely via Gcc-patches
On Sat, 8 Jul 2023 at 06:13, Ken Matsui via Libstdc++ wrote: > > This patch gets std::is_reference to dispatch to new built-in trait > __is_reference. > > libstdc++-v3/ChangeLog: > > * include/std/type_traits (is_reference): Use __is_reference built-in > trait. >

Re: [PATCH v4 2/2] libstdc++: use new built-in trait __is_unsigned

2023-07-12 Thread Jonathan Wakely via Gcc-patches
On Sat, 8 Jul 2023 at 12:14, Ken Matsui via Libstdc++ wrote: > > This patch lets libstdc++ use new built-in trait __is_unsigned. > > libstdc++-v3/ChangeLog: > > * include/std/type_traits (is_unsigned): Use __is_unsigned built-in > trait. > (is_unsigned_v): Likewise. > >

Re: [PATCH 2/2] libstdc++: use new built-in trait __is_signed

2023-07-12 Thread Jonathan Wakely via Gcc-patches
On Sun, 9 Jul 2023 at 09:50, Ken Matsui via Libstdc++ wrote: > > This patch lets libstdc++ use new built-in trait __is_signed. > > libstdc++-v3/ChangeLog: > > * include/std/type_traits (is_signed): Use __is_signed built-in trait. > (is_signed_v): Likewise. > > Signed-off-by: Ken

Re: [PATCH v2 1/2] c++, libstdc++: implement __is_pointer built-in trait

2023-07-12 Thread Jonathan Wakely via Gcc-patches
On Mon, 10 Jul 2023 at 06:51, Ken Matsui via Libstdc++ wrote: > > Hi, > > Here is the benchmark result for is_pointer: > > https://github.com/ken-matsui/gcc-benches/blob/main/is_pointer.md#sun-jul--9-103948-pm-pdt-2023 > > Time: -62.1344% > Peak Memory Usage: -52.4281% > Total Memory Usage:

Re: [PATCH v2] libstdc++: use __is_enum built-in trait

2023-07-12 Thread Jonathan Wakely via Gcc-patches
On Sat, 8 Jul 2023 at 05:50, Ken Matsui via Libstdc++ wrote: > > This patch replaces is_enum::value with __is_enum built-in trait in > the type_traits header. > > libstdc++-v3/ChangeLog: > > * include/std/type_traits (__make_unsigned_selector): Use > __is_enum built-in trait. >

Re: [PATCH v2 2/2] libstdc++: use new built-in trait __is_scalar for std::is_scalar

2023-07-12 Thread Jonathan Wakely via Gcc-patches
On Sat, 8 Jul 2023 at 05:47, Ken Matsui via Libstdc++ wrote: > > This patch gets std::is_scalar to dispatch to new built-in trait > __is_scalar. > > libstdc++-v3/ChangeLog: > > * include/std/type_traits (is_scalar): Use __is_scalar built-in > trait. > (is_scalar_v):

Re: [PATCH 1/2] c++, libstdc++: implement __is_pointer built-in trait

2023-07-12 Thread Jonathan Wakely via Gcc-patches
On Mon, 10 Jul 2023 at 06:24, Ken Matsui via Libstdc++ wrote: > > This patch implements built-in trait for std::is_pointer. > > gcc/cp/ChangeLog: > > * cp-trait.def: Define __is_pointer. > * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_POINTER. > * semantics.cc

Re: [PATCH 1/2] c++, libstdc++: implement __is_pointer built-in trait

2023-07-12 Thread Jonathan Wakely via Gcc-patches
On Wed, 12 Jul 2023 at 05:41, François Dumont via Libstdc++ wrote: > > > On 10/07/2023 07:23, Ken Matsui via Libstdc++ wrote: > > This patch implements built-in trait for std::is_pointer. > > > > gcc/cp/ChangeLog: > > > > * cp-trait.def: Define __is_pointer. > > * constraint.cc

Re: [PATCH] libstdc++: Use RAII in std::vector::_M_realloc_insert

2023-07-10 Thread Jonathan Wakely via Gcc-patches
On Wed, 28 Jun 2023 at 08:56, Jan Hubicka wrote: > > > I think the __throw_bad_alloc() and __throw_bad_array_new_length() > > functions should always be rare, so marking them cold seems fine (users who > > define their own allocators that want to throw bad_alloc "often" will > > probably throw it

[committed] doc: Fix typos in Warning Options [PR110596]

2023-07-08 Thread Jonathan Wakely via Gcc-patches
Pushed as obvious. -- >8 -- gcc/ChangeLog: PR c++/110595 PR c++/110596 * doc/invoke.texi (Warning Options): Fix typos. --- gcc/doc/invoke.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index

[PATCH] libstdc++: Compile basic_file_stdio.cc for LFS

2023-07-07 Thread Jonathan Wakely via Gcc-patches
When this code was written we didn't have the header, so it conditionally used lseek64 etc. Since this is compiled into the library, not inline code in headers, we can just define the relevant macros to get a 64-bit off_t and then simplify the code. Tested x86_64-linux. I intend to commit this

[PATCH] libstdc++: Fix --enable-cstdio=stdio_pure [PR110574]

2023-07-07 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux (with --enable-cstdio=stdio_pure and without). I intend to commit this next week. This fixes most of the fstream failures seen with stdio_pure, although there are still a few that fail (about half of them time out): FAIL: 27_io/basic_filebuf/imbue/char/13171-2.cc execution

[committed] libstdc++: Document --enable-cstdio=stdio_pure [PR110574]

2023-07-06 Thread Jonathan Wakely via Gcc-patches
Pushed to trunk. Backports to 11, 12 and 13 will follow. -- >8 -- libstdc++-v3/ChangeLog: PR libstdc++/110574 * doc/xml/manual/configure.xml: Describe stdio_pure argument to --enable-cstdio. * doc/html/manual/configure.html: Regenerate. ---

[PATCH] doc: Update my Contributors entry

2023-07-05 Thread Jonathan Wakely via Gcc-patches
5db..fa551c5f900 100644 --- a/gcc/doc/contrib.texi +++ b/gcc/doc/contrib.texi @@ -1095,8 +1095,7 @@ Todd Vierling for contributions for NetBSD ports. Andrew Waterman for contributing the RISC-V port, as well as maintaining it. @item -Jonathan Wakely for contributing libstdc++ Doxygen notes and XH

Re: [PATCH] libstdc++: Fix fwrite error parameter

2023-07-05 Thread Jonathan Wakely via Gcc-patches
On Wed, 5 Jul 2023 at 16:54, shuaitq via Libstdc++ wrote: > > the first parameter of fwrite should be the const char* __s which want write > to FILE *__file, > rather than the FILE *__file write to the FILE *__file. Thank you. The patch is correct and small enough to not require a copyright

[committed] libstdc++: Disable std::forward_list tests for C++98 mode

2023-07-05 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- These tests fail with -std=gnu++98/-D_GLIBCXX_DEBUG in the runtest flags. They should require the c++11 effective target. libstdc++-v3/ChangeLog: * testsuite/23_containers/forward_list/debug/iterator1_neg.cc: Skip as UNSUPPORTED

[committed] libstdc++: Fix std::__uninitialized_default_n for constant evaluation [PR110542]

2023-07-05 Thread Jonathan Wakely via Gcc-patches
This is a weird one as described in the PR. GCC doesn't complain about this bug, but seems to have a bogus error elsewhere. I'll add a testcase once I've understood/fixed the GCC error. Tested x86_64-linux. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: PR libstdc++/110542 *

[committed] libstdc++: Use RAII in std::vector::_M_default_append

2023-07-05 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- Similar to r14-2052-gdd2eb972a5b063, replace the try-block with RAII types for deallocating storage and destroying elements. libstdc++-v3/ChangeLog: * include/bits/vector.tcc (_M_default_append): Replace try-block with RAII types.

[committed] libstdc++: Add redundant 'typename' to std::projected

2023-07-05 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- This is needed by Clang 15. libstdc++-v3/ChangeLog: * include/bits/iterator_concepts.h (projected): Add typename. --- libstdc++-v3/include/bits/iterator_concepts.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

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

2023-07-03 Thread Jonathan Wakely via Gcc-patches
On Mon, 3 Jul 2023 at 23:14, Thomas Rodgers via Libstdc++ wrote: > > This testcase is causing some timeout issues. This patch splits the > testcase up by individual set algorithm. I think the Apache license requires a notice saying the original file was modified. A comment in each new file

[committed] libstdc++: Fix synopsis test

2023-07-03 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- The header is only supported for the cxx11 ABI. The declarations of basic_syncbuf, basic_osyncstream, syncbuf and osyncstream were already correctly guarded by a check for _GLIBCXX_USE_CXX11_ABI, but the wsyncbuf and wosyncstream declarations were

Re: [PATCH] libstdc++: Enable OpenMP 5.0 pragmas in PSTL headers

2023-07-03 Thread Jonathan Wakely via Gcc-patches
Pushed to trunk now. On Fri, 30 Jun 2023 at 21:17, Jonathan Wakely via Libstdc++ wrote: > > Jakub made a similar change a few yeas ago, but I think it got lost > in the recent PSTL rebase. > > Tested x86_64-linux. > > Does this look OK for trunk? > > -- >8

[committed] libstdc++: Qualify calls to std::_Destroy and _Destroy_aux

2023-07-03 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. This isn't a regression, but is safe to backport. -- >8 -- These calls should be qualified to prevent ADL, which can cause errors for incomplete types that are associated classes. libstdc++-v3/ChangeLog: * include/bits/alloc_traits.h (_Destroy):

[PATCH] libstdc++: Enable OpenMP 5.0 pragmas in PSTL headers

2023-06-30 Thread Jonathan Wakely via Gcc-patches
Jakub made a similar change a few yeas ago, but I think it got lost in the recent PSTL rebase. Tested x86_64-linux. Does this look OK for trunk? -- >8 -- This reapplies r10-1314-g32bab8b6ad0a90 which was lost in the recent PSTL rebase from upstream. * include/pstl/pstl_config.h

Re: [PATCH] libstdc++: Fix iostream init for Clang on darwin [PR110432]

2023-06-30 Thread Jonathan Wakely via Gcc-patches
On Fri, 30 Jun 2023 at 15:29, Patrick Palka wrote: > > On Fri, 30 Jun 2023, Jonathan Wakely wrote: > > > Tested x86_64-linux. Patrick, PTAL. > > > > -- >8 -- > > > > The __has_attribute(init_priority) check in is true for Clang > > on darw

[committed] libstdc++: Fix unused warning for new variable

2023-06-30 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux and x86_64-linux. Pushed to trunk. -- >8 -- This newly-introduced variable isn't used on all paths, so add the [[maybe_unused]] attribute. libstdc++-v3/ChangeLog: * src/c++11/random.cc (random_device::_M_init): Add maybe_unused attribute. ---

[PATCH] libstdc++: Fix iostream init for Clang on darwin [PR110432]

2023-06-30 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Patrick, PTAL. -- >8 -- The __has_attribute(init_priority) check in is true for Clang on darwin, which means that user code including thinks the library will initialize the global streams. However, when libstdc++ is built by GCC on darwin, the

[committed] libstdc++: Make std::random_device throw more std::system_error [PR105081]

2023-06-30 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- In r14-289-gf9412cedd6c0e7 I made the std::random_device constructor throw std::system_error for unrecognized tokens. But it still throws std::runtime_error for a token such as "rdseed" that is recognized but not supported at runtime by the CPU the

Re: PR108672 re-fixed after [PATCH] libstdc++: Synchronize PSTL with upstream

2023-06-30 Thread Jonathan Wakely via Gcc-patches
On Fri, 30 Jun 2023 at 09:42, Jonathan Wakely wrote: > > On Fri, 30 Jun 2023 at 04:48, Hans-Peter Nilsson wrote: > > > > > Date: Mon, 26 Jun 2023 11:57:49 -0700 > > > From: Thomas Rodgers via Gcc-patches > > > > > On Wed, May 17, 2023 at 12:32

Re: PR108672 re-fixed after [PATCH] libstdc++: Synchronize PSTL with upstream

2023-06-30 Thread Jonathan Wakely via Gcc-patches
On Fri, 30 Jun 2023 at 04:48, Hans-Peter Nilsson wrote: > > > Date: Mon, 26 Jun 2023 11:57:49 -0700 > > From: Thomas Rodgers via Gcc-patches > > > On Wed, May 17, 2023 at 12:32 PM Jonathan Wakely wrote: > > > All the actual code changes look good. > >

Re: [PATCH] Relax type-printer regexp in libstdc++ test suite

2023-06-29 Thread Jonathan Wakely via Gcc-patches
On Thu, 29 Jun 2023 at 17:59, Tom Tromey wrote: > >>>>> Jonathan Wakely writes: > > > Looks good. OK for trunk, and OK to backport after some soak time on > trunk. Thanks. > > AdaCore doesn't need a backport of this, and I don't think it's > extremely

[committed] libstdc++: Do not use off64_t in calls to copy_file_range [PR110462]

2023-06-29 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- Although the copy_file_range(2) man page shows the arguments as off64_t* that is not portable. For musl there is no off64_t type, as off_t is always 64-bit. Use the loff_t type which is always 64-bit even if off_t isn't. We could just use off_t

[committed] libstdc++: Fix src/c++20/tzdb.cc for non-constexpr std::mutex

2023-06-29 Thread Jonathan Wakely via Gcc-patches
This build failure for riscv32-esp-elf was "reported" on the gcc-help list: https://gcc.gnu.org/pipermail/gcc-help/2023-June/142641.html Tested x86_64-linux. Pushed to trunk. -- >8 -- Building libstdc++ reportedly fails for targets without lock-free std::atomic which don't define

Re: [committed] libstdc++: Fix preprocessor conditions for std::from_chars [PR109921]

2023-06-29 Thread Jonathan Wakely via Gcc-patches
On Thu, 1 Jun 2023 at 12:05, Jonathan Wakely wrote: > On Thu, 1 Jun 2023 at 10:30, Christophe Lyon via Libstdc++ > wrote: > > > > Hi, > > > > > > On Wed, 31 May 2023 at 14:25, Jonathan Wakely via Gcc-patches < > > gcc-patches@gcc.gnu.org> w

Re: [PATCH] Relax type-printer regexp in libstdc++ test suite

2023-06-28 Thread Jonathan Wakely via Gcc-patches
On Wed, 28 Jun 2023 at 16:58, Tom Tromey via Libstdc++ < libstd...@gcc.gnu.org> wrote: > The libstdc++ test suite checks whether gdb type printers are > available like so: > > set do_whatis_tests [gdb_batch_check "python print(gdb.type_printers)" > \ >"\\\[\\\]"] >

Re: [PATCH] libstdc++: Use RAII in std::vector::_M_realloc_insert

2023-06-28 Thread Jonathan Wakely via Gcc-patches
On Wed, 28 Jun 2023 at 08:56, Jan Hubicka wrote: > > I think the __throw_bad_alloc() and __throw_bad_array_new_length() > > functions should always be rare, so marking them cold seems fine (users > who > > define their own allocators that want to throw bad_alloc "often" will > > probably throw it

[committed] libstdc++: Fix std::format for pointers [PR110239]

2023-06-26 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- The formatter for pointers was casting to uint64_t which sign extends a 32-bit pointer and produces a value that won't fit in the provided buffer. Cast to uintptr_t instead. There was also a bug in the __parse_integer helper when converting a wide

[committed] libstdc++: Implement P2538R1 ADL-proof std::projected

2023-06-26 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- This was recently approved for C++26, but there's no harm in implementing it unconditionally for C++20 and C++23. As it says in the paper, it doesn't change the meaning of any valid code. It only enables things that were previously ill-formed for

[committed] libstdc++: Qualify calls to debug mode helpers

2023-06-26 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- These functions should be qualified to disable unwanted ADL. The overload of __check_singular_aux for safe iterators was previously being found by ADL, because it wasn't declared before __check_singular. Add a declaration so that it can be found by

Re: [PATCH] libstdc++: Use RAII in std::vector::_M_realloc_insert

2023-06-23 Thread Jonathan Wakely via Gcc-patches
On Fri, 23 Jun 2023 at 17:44, Jan Hubicka wrote: > > I intend to push this to trunk once testing finishes. > > > > I generated the diff with -b so the whitespace changes aren't shown, > > because there was some re-indenting that makes the diff look larger than > > it really is. > > > > Honza, I

[committed] [gcc-12] libstdc++: avoid bogus -Wrestrict [PR105651]

2023-06-21 Thread Jonathan Wakely via Gcc-patches
I've pushed Jason's patch from https://gcc.gnu.org/PR105651#c17 to the gcc-12 branch, because Jakub's fix on gcc-13 isn't possible to backport. Tested x86_64-linux, pushed to gcc-12. -- >8 -- PR tree-optimization/105651 libstdc++-v3/ChangeLog: * include/bits/basic_string.tcc

Re: [committed] libstdc++: Optimize std::to_array for trivial types [PR110167]

2023-06-20 Thread Jonathan Wakely via Gcc-patches
On Tue, 20 Jun 2023 at 09:29, Jonathan Wakely wrote: > > > On Tue, 20 Jun 2023 at 01:54, Patrick Palka wrote: > >> On Fri, 9 Jun 2023, Jonathan Wakely via Libstdc++ wrote: >> >> > Tested powerpc64le-linux. Pushed to trunk. >> > >> > This ma

[PATCH] libstdc++: Use RAII in std::vector::_M_realloc_insert

2023-06-20 Thread Jonathan Wakely via Gcc-patches
I intend to push this to trunk once testing finishes. I generated the diff with -b so the whitespace changes aren't shown, because there was some re-indenting that makes the diff look larger than it really is. Honza, I don't think this is likely to make much difference for the PR 110287

Re: [libstdc++] Improve M_check_len

2023-06-20 Thread Jonathan Wakely via Gcc-patches
On Tue, 20 Jun 2023 at 11:45, Jonathan Wakely wrote: > On Tue, 20 Jun 2023 at 09:21, Andreas Schwab wrote: > >> On Jun 20 2023, Jakub Jelinek via Gcc-patches wrote: >> >> > Is it safe even on 64bit targets? I mean, doesn't say PowerPC already >> allow >&

Re: [libstdc++] Improve M_check_len

2023-06-20 Thread Jonathan Wakely via Gcc-patches
On Tue, 20 Jun 2023 at 09:21, Andreas Schwab wrote: > On Jun 20 2023, Jakub Jelinek via Gcc-patches wrote: > > > Is it safe even on 64bit targets? I mean, doesn't say PowerPC already > allow > > full 64-bit virtual address space? The assumption that one can't have > > more than half of virtual

Re: [committed] libstdc++: Optimize std::to_array for trivial types [PR110167]

2023-06-20 Thread Jonathan Wakely via Gcc-patches
On Tue, 20 Jun 2023 at 01:54, Patrick Palka wrote: > On Fri, 9 Jun 2023, Jonathan Wakely via Libstdc++ wrote: > > > Tested powerpc64le-linux. Pushed to trunk. > > > > This makes sense to backport after some soak time on trunk. > > > > -- >8 -- > >

Re: [libstdc++] Improve M_check_len

2023-06-19 Thread Jonathan Wakely via Gcc-patches
On Mon, 19 Jun 2023 at 16:13, Jonathan Wakely wrote: > On Mon, 19 Jun 2023 at 12:20, Jakub Jelinek wrote: > >> On Mon, Jun 19, 2023 at 01:05:36PM +0200, Jan Hubicka via Gcc-patches >> wrote: >> > - if (max_size() - size() < __n) >> > - __throw_l

Re: [libstdc++] Improve M_check_len

2023-06-19 Thread Jonathan Wakely via Gcc-patches
P.S. please CC libstd...@gcc.gnu.org for all libstdc++ patches. On Mon, 19 Jun 2023 at 16:13, Jonathan Wakely wrote: > On Mon, 19 Jun 2023 at 12:20, Jakub Jelinek wrote: > >> On Mon, Jun 19, 2023 at 01:05:36PM +0200, Jan Hubicka via Gcc-patches >> wrote: >> > - if

Re: [libstdc++] Improve M_check_len

2023-06-19 Thread Jonathan Wakely via Gcc-patches
On Mon, 19 Jun 2023 at 12:20, Jakub Jelinek wrote: > On Mon, Jun 19, 2023 at 01:05:36PM +0200, Jan Hubicka via Gcc-patches > wrote: > > - if (max_size() - size() < __n) > > - __throw_length_error(__N(__s)); > > + const size_type __max_size = max_size(); > > + // On 64bit systems

Re: [libstdc++] Improve M_check_len

2023-06-19 Thread Jonathan Wakely via Gcc-patches
On Sun, 18 Jun 2023 at 19:37, Jan Hubicka wrote: > Hi, > _M_check_len is used in vector reallocations. It computes __n + __s but > does > checking for case that (__n + __s) * sizeof (Tp) would overflow ptrdiff_t. > Since we know that __s is a size of already allocated memory block if __n > is >

Re: [libstdc++] [testsuite] xfail dbl from_chars for aarch64 rtems ldbl

2023-06-15 Thread Jonathan Wakely via Gcc-patches
On Thu, 15 Jun 2023, 01:49 Alexandre Oliva via Libstdc++, < libstd...@gcc.gnu.org> wrote: > > rtems, like vxworks, uses fast-float doubles for from_chars even for > long double, so it loses precision, so expect the long double bits to > fail on aarch64. > > Regstrapped on x86_64-linux-gnu, also

Re: libstdc++-v3: do not duplicate some math functions when using newlib

2023-06-15 Thread Jonathan Wakely via Gcc-patches
On Thu, 15 Jun 2023, 01:46 Alexandre Oliva via Libstdc++, < libstd...@gcc.gnu.org> wrote: > > Contributing a patch by Joel Brobecker . > Regstrapped on x86_64-linux-gnu just to be sure, also tested with > aarch64-rtems6. I'm going to put this in later this week if there > aren't any objections.

Re: [PATCH] libstdc++: Clarify manual demangle doc

2023-06-14 Thread Jonathan Wakely via Gcc-patches
On Sat, 10 Jun 2023 at 23:04, Jonny Grant wrote: > > libstdc++-v3/ChangeLog: > > * doc/xml/manual/extensions.xml: Remove demangle exception > description and include. Thanks, pushed to trunk. > > --- > libstdc++-v3/doc/xml/manual/extensions.xml | 6 ++ > 1 file changed, 2

Re: [PATCH] (Re: Splitting up 27_io/basic_istream/ignore/wchar_t/94749.cc (takes too long))

2023-06-10 Thread Jonathan Wakely via Gcc-patches
On Sat, 10 Jun 2023, 06:18 Hans-Peter Nilsson via Libstdc++, < libstd...@gcc.gnu.org> wrote: > Thank you for your consideration. (Or is that phrase only used > negatively?) > > > From: Jonathan Wakely > > Date: Fri, 9 Jun 2023 21:40:15 +0100 > > > test01,

Re: Splitting up 27_io/basic_istream/ignore/wchar_t/94749.cc (takes too long)

2023-06-09 Thread Jonathan Wakely via Gcc-patches
On Fri, 9 Jun 2023 at 17:20, Hans-Peter Nilsson wrote: > Hi! > > The test 27_io/basic_istream/ignore/wchar_t/94749.cc takes > about 10 minutes to run for cris-elf in the "gdb simulator" > here on my arguably way-past-retirement machine (and it > looks like it gained a minute with LRA). I've

[committed] libstdc++: Remove duplicate definition of _Float128 std::from_chars [PR110077]

2023-06-09 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, sparc-solaris. Pushed to trunk. -- >8 -- When long double uses IEEE binary128 representation we define the _Float128 overload of std::from_chars inline in . My changes in r14-1431-g7037e7b6e4ac41 cause it to also be defined non-inline in the library, leading to an

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