Re: [PATCH] phiopt, math-opts: Adjust spaceship_replacement and optimize_spaceship for recent libstdc++ changes [PR121698]

2025-08-29 Thread Andrew Pinski
On Fri, Aug 29, 2025 at 11:39 PM Jakub Jelinek wrote: > > Hi! > > libstdc++ changed its ABI in for C++20 recently (under the > C++20 is still experimental rule). In addition to the -1, 0, 1 values > for less, equal, greater it now uses -128 for unordered instead of > former 2 and changes some of

[PATCH] phiopt, math-opts: Adjust spaceship_replacement and optimize_spaceship for recent libstdc++ changes [PR121698]

2025-08-29 Thread Jakub Jelinek
Hi! libstdc++ changed its ABI in for C++20 recently (under the C++20 is still experimental rule). In addition to the -1, 0, 1 values for less, equal, greater it now uses -128 for unordered instead of former 2 and changes some of the operators, instead of checks like (_M_value & ~1) == _M_value i

RE: [PATCH] x86-64: Use UNSPEC_DTPOFF to check source operand in TLS64_COMBINE

2025-08-29 Thread Liu, Hongtao
> -Original Message- > From: H.J. Lu > Sent: Saturday, August 30, 2025 7:49 AM > To: gcc-patches@gcc.gnu.org > Cc: Liu, Hongtao ; ubiz...@gmail.com > Subject: [PATCH] x86-64: Use UNSPEC_DTPOFF to check source operand in > TLS64_COMBINE > > Since the first operand of PLUS in the source

Re: [PATCH] forwprop: Copy the memcmp optimization from strlen to forwprop [PR116651]

2025-08-29 Thread Andrew Pinski
On Fri, Aug 29, 2025 at 12:31 AM Richard Biener wrote: > > On Fri, Aug 29, 2025 at 6:33 AM Andrew Pinski > wrote: > > > > To better optimize code dealing with `memcmp == 0` where we have > > a small constant size, we can inline the memcmp in those cases. > > There is code to do this in strlen but

[Patch][RFC?] libgomp: Init hash table for 'indirect'-clause of 'declare target' on the host [PR114445, PR119857]

2025-08-29 Thread Tobias Burnus
The main motivation for this patch is that on MI300, libgomp.c-c++-common/declare-target-indirect-2.c always fails because of the known fragile/racy code - as noticed before (PR114445 and PR119857), albeit triggering the fail has become more reliably. 'indirect' means that such-tagged functions a

[PATCH] x86-64: Use UNSPEC_DTPOFF to check source operand in TLS64_COMBINE

2025-08-29 Thread H.J. Lu
Since the first operand of PLUS in the source of TLS64_COMBINE pattern: (set (reg/f:DI 128) (plus:DI (unspec:DI [ (symbol_ref:DI ("_TLS_MODULE_BASE_") [flags 0x10]) (reg:DI 126) (reg/f:DI 7 sp) ] UNSPEC_TLSDESC) (const:DI (uns

Re: [RFC] c++: Vectorizing default struct and std::array equality

2025-08-29 Thread Andrew Pinski
On Thu, Aug 28, 2025 at 8:25 AM Thomas de Bock wrote: > > From 289487b58709575a90fca0cbebc6ae968aba73ab Mon Sep 17 00:00:00 2001 > From: Thomas de Bock > Date: Thu, 28 Aug 2025 16:10:08 +0100 > Subject: [PATCH] Vectorizing default struct and std::array equality > > --- > > Notes: > Added 2 SS

[pushed] PR modula2/121709: Failed bootstrap in m2

2025-08-29 Thread Gaius Mulley
This patch is a followup to PR modula2/121629 which uses the cpp_include_defaults array to configure the default search path entries. In particular it creates default search paths based on LOCAL_INCLUDE_DIR, PREFIX_INCLUDE_DIR, gcc version path and NATIVE_SYSTEM_HEADER_DIR. gcc/m2/ChangeLog:

Re: [RFC] c++: Vectorizing default struct and std::array equality

2025-08-29 Thread Sam James
Thomas de Bock writes: > From 289487b58709575a90fca0cbebc6ae968aba73ab Mon Sep 17 00:00:00 2001 > From: Thomas de Bock > Date: Thu, 28 Aug 2025 16:10:08 +0100 > Subject: [PATCH] Vectorizing default struct and std::array equality Not a review (and I'm not the person to do it), but some small com

[PATCH] Fix assertion when trying to represent Ada arrays in CodeView

2025-08-29 Thread Mark Harmstone
The LF_ARRAY CodeView type represents a C- or C++-style array, which a length known at compile time. We were crashing when using -gcodeview with Ada (bug #121157), as the DW_AT_upper_bound value is not an unsigned integer but something more complicated: 0x0123: DW_TAG_array_type

Re: [PATCH v2] c++: Fix miscompilation on array subscription with COND_EXPR as the array

2025-08-29 Thread Jason Merrill
On 8/28/25 12:33 PM, Sirui Mu wrote: Hello, This is the 2nd version of the patch. Changes made since the initial version: - Implemented Jason's suggestions, move the declaration of first down. - Add signed-off-by to the commit. Please preserve the rationale in later revisions of the patc

Re: [RFC] libstdc++: Refactor _Variadic_union so _Unitialized is not needed.

2025-08-29 Thread Tomasz Kaminski
On Fri, Aug 29, 2025 at 5:16 PM Patrick Palka wrote: > On Fri, 29 Aug 2025, Tomasz Kamiński wrote: > > > The changes the _Variadic_union implementation, in a way that the > > _Unitialized partial specialization for non-trivial types is > not > > necessary. > > > > This is simply done by separati

Re: [committed v5] libstdc++: Implement C++26 features [PR119670]

2025-08-29 Thread Iain Sandoe
> On 29 Aug 2025, at 15:55, Jonathan Wakely wrote: > > On Fri, 29 Aug 2025 at 15:19, Rainer Orth > wrote: >> >> Hi Jonathan, >>> The src/c++26/debugging.cc file defines a global volatile int which can be set by debuggers to indicate when they are attached and detached from

Re: [PATCH] ctf: use HOST_WIDE_INT for type bit sizes [PR121411]

2025-08-29 Thread Jeff Law
On 8/25/25 2:20 PM, David Faust wrote: When translating type bit sizes from DWARF, ctf_die_bitsize was using uint32_t. For extremely large struct types, the bit size may be larger than 32-bits and hence truncated, which caused incorrect encoding for these huge structs rather than properly usi

[pushed: r16-3465] diagnostics: add GCC_DIAGNOSTICS_LOG

2025-08-29 Thread David Malcolm
Whilst experimenting with PR diagnostics/121039 (potentially capturing suppressed diagnostics in SARIF output), I found it very useful to have a text log from the diagnostic subsystem to track what it's doing and the decisions it's making (e.g. exactly when and why a diagnostic is being rejected).

Re: [PATCH] Fortran: improve compile-time checking of character dummy arguments [PR93330]

2025-08-29 Thread Harald Anlauf
Am 29.08.25 um 02:05 schrieb Jerry D: Yes, OK Harald. Thanks for the work. Thanks for the review! Pushed as r16-3462-g18e49f19f5907d. Harald Jerry

Re: [PATCH] rs6000: Use vector add when left shifting by 1

2025-08-29 Thread Segher Boessenkool
Hi! On Thu, Aug 14, 2025 at 11:27:10AM +0530, Avinash Jayakar wrote: > Below is a draft of the patch for PR119702. I request you to > please review it. I assume it is just a proposed patch for trunk, and it will allow you to resolve that PR? :-) > In vector extensions for rs6000, there is no i

[PATCH] fortran: implement conditional expression for fortran 2023

2025-08-29 Thread Yuao Ma
Hi Tobias, I have some updates about this patch. First, some good news: 1. The patch has been bootstrapped and tested with no regressions. This was achieved by limiting the type with only one 'sorry' case. 2. The frontend parsing now considers outer parentheses. And we also have some unresolved

Re: [PATCH 2/4] Separate reduction info and associate it with SLP nodes

2025-08-29 Thread Richard Biener
> Am 29.08.2025 um 15:21 schrieb Tamar Christina : > >  >> >> -Original Message- >> From: Richard Biener >> Sent: Friday, August 29, 2025 12:40 PM >> To: gcc-patches@gcc.gnu.org >> Cc: RISC-V CI ; Tamar Christina >> >> Subject: [PATCH 2/4] Separate reduction info and associate it wi

Re: [PATCH v3] xtensa: Rewrite bswapsi2_internal with compact syntax

2025-08-29 Thread Max Filippov
On Fri, Aug 29, 2025 at 3:55 AM Takayuki 'January June' Suwa wrote: > > Only minor comment correction. No change in operation. > > -- >8 -- > > Also, the omission of the instruction that sets the shift amount register > (SAR) to 8 is now more efficient: it is omitted if there was a previous > bsw

Re: [PATCH 09/14] lto: Add toplevel assembly heuristics

2025-08-29 Thread Andi Kleen
> > Can you point to that discussion? > > I'm not aware of a rejection of the new form in GCC 15, but in previous > discussions, their responses were: > * https://lore.kernel.org/all/87a64qo4th.ffs@tglx/ > * > https://lore.kernel.org/all/y3jj67tz9ta2a...@hirez.programming.kicks-ass.net/ > * > ht

Re: [PATCH 09/14] lto: Add toplevel assembly heuristics

2025-08-29 Thread Sam James
Andrew Pinski writes: > On Thu, Aug 28, 2025 at 2:26 PM Andi Kleen wrote: >> >> Jakub Jelinek writes: >> >> > On Wed, Aug 27, 2025 at 03:52:11PM +0200, Michal Jires wrote: >> >> This new pass heuristically detects symbols referenced by toplevel >> >> assembly to prevent their optimization. >> >

Re: [PATCH] ira: Remove the issue code in improve_allocation. [PR117838]

2025-08-29 Thread Vladimir Makarov
On 8/22/25 3:25 AM, yes wrote: From: "Cui, Lili" Hi, This patch aims to remove issue code in improve_allocation that was causing expensive allocno overflows. Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? Yes, you can commit it into the trunk with minor change (see Chang

Re: [PATCHv2] Error out stack-protector unavailability on AIX

2025-08-29 Thread Segher Boessenkool
Hi! Please cc: me on all rs6000 patches. I'm the only active maintainer of it and everything. David already okayed it, so everything did work out :-) Thanks everyone! > diff --git a/gcc/config/rs6000/aix.h b/gcc/config/rs6000/aix.h > index 9e7edbb2f22..5b03b068139 100644 > --- a/gcc/config/rs6

[PATCH] s390: Implement clz and ctz for SI mode

2025-08-29 Thread Juergen Christ
To properly implement __builtin_ffs for SI mode, implement clz and (for >= z17) ctz for SI mode. Otherwise, gcc falls back to a libcall which causes problems for Linux kernel code. Also adjust the C?Z_DEFINED_VALUE_AT_ZERO macros to return 2. Since the optabs now return exactly the value set by

Re: [PATCH v2 3/3] vect: Use strided loads for VMAT_STRIDED_SLP.

2025-08-29 Thread Robin Dapp
I think it might be possible that refactoring how we do VMAT_STRIDED_SLP vs VMAT_GATHER/SCATTER, at least and possibly specifically for the case of emulated handling would be a good thing. But it'll require experiments and see how it all fits together. I started experimenting some days ago and

[PATCH] Add default arch/tuning to shift-gf2p8affine test cases

2025-08-29 Thread Andi Kleen
From: Andi Kleen This makes them not fail during test suite runs with overriden arch or tunings. gcc/testsuite/ChangeLog: * gcc.target/i386/shift-gf2p8affine-1.c: Use -march=x86-64 -mtune-generic. * gcc.target/i386/shift-gf2p8affine-2.c: Dito. * gcc.target/i386

Re: [PATCHv2] libstdc++: Make syncbuf _S_get_mutex definition extern

2025-08-29 Thread Tomasz Kaminski
On Fri, Aug 29, 2025 at 4:53 PM Jonathan Wakely wrote: > On Fri, 29 Aug 2025 at 14:31, Tomasz Kaminski wrote: > > > > > > > > On Fri, Aug 29, 2025 at 2:06 AM Nathan Myers wrote: > >> > >> Changes in v2: > >> * Make a global function __syncbuf_get_mutex, not an extern template > >> instantiati

[to-be-committed][PR target/121548] Avoid bogus index into recog operand cache

2025-08-29 Thread Jeff Law
So the RISC-V port has attributes which indicate the index within the recog_data where certain operands will be found. For this BZ the default value for the merge_op_idx attribute on the given insn is "2". But the insn only has operands 0 & 1. So we do an out of bounds array access and boo

[PATCHv12] libstdc++: New generate_canonical impl (P0952, LWG2524) [PR119739]

2025-08-29 Thread Nathan Myers
Changes in v12: * use __builtin_popcountg() which works on all unsigned integer types. Changes in v11: * Add doxygen entry for generate_canonical. Changes in v10: * Rewrite entirely after consultation with P0952 authors. * Require radix2 for all float types. * Perform all intermediate calcul

Re: [PATCH] vect: gather/scatter scale fallback.

2025-08-29 Thread Robin Dapp
Thinking about it some more, it might make sense to do the sign swap tries inside vect_gather_scatter_fn_p as well. That wouldn't pollute the callers. I'm still pondering how safe swapping the sign is here. If we have signed indices there won't be any overflow and we should be able to switch t

Re: [r16-3364 Regression] FAIL: gcc.target/i386/shift-gf2p8affine-7.c scan-assembler-times vgf2p8affineqb 53 on Linux/x86_64

2025-08-29 Thread H.J. Lu
On Fri, Aug 29, 2025 at 8:00 AM Andi Kleen wrote: > > On Fri, Aug 29, 2025 at 05:19:18AM -0700, H.J. Lu wrote: > > On Thu, Aug 28, 2025 at 10:22 PM Andi Kleen wrote: > > > > > > > > > This patch should fix it. Please confirm. > > > > > > > > > diff --git a/gcc/testsuite/gcc.target/i386/shift-gf2p

Re: [RFC] libstdc++: Refactor _Variadic_union so _Unitialized is not needed.

2025-08-29 Thread Patrick Palka
On Fri, 29 Aug 2025, Patrick Palka wrote: > On Fri, 29 Aug 2025, Tomasz Kamiński wrote: > > > The changes the _Variadic_union implementation, in a way that the > > _Unitialized partial specialization for non-trivial types is not > > necessary. > > > > This is simply done by separating the speci

Re: [RFC] libstdc++: Refactor _Variadic_union so _Unitialized is not needed.

2025-08-29 Thread Tomasz Kaminski
Template depth in 267 in both cases. On Fri, Aug 29, 2025 at 5:21 PM Tomasz Kaminski wrote: > > > On Fri, Aug 29, 2025 at 5:16 PM Patrick Palka wrote: > >> On Fri, 29 Aug 2025, Tomasz Kamiński wrote: >> >> > The changes the _Variadic_union implementation, in a way that the >> > _Unitialized pa

Re: [r16-3364 Regression] FAIL: gcc.target/i386/shift-gf2p8affine-7.c scan-assembler-times vgf2p8affineqb 53 on Linux/x86_64

2025-08-29 Thread H.J. Lu
On Fri, Aug 29, 2025 at 8:18 AM H.J. Lu wrote: > > On Fri, Aug 29, 2025 at 8:00 AM Andi Kleen wrote: > > > > On Fri, Aug 29, 2025 at 05:19:18AM -0700, H.J. Lu wrote: > > > On Thu, Aug 28, 2025 at 10:22 PM Andi Kleen wrote: > > > > > > > > > > > > This patch should fix it. Please confirm. > > > >

Re: [RFC] libstdc++: Refactor _Variadic_union so _Unitialized is not needed.

2025-08-29 Thread Patrick Palka
On Fri, 29 Aug 2025, Tomasz Kamiński wrote: > The changes the _Variadic_union implementation, in a way that the > _Unitialized partial specialization for non-trivial types is not > necessary. > > This is simply done by separating the specialization for > __trivially_destructible > being true an

[PATCHv13] libstdc++: New generate_canonical impl (P0952, LWG2524) [PR119739]

2025-08-29 Thread Nathan Myers
Changes in v13: * Spell __STRICT_ANSI__ correctly. Changes in v12: * use __builtin_popcountg() which works on all unsigned integer types. Changes in v11: * Add doxygen entry for generate_canonical. Changes in v10: * Rewrite entirely after consultation with P0952 authors. * Require radix2 fo

Re: [r16-3364 Regression] FAIL: gcc.target/i386/shift-gf2p8affine-7.c scan-assembler-times vgf2p8affineqb 53 on Linux/x86_64

2025-08-29 Thread Andi Kleen
On Fri, Aug 29, 2025 at 05:19:18AM -0700, H.J. Lu wrote: > On Thu, Aug 28, 2025 at 10:22 PM Andi Kleen wrote: > > > > > > This patch should fix it. Please confirm. > > > > > > diff --git a/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-1.c > > b/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-1.

Re: [committed v5] libstdc++: Implement C++26 features [PR119670]

2025-08-29 Thread Jonathan Wakely
On Fri, 29 Aug 2025 at 15:19, Rainer Orth wrote: > > Hi Jonathan, > > > >> The src/c++26/debugging.cc file defines a global volatile int which can > >> be set by debuggers to indicate when they are attached and detached from > >> a running process. This allows std::is_debugger_present() to give a

Re: [committed v5] libstdc++: Implement C++26 features [PR119670]

2025-08-29 Thread Jonathan Wakely
On Fri, 29 Aug 2025 at 15:12, Rainer Orth wrote: > > Hi Jonathan, > > > The src/c++26/debugging.cc file defines a global volatile int which can > > be set by debuggers to indicate when they are attached and detached from > > a running process. This allows std::is_debugger_present() to give a > > r

Re: [PATCHv2] libstdc++: Make syncbuf _S_get_mutex definition extern

2025-08-29 Thread Jonathan Wakely
On Fri, 29 Aug 2025 at 14:31, Tomasz Kaminski wrote: > > > > On Fri, Aug 29, 2025 at 2:06 AM Nathan Myers wrote: >> >> Changes in v2: >> * Make a global function __syncbuf_get_mutex, not an extern template >> instantiation. >> >> This patch creates a global function __syncbuf_get_mutex, gated b

Re: [committed] invoke.texi: AMD GCN - remove '(experimental)' from some gfx*-generic [was: [patch] install.texi: For amdgcn, clarify which llvm-* binaries are required]

2025-08-29 Thread Sandra Loosemore
On 8/29/25 02:31, Tobias Burnus wrote: Hi Sandra, hi Andrew, hello world, Sandra Loosemore wrote: The GCC user manual lists all the *-generic options for -march as "Experimental".  Is that still the case?  If not, I'll consider a patch to remove "Experimental" as trivial enough to meet the obv

Re: [pushed] PR modula2/121629: adding third party modules

2025-08-29 Thread Rainer Orth
Hi Gaius, > This patch makes it easier to add third party modules. > cc1gm2 now appends the search directory prefix/include/m2 > to the search path for non dialect specific modules. > Prior to this it appends the dialect specific subdirectories > {m2pim,m2iso,m2log,m2min} with the appropriate dial

Re: [committed v5] libstdc++: Implement C++26 features [PR119670]

2025-08-29 Thread Rainer Orth
Hi Jonathan, > >> The src/c++26/debugging.cc file defines a global volatile int which can >> be set by debuggers to indicate when they are attached and detached from >> a running process. This allows std::is_debugger_present() to give a >> reliable answer, and additionally allows a debugger to cho

Re: [committed v5] libstdc++: Implement C++26 features [PR119670]

2025-08-29 Thread Rainer Orth
Hi Jonathan, > The src/c++26/debugging.cc file defines a global volatile int which can > be set by debuggers to indicate when they are attached and detached from > a running process. This allows std::is_debugger_present() to give a > reliable answer, and additionally allows a debugger to choose ho

Re: [PATCH 3/7] arm: fix MVE asrl lsll lsrl patterns

2025-08-29 Thread Christophe Lyon
On Fri, 29 Aug 2025 at 16:01, Richard Earnshaw wrote: > > On 29/08/2025 14:57, Christophe Lyon wrote: > > On Fri, 29 Aug 2025 at 15:50, Christophe Lyon > > wrote: > >> > >> On Fri, 29 Aug 2025 at 15:35, Richard Earnshaw > >> wrote: > >>> > >>> On 27/08/2025 15:45, Christophe Lyon wrote: >

Re: [PATCH 3/7] arm: fix MVE asrl lsll lsrl patterns

2025-08-29 Thread Richard Earnshaw
On 29/08/2025 14:57, Christophe Lyon wrote: On Fri, 29 Aug 2025 at 15:50, Christophe Lyon wrote: On Fri, 29 Aug 2025 at 15:35, Richard Earnshaw wrote: On 27/08/2025 15:45, Christophe Lyon wrote: The thumb2_asrl, thumb2_lsll and thumb2_lsrl patterns were incorrecly using (match_dup 0) for t

Re: [PATCH 3/7] arm: fix MVE asrl lsll lsrl patterns

2025-08-29 Thread Christophe Lyon
On Fri, 29 Aug 2025 at 15:50, Christophe Lyon wrote: > > On Fri, 29 Aug 2025 at 15:35, Richard Earnshaw > wrote: > > > > On 27/08/2025 15:45, Christophe Lyon wrote: > > > The thumb2_asrl, thumb2_lsll and thumb2_lsrl patterns were incorrecly > > > using (match_dup 0) for the first argument of the

Re: [PATCH 3/7] arm: fix MVE asrl lsll lsrl patterns

2025-08-29 Thread Christophe Lyon
On Fri, 29 Aug 2025 at 15:35, Richard Earnshaw wrote: > > On 27/08/2025 15:45, Christophe Lyon wrote: > > The thumb2_asrl, thumb2_lsll and thumb2_lsrl patterns were incorrecly > > using (match_dup 0) for the first argument of the shift operator. > > > > This patch replaces that with (match_operand

Re: [PATCH 3/7] arm: fix MVE asrl lsll lsrl patterns

2025-08-29 Thread Richard Earnshaw
On 27/08/2025 15:45, Christophe Lyon wrote: The thumb2_asrl, thumb2_lsll and thumb2_lsrl patterns were incorrecly using (match_dup 0) for the first argument of the shift operator. This patch replaces that with (match_operand:DI 1 arm_general_register_operandarm_general_register_operand "0") and

Re: [PATCHv2] libstdc++: Make syncbuf _S_get_mutex definition extern

2025-08-29 Thread Tomasz Kaminski
On Fri, Aug 29, 2025 at 2:06 AM Nathan Myers wrote: > Changes in v2: > * Make a global function __syncbuf_get_mutex, not an extern template > instantiation. > > This patch creates a global function __syncbuf_get_mutex, gated by > _GLIBCXX_HAS_GTHREADS, replacing a static instantiated member > _

Re: [PATCH 0/7 v4] Add Xandes vender extension support.

2025-08-29 Thread Jeff Law
On 8/27/25 2:33 AM, Kuan-Lin Chen wrote: Hi Jeff, As you mentioned, CI testing is flagging errors on xandesperf-2.c. I tried to reproduce the failure under the same conditions as CI, but all multilib variants for both newlib and Linux passed on my end. I’m unable to determine why the test cas

RE: [PATCH 2/4] Separate reduction info and associate it with SLP nodes

2025-08-29 Thread Tamar Christina
> -Original Message- > From: Richard Biener > Sent: Friday, August 29, 2025 12:40 PM > To: gcc-patches@gcc.gnu.org > Cc: RISC-V CI ; Tamar Christina > > Subject: [PATCH 2/4] Separate reduction info and associate it with SLP nodes > > The following splits out reduction related information

Re: [PATCH] RISC-V: Add patterns for vector-scalar IEEE floating-point min

2025-08-29 Thread Jeff Law
On 8/29/25 3:33 AM, Paul-Antoine Arras wrote: This pattern enables the combine pass (or late-combine, depending on the case) to merge a vec_duplicate into an unspec_vfmin RTL instruction. Before this patch, we have two instructions, e.g.: vfmv.v.f v2,fa0 vfmin.vv v1,v1,v2 A

Re: [PATCH] fixincludes: Replace fgrep in genfixes script

2025-08-29 Thread Jonathan Wakely
On Thu, 28 Aug 2025 at 18:55, Rainer Orth wrote: > > Hi Jonathan, > > > On Thu, 28 Aug 2025 at 18:40, Rainer Orth wrote: > >> > >> Hi Jonathan, > >> > >> > POSIX says fgrep is obsolescent and grep -F should be used instead. > >> > >> grep -F isn't portable, unfortunately At least it's not supporte

[RFC] c++: Guidance on P2686R4 [PR117784]

2025-08-29 Thread Jakub Jelinek
Hi! So, I had a look at the remaining part of C++26 P2686R4, which I think we really should implement for GCC 16 because people are already filing PRs about constexpr structured bindings or expansion statements not working the way they should in some cases. That plus the recent PR121670 and that

Re: [r16-3364 Regression] FAIL: gcc.target/i386/shift-gf2p8affine-7.c scan-assembler-times vgf2p8affineqb 53 on Linux/x86_64

2025-08-29 Thread H.J. Lu
On Thu, Aug 28, 2025 at 10:22 PM Andi Kleen wrote: > > > This patch should fix it. Please confirm. > > > diff --git a/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-1.c > b/gcc/testsuite/gcc.target/i386/shift-gf2p8affine-1.c > index e5be3a35538..cb576eb4498 100644 > --- a/gcc/testsuite/gcc.targe

Re: [PATCH v2 1/2] testsuite: arm: remove arm32 check from a few effective-targets

2025-08-29 Thread Richard Earnshaw
On 18/08/2025 18:32, Christophe Lyon wrote: On Mon, 18 Aug 2025 at 19:24, Christophe Lyon wrote: A few arm effective-targets call check_effective_target_arm32 even though they would force a -march=XXX flag which supports Arm and/or Thumb-2, thus making the arm32 check useless. This has an imp

Re: [PATCH] ira: Remove the issue code in improve_allocation. [PR117838]

2025-08-29 Thread Vladimir Makarov
On 8/29/25 1:45 AM, Cui, Lili wrote: Gentle ping for this patch. I am evaluating the patch on SPEC2017.  When I finish this, I most probably give an approval. Thank you.

Re: [PATCH] tree-optimization: fabs(a+0.0) -> fabs(a) for non trapping case

2025-08-29 Thread Matteo Nicoli
Here’s the patch with the modified comment before the rule in match.pd tree-optimization-121595.patch Description: Binary data > On Aug 29, 2025, at 12:53 PM, Richard Biener > wrote: > > On Fri, Aug 29, 2025 at 10:56 AM Matteo Nicoli > wrote: >> >> Dear Richard, >> >> >> It can trap wi

[PATCH 2/4] Separate reduction info and associate it with SLP nodes

2025-08-29 Thread Richard Biener
The following splits out reduction related information from stmt_vec_info, retaining (and duplicating) parts used by scalar cycle analysis. The data is then associated with SLP nodes forming reduction cycles and accessible via info_for_reduction. The data is created at SLP discovery time as we loo

[RFC] libstdc++: Refactor _Variadic_union so _Unitialized is not needed.

2025-08-29 Thread Tomasz Kamiński
The changes the _Variadic_union implementation, in a way that the _Unitialized partial specialization for non-trivial types is not necessary. This is simply done by separating the specialization for __trivially_destructible being true and false, and for the later definining an empty destructor (

[PATCH][PR121602] aarch64: Force vector when folding svmul with all-ones op1.

2025-08-29 Thread Jennifer Schmitz
An ICE was reported in the following test case: svint8_t foo(svbool_t pg, int8_t op2) { return svmul_n_s8_z(pg, svdup_s8(1), op2); } with a type mismatch in 'vec_cond_expr': _4 = VEC_COND_EXPR ; The reason is that svmul_impl::fold folds calls where one of the operands is all ones to the othe

[PATCH v3] xtensa: Rewrite bswapsi2_internal with compact syntax

2025-08-29 Thread Takayuki 'January June' Suwa
Only minor comment correction. No change in operation. -- >8 -- Also, the omission of the instruction that sets the shift amount register (SAR) to 8 is now more efficient: it is omitted if there was a previous bswapsi2 in the same BB, but not omitted if no bswapsi2 is found or another insn that

Re: [PATCH] vect: Set prolog bound to 0 for VLA alignment [PR121523].

2025-08-29 Thread Richard Biener
On Fri, Aug 29, 2025 at 12:39 PM Robin Dapp wrote: > > > This is v2, changed to estimated_poly_value / 2. Regtested on > > rv64gcv_zvl512b > > and aarch64 via qemu. > > I looked at the test suite results more closely now. While those apply_scale > ICEs vanish with the patch there are still a fe

Re: [PATCH] c++, libstdc++, v4: Implement C++23 P2674R1 - A trait for implicit lifetime types

2025-08-29 Thread Jason Merrill
On 8/29/25 6:22 AM, Jakub Jelinek wrote: On Fri, Aug 29, 2025 at 11:40:10AM +0200, Jason Merrill wrote: --- gcc/cp/semantics.cc.jj 2025-08-28 10:50:43.432763513 +0200 +++ gcc/cp/semantics.cc 2025-08-28 16:52:48.006806831 +0200 @@ -13591,6 +13591,38 @@ trait_expr_value (cp_trait_kind kind, t

Re: [PATCH] tree-optimization: fabs(a+0.0) -> fabs(a) for non trapping case

2025-08-29 Thread Richard Biener
On Fri, Aug 29, 2025 at 10:56 AM Matteo Nicoli wrote: > > Dear Richard, > > > It can trap with sNaN ± 0.0. ±Inf ± 0.0 = ±Inf, so it does not raise an > FE_OVERFLOW (because there’s no overflow of a finite quantity), and qNaN does > not raise an FE_INVALID because it’s quiet. > > > There’s alread

Re: [PATCH] vect: Set prolog bound to 0 for VLA alignment [PR121523].

2025-08-29 Thread Robin Dapp
This is v2, changed to estimated_poly_value / 2. Regtested on rv64gcv_zvl512b and aarch64 via qemu. I looked at the test suite results more closely now. While those apply_scale ICEs vanish with the patch there are still a few execution failures with the VLA peeling patch remaining: One is

[PATCH] c++, libstdc++, v4: Implement C++23 P2674R1 - A trait for implicit lifetime types

2025-08-29 Thread Jakub Jelinek
On Fri, Aug 29, 2025 at 11:40:10AM +0200, Jason Merrill wrote: > > --- gcc/cp/semantics.cc.jj 2025-08-28 10:50:43.432763513 +0200 > > +++ gcc/cp/semantics.cc 2025-08-28 16:52:48.006806831 +0200 > > @@ -13591,6 +13591,38 @@ trait_expr_value (cp_trait_kind kind, tr > > case CPTK_IS_FUNCTIO

Re: [PATCH 2/3] AArch64: Implement target hooks for dispatch scheduling.

2025-08-29 Thread Tamar Christina
The 08/20/2025 16:52, Jennifer Schmitz wrote: > > > > On 5 Aug 2025, at 09:25, Tamar Christina wrote: > > > > External email: Use caution opening links or attachments > > > > > > Hi Jennifer, > > > > This part is new to me so I'm just gonna go by the documentation and code > > for now, > > so I

[PATCH 4/4] Eliminate some STMT_VINFO_REDUC_IDX for SLP_TREE_REDUC_IDX

2025-08-29 Thread Richard Biener
The following uses SLP_TREE_REDUC_IDX where it looks more appropriate. Bootstrapped and tested on x86_64-unknown-linux-gnu. Tamar, can you test 1+2 (separately)? Possibly also the full stack if the first part succeeds. Thanks, Richard. * tree-vect-loop.cc (vect_create_epilog_for_reduct

[PATCH 3/4] Remove no longer needed STMT_VINFO_REDUC_DEF sets

2025-08-29 Thread Richard Biener
The following removes no longer needed extra sets of STMT_VINFO_REDUC_DEF and replaces a single remaining one with a more appropriate check. Bootstrapped and tested on x86_64-unknown-linux-gnu. * tree-vect-loop.cc (vectorizable_live_operation): Check vect_is_reduction on the SLP n

[PATCH 1/4] Introduce abstraction for vect reduction info

2025-08-29 Thread Richard Biener
While we have already the accessor info_for_reduction, its result is a plain stmt_vec_info. The following turns that into a class for the purpose of changing accesses to reduction info to a new set of accessors prefixed with VECT_REDUC_INFO and removes the corresponding STMT_VINFO prefixed accesso

Re: [PATCH] libstdc++, v2: Implement C++23 P2590R2 - Explicit lifetime management

2025-08-29 Thread Richard Biener
On Fri, 29 Aug 2025, Jakub Jelinek wrote: > On Fri, Aug 29, 2025 at 10:15:33AM +0200, Richard Biener wrote: > > On Fri, 29 Aug 2025, Richard Biener wrote: > > > > > On Fri, 29 Aug 2025, Jakub Jelinek wrote: > > > > > > > Hi! > > > > > > > > Here is a variant of the patch which pretends there ar

Re: [PATCH] c++/modules: Fix ADL [PR117658]

2025-08-29 Thread Jason Merrill
On 8/24/25 9:04 AM, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? -- >8 -- On looking again at [basic.lookup.argdep] p4, I believe GCC hasn't fully implemented the wording here for ADL. This patch fixes two issues. First, 4.3 indicates that a function

Re: [PATCH v2 1/2] testsuite: arm: remove arm32 check from a few effective-targets

2025-08-29 Thread Christophe Lyon
On Fri, 29 Aug 2025 at 11:57, Richard Earnshaw wrote: > > On 18/08/2025 18:32, Christophe Lyon wrote: > > On Mon, 18 Aug 2025 at 19:24, Christophe Lyon > > wrote: > >> > >> A few arm effective-targets call check_effective_target_arm32 even > >> though they would force a -march=XXX flag which supp

[PATCH] xtensa: Optimize branch whether (reg:SI) is within/out the range handled by CLAMPS instruction

2025-08-29 Thread Takayuki 'January June' Suwa
The CLAMPS instruction in Xtensa ISA, provided when the TARGET_CLAMPS configuration is enabled (and also requires TARGET_MINMAX), returns a value clamped the number in the specified register to between -(1<= -(1 << 9) && a < (1 << 9)) foo(); } void test1(int a) { if (a < -(1

Re: [PATCH] vect: Set prolog bound to 0 for VLA alignment [PR121523].

2025-08-29 Thread Robin Dapp
This is v2, changed to estimated_poly_value / 2. Regtested on rv64gcv_zvl512b and aarch64 via qemu. since peeling and version for alignment for VLA modes was introduced (r16-3065-geee51f9a4b6) we have been seeing a lot of test suite failures like internal compiler error: in apply_scale, at pr

Re: [PATCH] c++, libstdc++, v3: Implement C++23 P2674R1 - A trait for implicit lifetime types

2025-08-29 Thread Jason Merrill
On 8/28/25 2:38 PM, Jakub Jelinek wrote: On Thu, Aug 28, 2025 at 08:11:04PM +0200, Tomasz Kaminski wrote: Similar test, for Q being a base class, this is also aggregate in C++20. And if you could reorganize the library test so satic_assert follows the type definition, that would be great. Done

[PATCH] RISC-V: Add patterns for vector-scalar IEEE floating-point min

2025-08-29 Thread Paul-Antoine Arras
This pattern enables the combine pass (or late-combine, depending on the case) to merge a vec_duplicate into an unspec_vfmin RTL instruction. Before this patch, we have two instructions, e.g.: vfmv.v.f v2,fa0 vfmin.vv v1,v1,v2 After, we get only one: vfmin.vf v1,v1,fa0 gc

Re: [PATCH] libstdc++, v2: Implement C++23 P2590R2 - Explicit lifetime management

2025-08-29 Thread Jakub Jelinek
On Fri, Aug 29, 2025 at 10:15:33AM +0200, Richard Biener wrote: > On Fri, 29 Aug 2025, Richard Biener wrote: > > > On Fri, 29 Aug 2025, Jakub Jelinek wrote: > > > > > Hi! > > > > > > Here is a variant of the patch which pretends there are also stores > > > in the inline asms. > > > Plus the forg

Re: [PATCH] libstdc++, v2: Implement C++23 P2590R2 - Explicit lifetime management

2025-08-29 Thread Tomasz Kaminski
On Fri, Aug 29, 2025 at 10:37 AM Jakub Jelinek wrote: > On Fri, Aug 29, 2025 at 10:08:38AM +0200, Tomasz Kaminski wrote: > > > + if (sizeof(S) != sizeof(T)) > > > +return; > > > > > These seem insufficient to prevent compilation errors that > bit_cast(S{}) > > would > > produce if their size

Re: [PATCH] libstdc++, v2: Implement C++23 P2590R2 - Explicit lifetime management

2025-08-29 Thread Jakub Jelinek
On Fri, Aug 29, 2025 at 10:56:45AM +0200, Tomasz Kaminski wrote: > Yes, that is even better. C++ made me biased towards not using > preprocessing, > so I miss simple solutions. Anyway, went with your requires case + added tests for starting lifetime on static const variable. 2025-08-29 Jakub Jel

Re: [PATCH] tree-optimization: fabs(a+0.0) -> fabs(a) for non trapping case

2025-08-29 Thread Matteo Nicoli
Dear Richard, It can trap with sNaN ± 0.0. ±Inf ± 0.0 = ±Inf, so it does not raise an FE_OVERFLOW (because there’s no overflow of a finite quantity), and qNaN does not raise an FE_INVALID because it’s quiet. There’s already a check for sNaN in fold-const.cc /* Don't allow the fold with -fsig

[committed] invoke.texi: AMD GCN - remove '(experimental)' from some gfx*-generic [was: [patch] install.texi: For amdgcn, clarify which llvm-* binaries are required]

2025-08-29 Thread Tobias Burnus
Hi Sandra, hi Andrew, hello world, Sandra Loosemore wrote: The GCC user manual lists all the *-generic options for -march as "Experimental".  Is that still the case?  If not, I'll consider a patch to remove "Experimental" as trivial enough to meet the obvious rule. Good suggestion! — As ROC

[PATCH] libstdc++, v2: Implement C++23 P2590R2 - Explicit lifetime management

2025-08-29 Thread Jakub Jelinek
Hi! Here is a variant of the patch which pretends there are also stores in the inline asms. Plus the forgotten std.cc exports. 2025-08-29 Jakub Jelinek * include/bits/version.def: Implement C++23 P2590R2 - Explicit lifetime management. (start_lifetime_as): New.

Re: [PATCH] libstdc++, v2: Implement C++23 P2590R2 - Explicit lifetime management

2025-08-29 Thread Jakub Jelinek
On Fri, Aug 29, 2025 at 10:08:38AM +0200, Tomasz Kaminski wrote: > > + if (sizeof(S) != sizeof(T)) > > +return; > > > These seem insufficient to prevent compilation errors that bit_cast(S{}) > would > produce if their size is not much. My preference here would be to have some > dr-require > ex

Re: [PATCH] libstdc++, v2: Implement C++23 P2590R2 - Explicit lifetime management

2025-08-29 Thread Richard Biener
On Fri, 29 Aug 2025, Richard Biener wrote: > On Fri, 29 Aug 2025, Jakub Jelinek wrote: > > > Hi! > > > > Here is a variant of the patch which pretends there are also stores > > in the inline asms. > > Plus the forgotten std.cc exports. > > Can you add a testcase on actual constant objects? I w

Re: [PATCH] libstdc++: Implement C++23 P2590R2 - Explicit lifetime management

2025-08-29 Thread Tomasz Kaminski
On Fri, Aug 29, 2025 at 10:04 AM Richard Biener wrote: > On Fri, 29 Aug 2025, Ville Voutilainen wrote: > > > On Fri, 29 Aug 2025 at 10:40, Richard Biener wrote: > > > So, is std::start_lifetime_as a thing on readonly objects? > > > > Yes. It has a const void* overload. From a language-conceptual

RE: [PATCH] Pass reduction var to vectorize_fold_left_reduction directly

2025-08-29 Thread Richard Biener
On Fri, 29 Aug 2025, Tamar Christina wrote: > > -Original Message- > > From: Richard Biener > > Sent: Friday, August 29, 2025 9:15 AM > > To: Andrew Pinski > > Cc: Tamar Christina ; gcc-patches@gcc.gnu.org; > > RISC- > > V CI > > Subject: Re: [PATCH] Pass reduction var to vectorize_fol

Re: [PATCH] libstdc++, v2: Implement C++23 P2590R2 - Explicit lifetime management

2025-08-29 Thread Tomasz Kaminski
On Fri, Aug 29, 2025 at 9:58 AM Jakub Jelinek wrote: > Hi! > > Here is a variant of the patch which pretends there are also stores > in the inline asms. > Plus the forgotten std.cc exports. > > 2025-08-29 Jakub Jelinek > > * include/bits/version.def: Implement C++23 P2590R2 - Explicit

Re: [PATCH] libstdc++, v2: Implement C++23 P2590R2 - Explicit lifetime management

2025-08-29 Thread Richard Biener
On Fri, 29 Aug 2025, Jakub Jelinek wrote: > Hi! > > Here is a variant of the patch which pretends there are also stores > in the inline asms. > Plus the forgotten std.cc exports. Can you add a testcase on actual constant objects? I wonder why we do not diagnose asm outputs on such? > 2025-08-2

Re: [PATCH] libstdc++: Implement C++23 P2590R2 - Explicit lifetime management

2025-08-29 Thread Richard Biener
On Fri, 29 Aug 2025, Ville Voutilainen wrote: > On Fri, 29 Aug 2025 at 10:40, Richard Biener wrote: > > So, is std::start_lifetime_as a thing on readonly objects? > > Yes. It has a const void* overload. From a language-conceptual > perspective, there's nothing odd about creating > a const buffer

Re: [PATCH] forwprop: Copy the memcmp optimization from strlen to forwprop [PR116651]

2025-08-29 Thread Richard Biener
On Fri, Aug 29, 2025 at 6:33 AM Andrew Pinski wrote: > > To better optimize code dealing with `memcmp == 0` where we have > a small constant size, we can inline the memcmp in those cases. > There is code to do this in strlen but that is run too late in > the case where we can figure out the value

Re: [PATCH] libstdc++: Implement C++23 P2590R2 - Explicit lifetime management

2025-08-29 Thread Ville Voutilainen
On Fri, 29 Aug 2025 at 10:40, Richard Biener wrote: > So, is std::start_lifetime_as a thing on readonly objects? Yes. It has a const void* overload. From a language-conceptual perspective, there's nothing odd about creating a const buffer from bit soup and then starting the lifetime of an object

Re: [PATCH 09/14] lto: Add toplevel assembly heuristics

2025-08-29 Thread Jakub Jelinek
On Thu, Aug 28, 2025 at 02:24:33PM -0700, Andi Kleen wrote: > Jakub Jelinek writes: > > > On Wed, Aug 27, 2025 at 03:52:11PM +0200, Michal Jires wrote: > >> This new pass heuristically detects symbols referenced by toplevel > >> assembly to prevent their optimization. > >> > >> Heuristics is don

Re: [PATCH] libstdc++: Implement C++23 P2590R2 - Explicit lifetime management

2025-08-29 Thread Tomasz Kaminski
On Fri, Aug 29, 2025 at 9:40 AM Richard Biener wrote: > On Fri, 29 Aug 2025, Tomasz Kaminski wrote: > > > On Fri, Aug 29, 2025 at 9:03 AM Jakub Jelinek wrote: > > > > > On Fri, Aug 29, 2025 at 08:48:02AM +0200, Tomasz Kaminski wrote: > > > > >From recent discussions, my understand was that this

Re: [PATCH] libstdc++: Implement C++23 P2590R2 - Explicit lifetime management

2025-08-29 Thread Richard Biener
On Fri, 29 Aug 2025, Tomasz Kaminski wrote: > On Fri, Aug 29, 2025 at 9:03 AM Jakub Jelinek wrote: > > > On Fri, Aug 29, 2025 at 08:48:02AM +0200, Tomasz Kaminski wrote: > > > >From recent discussions, my understand was that this function can be > > > implemented purely in library as: > > > retu

RE: [PATCH] Pass reduction var to vectorize_fold_left_reduction directly

2025-08-29 Thread Tamar Christina
> -Original Message- > From: Richard Biener > Sent: Friday, August 29, 2025 9:15 AM > To: Andrew Pinski > Cc: Tamar Christina ; gcc-patches@gcc.gnu.org; RISC- > V CI > Subject: Re: [PATCH] Pass reduction var to vectorize_fold_left_reduction > directly > > On Thu, 28 Aug 2025, Andrew Pi

Re: [PATCH v2] i386: Fix vect-pragma-target-[12].c testcase for -march=XYZ [PR120643]

2025-08-29 Thread Richard Biener
On Fri, Aug 29, 2025 at 7:42 AM Andrew Pinski wrote: > > These 2 testcases were originally designed for the default -march= of > x86_64 so if you pass -march=native (on a target with AVX512 enabled), > they will fail. It fix this, we add `-mno-sse3 -mtune=generic` > to the options to force a speci

  1   2   >