Re: [PATCH v2 2/3] gimple-fold: Use ranges to simplify _chk calls

2021-11-15 Thread Siddhesh Poyarekar
On 11/16/21 01:55, Jeff Law wrote: On 11/15/2021 10:33 AM, Siddhesh Poyarekar wrote: Instead of comparing LEN and SIZE only if they are constants, use their ranges to decide if LEN will always be lower than or same as SIZE. This change ends up putting the stringop-overflow warning line number

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

2021-11-15 Thread David Malcolm via Gcc-patches
> 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 Jonathan W.). Otherwise no > changes. Thanks for im

Re: [PATCH] c++: __builtin_bit_cast To C array target type [PR103140]

2021-11-15 Thread will wray via Gcc-patches
Yes - direct use of any builtin is not to be encouraged, in user code. This __builtin_bit_cast patch is intended to encourage experimentation with array copy semantics now, on truck, in preparation for P1997. The builtin bit_cast is strictly more powerful than the std::bit_cast library function t

[pushed] c++: split_nonconstant_init and flexarrays

2021-11-15 Thread Jason Merrill via Gcc-patches
split_nonconstant_init was doing the wrong thing for both the initialization and cleanup here; we know the size from the initializer, and we can pass it along. This doesn't make the testcase work, since the y destructor is still broken, but it removes the wrong error for the aggregate initializati

Re: [PATCH] Combine malloc + memset to calloc

2021-11-15 Thread Iain Buclaw via Gcc-patches
Excerpts from Seija K. via Gcc-patches's message of November 12, 2021 9:29 pm: > diff --git a/gcc/d/dmd/ctfeexpr.c b/gcc/d/dmd/ctfeexpr.c > index a8e97833ad0..401ed748f43 100644 > --- a/gcc/d/dmd/ctfeexpr.c > +++ b/gcc/d/dmd/ctfeexpr.c > @@ -1350,8 +1350,7 @@ int ctfeRawCmp(Loc loc, Expression *e1,

Re: [PATCH 1/4] Generate off-stack nested function trampolines

2021-11-15 Thread Joseph Myers
On Sat, 13 Nov 2021, Maxim Blinov wrote: > the target specifically requires it, or you manually provide > --enable-off-stack-trampolines when configuring gcc/libgcc. If you're adding a new configure option, it needs documenting in install.texi. -- Joseph S. Myers jos...@codesourcery.com

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

2021-11-15 Thread Patrick Palka via Gcc-patches
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 library chars_format and from_chars_result types libstdc++-v3/

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

2021-11-15 Thread Patrick Palka via Gcc-patches
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/fast_float/LOCAL_PATCHES: Update. * src/c++17/

[PATCH 4/5] libstdc++: Use fast_float in std::from_chars for binary32/64

2021-11-15 Thread Patrick Palka via Gcc-patches
This makes our std::from_chars implementation use fast_float for parsing chars_format::scientific/fixed/general parsing into binary32/64 values. For chars_format::hex (and long double) we still use the fallback implementation that goes through the strtod family of functions. libstdc++-v3/ChangeLog

[PATCH 1/5] libstdc++: Import the fast_float library

2021-11-15 Thread Patrick Palka via Gcc-patches
This copies the fast_float library[1] into the compiled-in library sources. We're going to use this library in our floating-point std::from_chars implementation for faster and more portable parsing of binary32/64 decimal strings. [1]: https://github.com/fastfloat/fast_float Series tested on x86_

[PATCH] libstdc++: Merge latest Ryu sources

2021-11-15 Thread Patrick Palka via Gcc-patches
The only source change is a speedup to pow5Factor. Tested on x86_64-pc-linux-gnu, does this look OK for trunk? libstdc++-v3/ChangeLog: * src/c++17/ryu/MERGE: Update the commit hash. * src/c++17/ryu/d2s_intrinsics.h: Merge from Ryu's master branch. --- libstdc++-v3/src/c+

Re: [PATCH] c++: designated init of char array by string constant [PR55227]

2021-11-15 Thread Marek Polacek via Gcc-patches
Hi, thanks for the patch and sorry for the delay in reviewing. On Sat, Nov 06, 2021 at 08:17:23PM -0400, Will Wray via Gcc-patches wrote: > This patch aims to fix https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55227. > > There are two underlying bugs in the designated initialization of char array

[PATCH] Update my email address.

2021-11-15 Thread Jim Wilson via Gcc-patches
I've left SiFive and have a new gmail account because it is convenient to use with git send-email. I'm planning to use this for my RISC-V work. My tuliptree address still works, it just isn't as convenient. * MAINTAINERS: Update my address. --- MAINTAINERS | 2 +- 1 file changed, 1 inse

[PATCH] Fix spelling of ones' complement.

2021-11-15 Thread Marek Polacek via Gcc-patches
Nitpicking time. It's spelled "ones' complement" rather than "one's complement". I didn't go into config/. Ok for trunk? gcc/ChangeLog: * doc/implement-c.texi: Fix spelling. * doc/md.texi: Likewise. * expmed.c (emit_store_flag_int): Likewise. * optabs.c (expand_

Re: [PATCH] Fix spelling of ones' complement.

2021-11-15 Thread Koning, Paul via Gcc-patches
> On Nov 15, 2021, at 8:48 PM, Marek Polacek via Gcc-patches > wrote: > > Nitpicking time. It's spelled "ones' complement" rather than "one's > complement". Is that so? I see Wikipedia claims it is, but there are no sources for that claim. (There is an assertion that it is "discussed at

[PATCH, rs6000] Optimization for vec_xl_sext

2021-11-15 Thread HAO CHEN GUI via Gcc-patches
Hi,    The patch optimizes the code generation for vec_xl_sext builtin. Now all the  sign extensions are done on VSX registers directly.    Bootstrapped and tested on powerpc64le-linux with no regressions. Is this  okay for trunk? Any recommendations? Thanks a lot. ChangeLog 2021-11-16 Haochen

Re: [PATCH] Fix spelling of ones' complement.

2021-11-15 Thread Marek Polacek via Gcc-patches
On Tue, Nov 16, 2021 at 02:01:47AM +, Koning, Paul via Gcc-patches wrote: > > > > On Nov 15, 2021, at 8:48 PM, Marek Polacek via Gcc-patches > > wrote: > > > > Nitpicking time. It's spelled "ones' complement" rather than "one's > > complement". > > Is that so? I see Wikipedia claims it

Re: [PATCH] Remove MAY_HAVE_DEBUG_MARKER_STMTS and MAY_HAVE_DEBUG_BIND_STMTS.

2021-11-15 Thread Jeff Law via Gcc-patches
On 11/12/2021 7:37 AM, Martin Liška wrote: @Alexandre: PING On 10/18/21 12:05, Richard Biener wrote: On Mon, Oct 18, 2021 at 10:54 AM Martin Liška wrote: The macros correspond 1:1 to an option flags and make it harder to find all usages of the flags. Patch can bootstrap on x86_64-linux-g

Re: [PATCH] Avoid pathological function redeclarations when checking access sizes [PR102759]

2021-11-15 Thread Jeff Law via Gcc-patches
On 11/15/2021 1:31 PM, Martin Sebor via Gcc-patches wrote: Declaring a function with a prototype at block scope and then redeclaring it without a prototype at file scope results in losing the prototype but not the attribute access that was implicitly added to the function decl based on the pro

Re: [PATCH] PCH: Make the save and restore diagnostics more robust.

2021-11-15 Thread Jeff Law via Gcc-patches
On 11/13/2021 6:10 AM, Iain Sandoe via Gcc-patches wrote: When saving, if we cannot obtain a suitable memory segment there is no point in continuing, so exit with an error. When reading in the PCH, we have a situation that the read-in data will replace the line tables used by the diagnostics

[PATCH] tree-optimization: [PR103245] Improve detection of abs pattern using multiplication

2021-11-15 Thread apinski--- via Gcc-patches
From: Andrew Pinski So while working on PR 103228 (and a few others), I noticed the testcase for PR 94785 was failing. The problem is that the nop_convert moved from being inside the IOR to be outside of it. I also noticed the patch for PR 103228 was not needed to reproduce the issue either. T

Re: [PATCH] tree-optimization: [PR103245] Improve detection of abs pattern using multiplication

2021-11-15 Thread Jeff Law via Gcc-patches
On 11/15/2021 7:53 PM, apinski--- via Gcc-patches wrote: From: Andrew Pinski So while working on PR 103228 (and a few others), I noticed the testcase for PR 94785 was failing. The problem is that the nop_convert moved from being inside the IOR to be outside of it. I also noticed the patch

[PATCH] Add a missing return transforming atomic bit test and operations

2021-11-15 Thread H.J. Lu via Gcc-patches
When failing to transform equivalent, but slighly different cases of atomic bit test and operations to their canonical forms, return immediately. gcc/ PR middle-end/103268 * tree-ssa-ccp.c (optimize_atomic_bit_test_and): Add a missing return. gcc/testsuite/ PR mi

Re: [PATCH] Add a missing return transforming atomic bit test and operations

2021-11-15 Thread Jeff Law via Gcc-patches
On 11/15/2021 8:18 PM, H.J. Lu via Gcc-patches wrote: When failing to transform equivalent, but slighly different cases of atomic bit test and operations to their canonical forms, return immediately. gcc/ PR middle-end/103268 * tree-ssa-ccp.c (optimize_atomic_bit_test_and): A

[PATCH] Fix PR tree-optimization/103228 and 103228: folding of (type) X op CST where type is a nop convert

2021-11-15 Thread apinski--- via Gcc-patches
From: Andrew Pinski Currently we fold (type) X op CST into (type) (X op ((type-x) CST)) when the conversion widens but not when the conversion is a nop. For the same reason why we move the widening conversion (the possibility of removing an extra conversion), we should do the same if the conve

Re: [PATCH] configure: define TARGET_LIBC_GNUSTACK on musl

2021-11-15 Thread Ilya Lipnitskiy via Gcc-patches
On Mon, Nov 15, 2021 at 2:50 PM Jeff Law wrote: > > > > On 11/15/2021 1:25 AM, Ilya Lipnitskiy via Gcc-patches wrote: > > musl only uses PT_GNU_STACK to set default thread stack size and has no > > executable stack support[0], so there is no reason not to emit the > > .note.GNU-stack section on mu

[PATCH v2] configure: define TARGET_LIBC_GNUSTACK on musl

2021-11-15 Thread Ilya Lipnitskiy via Gcc-patches
musl only uses PT_GNU_STACK to set default thread stack size and has no executable stack support[0], so there is no reason not to emit the .note.GNU-stack section on musl builds. [0]: https://lore.kernel.org/all/20190423192534.gn23...@brightrain.aerifal.cx/T/#u gcc/ChangeLog: * configur

Re: [PATCH] Fix spelling of ones' complement.

2021-11-15 Thread Aldy Hernandez via Gcc-patches
On Tue, Nov 16, 2021, 03:20 Marek Polacek via Gcc-patches < gcc-patches@gcc.gnu.org> wrote: > On Tue, Nov 16, 2021 at 02:01:47AM +, Koning, Paul via Gcc-patches > wrote: > > > > > > > On Nov 15, 2021, at 8:48 PM, Marek Polacek via Gcc-patches < > gcc-patches@gcc.gnu.org> wrote: > > > > > > Nit

<    1   2