Re: [pushed] c++: Include -Woverloaded-virtual in -Wall [PR87729]

2022-07-01 Thread Stephan Bergmann via Gcc-patches
On 6/25/22 00:26, Jason Merrill via Gcc-patches wrote: This seems like a good warning to have in -Wall, as requested. But as pointed out in PR20423, some users want a warning only when a derived function doesn't override any base function. So let's put that lesser version in -Wall (and -Woverlo

Re: [pushed] c++: Include -Woverloaded-virtual in -Wall [PR87729]

2022-07-05 Thread Stephan Bergmann via Gcc-patches
On 01/07/2022 22:30, Stephan Bergmann wrote: On 6/25/22 00:26, Jason Merrill via Gcc-patches wrote: This seems like a good warning to have in -Wall, as requested.  But as pointed out in PR20423, some users want a warning only when a derived function doesn't override any base function.  So let's

Re: [PATCH] c++: Add __reference_con{struc,ver}ts_from_temporary [PR104477]

2022-07-17 Thread Stephan Bergmann via Gcc-patches
On 7/15/22 22:25, Marek Polacek via Gcc-patches wrote: Yeah, I guess so. But I've already pushed the patch. This commit obviously breaks using libstdc++ with Clang (in -std=c++2b mode), which doesn't implement those new builtins. Something like the below would fix that, diff --git a/libs

trunk -D_GLIBCXX_DEBUG #include fails

2021-08-09 Thread Stephan Bergmann via Gcc-patches
Not sure why I started to experience this now with a recent GCC/libstdc++ trunk build: $ cat test.cc #include $ gcc/trunk/inst/bin/g++ -D_GLIBCXX_DEBUG -fsyntax-only test.cc In file included from /home/sbergman/gcc/trunk/inst/include/c++/12.0.0/bits/regex_automaton.h:401,

Re: trunk -D_GLIBCXX_DEBUG #include fails

2021-08-10 Thread Stephan Bergmann via Gcc-patches
On 09/08/2021 16:42, Jonathan Wakely via Gcc-patches wrote: This is what I'm testing. Thanks, that worked fine for my build of LibreOffice.

Re: [PATCH] c++: Fix up default initialization with consteval default ctor [PR96994]

2020-09-25 Thread Stephan Bergmann via Gcc-patches
On 15/09/2020 09:57, Jakub Jelinek via Gcc-patches wrote: The following testcase is miscompiled (in particular the a and i initialization). The problem is that build_special_member_call due to the immediate constructors (but not evaluated in constant expression mode) doesn't create a CALL_EXPR,

Re: [PATCH v4] eliminate mutex in fast path of __register_frame

2022-09-19 Thread Stephan Bergmann via Gcc-patches
On 16/09/2022 12:19, Thomas Neumann via Gcc-patches wrote: The __register_frame/__deregister_frame functions are used to register unwinding frames from JITed code in a sorted list. That list itself is protected by object_mutex, which leads to terrible performance in multi-threaded code and is som

Re: [PATCH v4] eliminate mutex in fast path of __register_frame

2022-09-19 Thread Stephan Bergmann via Gcc-patches
On 19/09/2022 15:55, Thomas Neumann wrote: Apparently a registered frame is not found when deregistering, which triggers an assert. I will debug this. Could you send me a script or a description on how to reproduce the issue? Thanks a lot! I'm in the process of checking whether a more generic

Re: [PATCH v4] eliminate mutex in fast path of __register_frame

2022-09-19 Thread Stephan Bergmann via Gcc-patches
On 19/09/2022 17:33, Thomas Neumann wrote: Can you try if the patch below fixes the problem? It keeps the data structures alive at shutdown, though, which will probably make some leak detectors unhappy. Alternatively we could simply remove the gcc_assert (ob) in line 285 of that file. As far

Re: PING 4 [PATCH v2 2/2] add -Wdangling-pointer [PR #63272]

2022-01-19 Thread Stephan Bergmann via Gcc-patches
On 17/01/2022 20:14, Martin Sebor wrote: I tried to set up OpenOffice for testing with the latest GCC but couldn't get the build to finish (it failed downloading some unavailable prerequisites).  I don't remember what problem I ran into with LibreOffice; it was before I upgraded to Fedora 35 just

std::basic_string<_Tp> constructor point of instantiation woes?

2021-11-22 Thread Stephan Bergmann via Gcc-patches
When using recent libstc++ trunk with Clang in C++20 mode, std::u16string literals as in #include int main() { using namespace std::literals; u""s; } started to cause linker failures due to undefined _ZNSt7__cxx1112basic_stringIDsSt11char_traitsIDsESaIDsEE12_M_constructIPKDsEEvT_S8_St2

Re: [PATCH] libcpp: Implement -Wbidi-chars for CVE-2021-42574 [PR103026]

2021-11-30 Thread Stephan Bergmann via Gcc-patches
On 15/11/2021 18:28, Marek Polacek via Gcc-patches wrote: On Mon, Nov 08, 2021 at 04:33:43PM -0500, Marek Polacek wrote: Ping, can we conclude on the name? IMHO, -Wbidirectional is just fine, but changing the name is a trivial operation. Here's a patch with a better name (suggested by Jonath

Re: [PATCH] libcpp: Implement -Wbidi-chars for CVE-2021-42574 [PR103026]

2021-11-30 Thread Stephan Bergmann via Gcc-patches
On 30/11/2021 14:26, Marek Polacek wrote: On Tue, Nov 30, 2021 at 09:38:57AM +0100, Stephan Bergmann wrote: On 15/11/2021 18:28, Marek Polacek via Gcc-patches wrote: On Mon, Nov 08, 2021 at 04:33:43PM -0500, Marek Polacek wrote: Ping, can we conclude on the name? IMHO, -Wbidirectional is jus

Re: [PATCH] c++: Extend -Wpessimizing-move to other contexts

2022-08-22 Thread Stephan Bergmann via Gcc-patches
On 16/08/2022 14:27, Marek Polacek via Gcc-patches wrote: Ping. (The other std::move patches depend on this one.) "c++: Extend -Wpessimizing-move to other contexts" started to cause false positive $ c

Re: [committed] libstdc++: Allow Lemire's algorithm to be used in more cases

2020-11-03 Thread Stephan Bergmann via Gcc-patches
On 29/10/2020 15:59, Jonathan Wakely via Gcc-patches wrote: This extends the fast path to also work when the URBG's range of possible values is not the entire range of its result_type. Previously, the slow path would be used for engines with a uint_fast32_t result type if that type is actually a

Re: [committed] libstdc++: Allow Lemire's algorithm to be used in more cases

2020-11-04 Thread Stephan Bergmann via Gcc-patches
On 03/11/2020 23:25, Jonathan Wakely wrote: On 03/11/20 22:28 +0100, Stephan Bergmann via Libstdc++ wrote: On 29/10/2020 15:59, Jonathan Wakely via Gcc-patches wrote: This extends the fast path to also work when the URBG's range of possible values is not the entire range of its result_type. Pre

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

2020-11-04 Thread Stephan Bergmann via Gcc-patches
On 07/10/2020 18:55, Thomas Rodgers wrote: From: Thomas Rodgers New ctors and ::view() accessor for - * basic_stingbuf * basic_istringstream * basic_ostringstream * basic_stringstreamm New ::get_allocator() accessor for basic_stringbuf. I found that this

Re: [PATCH] libstdc++: Make chrono::hh_mm_ss more compact

2022-12-11 Thread Stephan Bergmann via Gcc-patches
On 11/21/22 21:43, Jonathan Wakely via Libstdc++ wrote: + static constexpr bool __is_unsigned + = __and_v, + is_unsigned>; Using `__is_unsigned` as an identifier here causes compilation issues with Clang, which predefines that as a builtin predicate.

Re: [PATCH] libstdc++: Make chrono::hh_mm_ss more compact

2022-12-12 Thread Stephan Bergmann via Gcc-patches
On 12/12/2022 12:18, Jonathan Wakely wrote: If Clang already treats __is_signed as a conditionally-active built-in, it should do the same for __is_unsigned. Wasn't aware of that special handling of __is_signed. Filed "Also allow __is_unsigned to be used as

Re: [pushed] c++: build initializer_list in a loop [PR105838]

2022-12-13 Thread Stephan Bergmann via Gcc-patches
On 08/12/2022 19:45, Jason Merrill via Gcc-patches wrote: Tested x86_64-pc-linux-gnu, applying to trunk. Bisecting shows this started to break $ cat test.cc #include template struct ConstCharArrayDetector; template struct ConstCharArrayDetector { using Type = int; }; struct OUString { t

Re: [pushed] c++: avoid initializer_list [PR105838]

2022-12-14 Thread Stephan Bergmann via Gcc-patches
On 12/8/22 19:41, Jason Merrill via Gcc-patches wrote: Tested x86_64-pc-linux-gnu, applying to trunk. Bisecting shows this started to break $ cat test.cc #include template struct ConstCharArrayDetector; template struct ConstCharArrayDetector { using Type = int; }; struct OUString { temp

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

2020-11-22 Thread Stephan Bergmann via Gcc-patches
On 20/11/2020 23:44, Thomas Rodgers wrote: Tested x86_64-pc-linux-gnu, committed. Clang complains: $ cat test.cc #include $ clang++ --gcc-toolchain=~/gcc/trunk/inst -std=c++20 -fsyntax-only test.cc In file included from test.cc:1: In file included from ~/gcc/trunk/inst/lib/gcc/x86_64-pc-li

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

2020-11-22 Thread Stephan Bergmann via Gcc-patches
On 20/11/2020 23:44, Thomas Rodgers wrote: Tested x86_64-pc-linux-gnu, committed. ...and there are multiple definition complaints from the linker because of two missing "include": index 7b2682a577e..23ab2018ca8 100644 --- a/libstdc++-v3/include/bits/atomic_wait.h +++ b/libstdc++-v3/include/

Re: [committed] libstdc++: Use __libc_single_threaded for locale initialization

2020-11-27 Thread Stephan Bergmann via Gcc-patches
On 24/11/2020 15:59, Jonathan Wakely via Gcc-patches wrote: Most initialization of locales and facets happens before main() during startup, when the program is likely to only have one thread. By using the new __gnu_cxx::__is_single_threaded() function instead of checking __gthread_active_p() we c

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

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

Re: [committed] libstdc++: Simplify std::shared_ptr construction from std::weak_ptr

2020-10-26 Thread Stephan Bergmann via Gcc-patches
On 21/10/2020 22:14, Jonathan Wakely via Gcc-patches wrote: The _M_add_ref_lock() and _M_add_ref_lock_nothrow() members of _Sp_counted_base are very similar, except that the former throws an exception when the use count is zero and the latter returns false. The former (and its callers) can be imp

Re: [committed] libstdc++: Avoid redundant checks in std::use_facet [PR103755]

2022-11-11 Thread Stephan Bergmann via Gcc-patches
On 11/11/22 06:30, Jonathan Wakely via Gcc-patches wrote: As discussed in the PR, this makes it three times faster to construct iostreams objects. Tested x86_64-linux. Pushed to trunk. I haven't yet tried to track down what's going on, but with various versions of Clang (e.g. clang-15.0.4-1.f

Re: [PATCH (pushed)] sphinx: fix building if sphinx-build is missing

2022-11-13 Thread Stephan Bergmann via Gcc-patches
On 11/9/22 10:09, Martin Liška wrote: I noticed I modified Makefile.in files in the Sphinx series. While I was supposed to modifiky Makefile.am and use automake. I'm going to fix that soon. A recent master build against (apparently too old) python3-sphinx-5.0.2-2.fc37.noarch failed for me with

Re: [committed] libstdc++: Avoid redundant checks in std::use_facet [PR103755]

2022-11-13 Thread Stephan Bergmann via Gcc-patches
On 11/12/22 03:47, Jonathan Wakely wrote: On Fri, 11 Nov 2022 at 21:00, Stephan Bergmann wrote: On 11/11/22 06:30, Jonathan Wakely via Gcc-patches wrote: As discussed in the PR, this makes it three times faster to construct iostreams objects. Tested x86_64-linux. Pushed to trunk. I haven't

[PATCH] sphinx: more build fixing if sphinx-build is missing

2022-11-13 Thread Stephan Bergmann via Gcc-patches
...similar to 1f9c79367e136e0ca5b775562e6111e1a0d0046f "sphinx: fix building if sphinx-build is missing" gcc/ChangeLog: * fortran/Make-lang.in: Build info pages conditionally. --- gcc/fortran/Make-lang.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/fortra

Re: [PATCH (pushed)] sphinx: fix building if sphinx-build is missing

2022-11-13 Thread Stephan Bergmann via Gcc-patches
On 11/13/22 20:26, Martin Liška wrote: The patch is fine, please send it to gcc-patches ML and install it. I sent a patch now, but don't have commit rights.

Re: [committed] libstdc++: Reduce template instantiations in

2022-01-06 Thread Stephan Bergmann via Gcc-patches
On 05/01/2022 14:47, Jonathan Wakely via Libstdc++ wrote: Tested powerpc64le-linux, pushed to trunk. This moves the last two template parameters of __regex_algo_impl to be runtime function parameters instead, so that we don't need four different instantiations for the possible ways to call it.

Re: [PATCH] libcpp: Implement -Wbidi-chars for CVE-2021-42574 [PR103026]

2022-01-14 Thread Stephan Bergmann via Gcc-patches
On 30/11/2021 16:27, Marek Polacek wrote: I guess we were concerned with programs that generate other programs. Maybe UCNs should be ignored by default. There's still time to adjust the behavior. Is there any update on this? Shall I file a bug? As-is, -Wbidi-chars is unusable for building L

Re: [PATCH] libcpp: Implement -Wbidi-chars for CVE-2021-42574 [PR103026]

2022-01-14 Thread Stephan Bergmann via Gcc-patches
On 14/01/2022 14:28, Marek Polacek wrote: On Fri, Jan 14, 2022 at 10:23:16AM +0100, Stephan Bergmann wrote: On 30/11/2021 16:27, Marek Polacek wrote: I guess we were concerned with programs that generate other programs. Maybe UCNs should be ignored by default. There's still time to adjust the

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

2022-01-17 Thread Stephan Bergmann via Gcc-patches
On 1/17/22 01:12, Jonathan Wakely via Libstdc++ wrote: Here's the finished version of that patch, which is all inline in the header, and performs faster too. Tested powerpc64le-linux and x86_64-linux. Pushed to trunk. FYI, recent Clang still requires typename in two places to compile with -s

Re: PING 4 [PATCH v2 2/2] add -Wdangling-pointer [PR #63272]

2022-01-17 Thread Stephan Bergmann via Gcc-patches
On 10/01/2022 22:51, Martin Sebor via Gcc-patches wrote: Last ping for this stage 1 feature before stage 3 ends: https://gcc.gnu.org/pipermail/gcc-patches/2021-November/585819.html This hits somewhat unexpectedly at (test case reduced from a hit in LibreOffice) $ cat test.cc #include struc

Re: [PATCH] PR libstdc++/80624 satisfy invariant for char_traits::eof()

2017-05-08 Thread Stephan Bergmann via gcc-patches
On 05/05/2017 07:05 PM, Jonathan Wakely wrote: As discussed at http://stackoverflow.com/q/43769773/981959 (and kinda hinted at by http://wg21.link/lwg1200) there's a problem with char_traits::eof() because it returns int_type(-1) which is the same value as u'\u', a valid UTF-16 code point. i