[committed] libstdc++: Use __is_single_threaded in locale initialization

2021-11-19 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. This replaces a __gthread_active_p() check with __is_single_threaded() so that std::locale initialization doesn't use __gthread_once if it happens before the first thread is created. This means that _S_initialize_once() might now be called twice instead of o

[committed] libstdc++: Improve tests for stringstream constructors in C++20

2021-11-19 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. This ensures all constructors are checked. libstdc++-v3/ChangeLog: * testsuite/27_io/basic_istringstream/cons/char/1.cc: Check all constructors. * testsuite/27_io/basic_istringstream/cons/wchar_t/1.cc: Likewise. * tes

[committed] analyzer: fix false leak due to overeager state merging [PR103217]

2021-11-19 Thread David Malcolm via Gcc-patches
PR analyzer/103217 reports a false positive from -Wanalyzer-malloc-leak. The root cause is due to overzealous state merger, where the state-merging code decided to merge these two states by merging the stores: state A: clusters within frame: ‘main’@1 cluster for: one_3: CONJURED(val_4 = str

Re: [PATCH] gcc: vxworks: fix providing stdint.h header

2021-11-19 Thread Rasmus Villemoes
On 19/11/2021 19.11, Olivier Hainque wrote: > Hi Rasmus, > >> On 12 Nov 2021, at 17:35, Olivier Hainque wrote: > > Your error triggers on O2ggnu++0x.gch and we configure with > --disable-libstdcxx-pch. > > Can you see if adding this to your configuration options helps > on your end? ISTR I alr

[PATCH] gcc, doc: Fix Darwin bootstrap: Amend an @option command to elide a space.

2021-11-19 Thread Iain Sandoe via Gcc-patches
At least some version(s) of makeinfo (4.8) do not like @option {-} the brace has to follow the @option without any whitespace. makeinfo 4.8 is installed on Darwin systems and this breaks bootstrap. The amendment follows the style of the surrounding code. tested on Darwin9, 18, 19, 20, 21, pus

Re: [PATCH 2/5] libstdc++: Apply modifications to our local copy of fast_float

2021-11-19 Thread Patrick Palka via Gcc-patches
On Mon, 15 Nov 2021, Patrick Palka wrote: > This performs the following modifications to our local copy of fast_float > in order to make it more readily usable in our std::from_chars > implementation: > > * Remove system #includes > * Replace stray call to assert > * Use the standard librar

Re: [PATCH 3/5] libstdc++: Adjust fast_float's over/underflow behavior for conformnace

2021-11-19 Thread Patrick Palka via Gcc-patches
On Mon, 15 Nov 2021, Patrick Palka wrote: > This makes fast_float handle the situation where std::from_chars is > specified to return result_out_of_range, i.e. when the parsed value > is outside the representable range of the floating-point type. > > libstdc++-v3/ChangeLog: > > * src/c++17

Re: [PATCH 2/6] Add returns_zero_on_success/failure attributes

2021-11-19 Thread Segher Boessenkool
On Thu, Nov 18, 2021 at 06:45:42PM -0500, David Malcolm wrote: > On Thu, 2021-11-18 at 14:08 -0600, Segher Boessenkool wrote: > > We need some way to describe these things in Gimple and RTL as well, > > and not just on function calls: also on other expressions.  Adding > > attributes that allow to

[PATCH] c++: -Wuninitialized for mem-inits and empty classes [PR19808]

2021-11-19 Thread Marek Polacek via Gcc-patches
This fixes a bogus -Wuninitialized warning: there's nothing to initialize in empty classes, so don't add them into our uninitialized set. Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? PR c++/19808 gcc/cp/ChangeLog: * init.c (emit_mem_initializers): Don't add is_re

Re: [PATCH 07/15] xtensa: Fix non-robust split condition in define_insn_and_split

2021-11-19 Thread augustine.sterling--- via Gcc-patches
On Thu, Nov 11, 2021 at 3:25 AM Kewen Lin wrote: > gcc/ChangeLog: > > * config/xtensa/xtensa.md (movdi_internal, movdf_internal): Fix split > condition. I had been hoping Max would reply (as I'm just doing legacy work around this these days), but seeing that he hasn't. This is app

Re: [RFC] c++: Print function template parms when relevant (was: [PATCH v4] c++: Add gnu::diagnose_as attribute)

2021-11-19 Thread Jason Merrill via Gcc-patches
On 11/19/21 04:53, Matthias Kretz wrote: On Thursday, 18 November 2021 20:24:36 CET Jason Merrill wrote: On 11/17/21 17:51, Matthias Kretz wrote: Right, I had already added a `gcc_assert (!TMPL_ARGS_HAVE_MULTIPLE_LEVELS (args))` to my new set_non_default_template_args_count function and found c

Re: [EXTERNAL] Re: [PATCH] PR tree-optimization/96779 Adding a missing pattern to match.pd

2021-11-19 Thread Navid Rahimi via Gcc-patches
Hi Richard, Thanks for the detailed comment. I am attaching a newer version of the patch which does have required fixes included. Bellow you can see my response to your feedbacks: > you need to check TYPE_OVERFLOW_WRAPS on TREE_TYPE (@0), > otherwise you check on boolean. Fixed it. > no need f

Re: [RFC] c++: Print function template parms when relevant (was: [PATCH v4] c++: Add gnu::diagnose_as attribute)

2021-11-19 Thread Matthias Kretz
On Friday, 19 November 2021 23:26:57 CET Jason Merrill wrote: > On 11/19/21 04:53, Matthias Kretz wrote: > > My motivation for printing a function template specialization differently > > is: > > > > 1. It's a different function definition that's being called. The user > > (caller) might be surpris

Re: [PATCH] gcc, doc: Fix Darwin bootstrap: Amend an @option command to elide a space.

2021-11-19 Thread Martin Jambor
Hi, On Fri, Nov 19 2021, Iain Sandoe wrote: > At least some version(s) of makeinfo (4.8) do not like @option {-} > the brace has to follow the @option without any whitespace. > > makeinfo 4.8 is installed on Darwin systems and this breaks bootstrap. > The amendment follows the style of the sur

Re: [PATCH] libgccjit: add some reflection functions in the jit C api

2021-11-19 Thread David Malcolm via Gcc-patches
On Mon, 2021-09-27 at 20:53 -0400, Antoni Boucher wrote: > I fixed an issue (it would show an error message when > gcc_jit_type_dyncast_function_ptr_type was called on a type different > than a function pointer type). > > Here's the updated patch. Sorry about the delay in responding. The updated

Re: [PATCH] libgccjit: Add support for setting the link section of global variables [PR100688]

2021-11-19 Thread Antoni Boucher via Gcc-patches
Thanks for your reviews! Here's the updated patch, ready for another review. See comments/questions below. I'll update the other patches over the weekend. Le jeudi 20 mai 2021 à 15:29 -0400, David Malcolm a écrit : > On Wed, 2021-05-19 at 20:32 -0400, Antoni Boucher via Jit wrote: > > Hello. > >

[PATCH] Fix tree-optimization/103220: Another missing folding of (type) X op CST where type is a nop convert

2021-11-19 Thread apinski--- via Gcc-patches
From: Andrew Pinski The problem here is that int_fits_type_p will return false if we just change the sign of things like -2 (or 254) so we should accept the case where we just change the sign (and not the precision) of the type. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions

Re: [PATCH] Fix tree-optimization/103220: Another missing folding of (type) X op CST where type is a nop convert

2021-11-19 Thread Richard Biener via Gcc-patches
On November 20, 2021 7:03:02 AM GMT+01:00, apinski--- via Gcc-patches wrote: >From: Andrew Pinski > >The problem here is that int_fits_type_p will return false if we just >change the sign of things like -2 (or 254) so we should accept the case >where we just change the sign (and not the precisio

<    1   2