[RFC/RFA][PATCH 0/2] SVE intrinsics: Add strength reduction for division by constant.

2024-07-16 Thread Jennifer Schmitz
This patch series is part of an ongoing effort to replace the SVE intrinsic svdiv by lower-strength instructions for division by constant. To that end, we implemented svdiv_impl::fold to perform the following transformation in gimple: - Division where all divisors are the same power of 2 --> svasr

RE: [PATCH] [x86][avx512] Optimize maskstore when mask is 0 or -1 in UNSPEC_MASKMOV

2024-07-16 Thread Liu, Hongtao
> -Original Message- > From: Uros Bizjak > Sent: Wednesday, July 17, 2024 2:52 PM > To: Liu, Hongtao > Cc: gcc-patches@gcc.gnu.org; crazy...@gmail.com; hjl.to...@gmail.com > Subject: Re: [PATCH] [x86][avx512] Optimize maskstore when mask is 0 or -1 > in UNSPEC_MASKMOV > > On Wed, Jul 1

Re: [PATCH] [x86][avx512] Optimize maskstore when mask is 0 or -1 in UNSPEC_MASKMOV

2024-07-16 Thread Uros Bizjak
On Wed, Jul 17, 2024 at 3:27 AM liuhongt wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. > Ready push to trunk. > > gcc/ChangeLog: > > PR target/115843 > * config/i386/predicates.md (const0_or_m1_operand): New > predicate. > * config/i386/sse.md

Re: [committed][PR rtl-optimization/115876][PR rtl-optimization/115916] Fix sign/carry bit handling in ext-dce

2024-07-16 Thread Andreas Schwab
On Jul 15 2024, Jeff Law wrote: > My change to fix a ubsan issue broke handling propagation of the > carry/sign bit down through a right shift. What about the other ASHIFTs? -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And no

Re: [PATCH] RISC-V: Fix testcase missing arch attribute

2024-07-16 Thread Christoph Müllner
On Wed, Jul 17, 2024 at 3:15 AM Edwin Lu wrote: > > The C + F extentions implies the zcf extension on rv32. Add missing zcf > extension for the rv32 target. > > gcc/testsuite/ChangeLog: > > * gcc.target/riscv/target-attr-16.c: Update expected assembly > > Signed-off-by: Edwin Lu > --- >

Re: [RFC 1/2] libbacktrace: add FDPIC support

2024-07-16 Thread Ian Lance Taylor
On Tue, Jul 16, 2024 at 5:41 PM David Edelsohn wrote: > > I believe that this patch broke bootstrap on AIX: > > /nasfarm/edelsohn/src/src/libbacktrace/xcoff.c: In function 'xcoff_add': > /nasfarm/edelsohn/src/src/libbacktrace/xcoff.c:1309:40: error: incompatible > type for argument 2 of 'backtrac

[PATCH] [x86][avx512] Optimize maskstore when mask is 0 or -1 in UNSPEC_MASKMOV

2024-07-16 Thread liuhongt
Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. Ready push to trunk. gcc/ChangeLog: PR target/115843 * config/i386/predicates.md (const0_or_m1_operand): New predicate. * config/i386/sse.md (*_store_mask_1): New pre_reload define_insn_and_split.

[PATCH] RISC-V: Fix testcase missing arch attribute

2024-07-16 Thread Edwin Lu
The C + F extentions implies the zcf extension on rv32. Add missing zcf extension for the rv32 target. gcc/testsuite/ChangeLog: * gcc.target/riscv/target-attr-16.c: Update expected assembly Signed-off-by: Edwin Lu --- gcc/testsuite/gcc.target/riscv/target-attr-16.c | 2 +- 1 file chang

Re: [PATCH ver 2] rs6000, update effective target for tests builtins-10*.c and, vec_perm-runnable-i128.c

2024-07-16 Thread Peter Bergner
On 7/16/24 6:19 PM, Carl Love wrote: > use __int128 types that are not supported on all platforms.  The > __int128 type is only supported on 64-bit platforms.  Need to check that > the platform is 64-bits and support the __int128 type.  Add the int128 and > lp64 flags to the target test. The test

Re: [RFC 1/2] libbacktrace: add FDPIC support

2024-07-16 Thread David Edelsohn
Hi, Ian I believe that this patch broke bootstrap on AIX: /nasfarm/edelsohn/src/src/libbacktrace/xcoff.c: In function 'xcoff_add': /nasfarm/edelsohn/src/src/libbacktrace/xcoff.c:1309:40: error: incompatible type for argument 2 of 'backtrace_dwarf_add' 1309 | if (!backtrace_dwarf_add (state

Re: [PATCH] RISC-V: Implement __init_riscv_features_bits, __riscv_feature_bits, and __riscv_vendor_feature_bits

2024-07-16 Thread Kito Cheng
On Wed, Jul 17, 2024 at 1:14 AM Palmer Dabbelt wrote: > > On Tue, 16 Jul 2024 07:49:13 PDT (-0700), kito.ch...@sifive.com wrote: > > This provides a common abstraction layer to probe the available extensions > > at > > run-time. These functions can be used to implement function > > multi-version

Re: [PATCH v9 08/10] Add tests for C/C++ musttail attributes

2024-07-16 Thread Jason Merrill
On 7/16/24 6:54 PM, Andi Kleen wrote: On Tue, Jul 16, 2024 at 06:06:42PM -0400, Jason Merrill wrote: On 7/16/24 5:55 PM, Andi Kleen wrote: On Tue, Jul 16, 2024 at 12:52:31PM -0700, Andi Kleen wrote: On Tue, Jul 16, 2024 at 02:51:13PM -0400, Jason Merrill wrote: On 7/16/24 12:18 PM, Andi Kleen

[COMMITTED] PR tree-optimization/115951 - range-ops should return the requested boolean type.

2024-07-16 Thread Andrew MacLeod
When PRANGE was created for GCC 15, new range-op entries were created for pointers.  The pointer versions of ==, !=, <, <=, >, >=  use the default boolean type for the result rather than the requested type.   This causes a mismatch later for ADA which has booleans with precision 8 vs the GCC de

[PATCH ver 2] rs6000, update effective target for tests builtins-10*.c and, vec_perm-runnable-i128.c

2024-07-16 Thread Carl Love
GCC maintainers: Version 2, removed the lp64 from the target per discussion.  Tested and it is not needed.  The int128 qualifier is sufficient for the thest to report as unsupported on a 32-bit Power system. The tests:   tests builtins-10-runnable.c   tests builtins-10.c   vec_perm-runnabl

Re: [PATCH] Add debug counter for ext_dce

2024-07-16 Thread Jeff Law
On 7/16/24 4:34 PM, Andrew Pinski wrote: Like r15-1610-gb6215065a5b143 (which adds one for late_combine), adding one for ext_dce is useful to debug some issues with this pass. Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: * dbgcnt.def (ext_dce): New

Re: [PATCH] Add debug counter for ext_dce

2024-07-16 Thread Andrew Pinski
On Tue, Jul 16, 2024 at 3:36 PM Andrew Pinski wrote: > > Like r15-1610-gb6215065a5b143 (which adds one for late_combine), > adding one for ext_dce is useful to debug some issues with this pass. > > Bootstrapped and tested on x86_64-linux-gnu with no regressions. > > gcc/ChangeLog: > > * db

Re: [PATCH v9 08/10] Add tests for C/C++ musttail attributes

2024-07-16 Thread Andi Kleen
On Tue, Jul 16, 2024 at 06:06:42PM -0400, Jason Merrill wrote: > On 7/16/24 5:55 PM, Andi Kleen wrote: > > On Tue, Jul 16, 2024 at 12:52:31PM -0700, Andi Kleen wrote: > > > On Tue, Jul 16, 2024 at 02:51:13PM -0400, Jason Merrill wrote: > > > > On 7/16/24 12:18 PM, Andi Kleen wrote: > > > > > On Tue

[PATCH] Add debug counter for ext_dce

2024-07-16 Thread Andrew Pinski
Like r15-1610-gb6215065a5b143 (which adds one for late_combine), adding one for ext_dce is useful to debug some issues with this pass. Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: * dbgcnt.def (ext_dce): New debug counter. * ext-dce.cc (ext_dce_

Re: [PATCH v9 08/10] Add tests for C/C++ musttail attributes

2024-07-16 Thread Jason Merrill
On 7/16/24 5:55 PM, Andi Kleen wrote: On Tue, Jul 16, 2024 at 12:52:31PM -0700, Andi Kleen wrote: On Tue, Jul 16, 2024 at 02:51:13PM -0400, Jason Merrill wrote: On 7/16/24 12:18 PM, Andi Kleen wrote: On Tue, Jul 16, 2024 at 11:17:14AM -0400, Jason Merrill wrote: On 7/16/24 11:15 AM, Andi Klee

Re: [PATCH] c++: constrained partial spec type context [PR111890]

2024-07-16 Thread Jason Merrill
On 7/11/24 1:08 PM, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk/14? OK. -- >8 -- maybe_new_partial_specialization wasn't propagating TYPE_CONTEXT when creating a new class type corresponding to a constrained partial spec, which do_frien

Re: [PATCH v9 08/10] Add tests for C/C++ musttail attributes

2024-07-16 Thread Andi Kleen
On Tue, Jul 16, 2024 at 12:52:31PM -0700, Andi Kleen wrote: > On Tue, Jul 16, 2024 at 02:51:13PM -0400, Jason Merrill wrote: > > On 7/16/24 12:18 PM, Andi Kleen wrote: > > > On Tue, Jul 16, 2024 at 11:17:14AM -0400, Jason Merrill wrote: > > > > On 7/16/24 11:15 AM, Andi Kleen wrote: > > > > > > In

Re: [PATCH] c++: missing -Wunused-value for ! [PR114104]

2024-07-16 Thread Eric Gallager
On Tue, Jul 16, 2024 at 10:50 AM Jason Merrill wrote: > > On 7/16/24 10:31 AM, Eric Gallager wrote: > > On Mon, Jul 15, 2024 at 10:37 PM Patrick Palka wrote: > >> > >> Bootstrapped andrregtested on x86_64-pc-linux-gnu, does this look > >> OK for trunk? > >> > >> -- >8 -- > >> > >> Here we're negl

Re: [PATCH v9 08/10] Add tests for C/C++ musttail attributes

2024-07-16 Thread Andi Kleen
On Tue, Jul 16, 2024 at 02:51:13PM -0400, Jason Merrill wrote: > On 7/16/24 12:18 PM, Andi Kleen wrote: > > On Tue, Jul 16, 2024 at 11:17:14AM -0400, Jason Merrill wrote: > > > On 7/16/24 11:15 AM, Andi Kleen wrote: > > > > > In the adjusted test it looks like the types of f and g match, so I > >

[PATCH v2] gimple-fold: consistent dump of builtin call simplifications

2024-07-16 Thread rubin.gerritsen
Changes since v1: * Added DCO signoff * Removed tabs from commit message -- Previously only simplifications of the `__st[xrp]cpy_chk` were dumped. Now all call replacement simplifications are dumped. Examples of statements with corresponding dumpfile entries: `printf("mystr\n");`: optimized

Re: [PATCH] c++/contracts: ICE in C++ Contracts with '-fno-exceptions' [PR 110159]

2024-07-16 Thread Jason Merrill
On 7/16/24 11:26 AM, Nina Dinka Ranns wrote: On Tue, 16 Jul 2024 at 15:55, Jason Merrill > wrote: On 7/16/24 5:03 AM, Nina Dinka Ranns wrote: > Hello, > > We currently only initialise terminate_fn if exceptions are enabled. > However, contract

Re: [PATCH v9 08/10] Add tests for C/C++ musttail attributes

2024-07-16 Thread Jason Merrill
On 7/16/24 12:18 PM, Andi Kleen wrote: On Tue, Jul 16, 2024 at 11:17:14AM -0400, Jason Merrill wrote: On 7/16/24 11:15 AM, Andi Kleen wrote: In the adjusted test it looks like the types of f and g match, so I wouldn't expect an error. Good point! Missing the forest for the trees. Anyways are

Re: [PATCH] c++, coroutines, contracts: Handle coroutine and void functions [PR110871,PR110872,PR115434].

2024-07-16 Thread Jason Merrill
On 7/16/24 12:05 PM, Iain Sandoe wrote: Hi Jason, On 15 Jul 2024, at 23:29, Jason Merrill wrote: On 7/12/24 1:03 PM, Iain Sandoe wrote: - More helpful for optimization might be to make the contracts a wrapper - function (for non-variadic functions), that could be inlined into a - call

Re: [Patch, fortran] PR84868 - [11/12/13/14/15 Regression] ICE in gfc_conv_descriptor_offset, at fortran/trans-array.c:208

2024-07-16 Thread Harald Anlauf
Hi Paul, Am 16.07.24 um 18:35 schrieb Paul Richard Thomas: In answer to some of your latest points: Can we prevent the export of this artificial symbol? The export of this symbol is needed for interface mapping. Without it, the original bug would reappear. If such len_trim calls are made

Re: [PATCH v5] RISC-V: use fclass insns to implement isfinite,isnormal and isinf builtins

2024-07-16 Thread Vineet Gupta
Hi Jeff, On 7/13/24 07:54, Vineet Gupta wrote: > Changes since v4: > - No functional changes. > - Use int iterator and attr to implement expanders in md > (inspired by loongarch patch. Thx Xi Ruoyao) > > Changes since v3: > - Remove '*' from define_insn for fclass > - Remove the dummy

Re: [PATCH v2 01/12] OpenMP: metadirective tree data structures and front-end interfaces

2024-07-16 Thread Tobias Burnus
Hi Sandra, Am 16.07.24 um 19:03 schrieb Sandra Loosemore: Well, I still do not understand why backward compatibility concerns specific to some other directive should affect the ABI for a new directive that does not have any current libgomp runtime support, I am happy that I managed to explain

Re: [patch,avr] Overhaul add and sub insns that extend one operand

2024-07-16 Thread Georg-Johann Lay
Am 16.07.24 um 19:08 schrieb Jeff Law: On 7/12/24 5:01 AM, Georg-Johann Lay wrote: These are insns of the forms    (set (regA:M)     (plus:M (extend:M (regB:L))     (regA:M))) and    (set (regA:M)     (minus:M (regA:M) (extend:M (regB:L where "ext

Re: [PATCH] RISC-V: Implement __init_riscv_features_bits, __riscv_feature_bits, and __riscv_vendor_feature_bits

2024-07-16 Thread Palmer Dabbelt
On Tue, 16 Jul 2024 07:49:13 PDT (-0700), kito.ch...@sifive.com wrote: This provides a common abstraction layer to probe the available extensions at run-time. These functions can be used to implement function multi-versioning or to detect available extensions. The advantages of providing this ab

Re: [patch,avr] Overhaul add and sub insns that extend one operand

2024-07-16 Thread Jeff Law
On 7/12/24 5:01 AM, Georg-Johann Lay wrote: These are insns of the forms   (set (regA:M)    (plus:M (extend:M (regB:L))    (regA:M))) and   (set (regA:M)    (minus:M (regA:M)     (extend:M (regB:L where "extend" may be a sign-extend or zero-extend,

Re: [PATCH v2 01/12] OpenMP: metadirective tree data structures and front-end interfaces

2024-07-16 Thread Sandra Loosemore
On 7/16/24 06:53, Tobias Burnus wrote: Question: Is now everything clear - or are you still confused by my writing? Well, I still do not understand why backward compatibility concerns specific to some other directive should affect the ABI for a new directive that does not have any current li

Re: [Patch, fortran] PR84868 - [11/12/13/14/15 Regression] ICE in gfc_conv_descriptor_offset, at fortran/trans-array.c:208

2024-07-16 Thread Paul Richard Thomas
Hi Harald, Pushed as r15-2072. I will wait a few days before backporting but I would be surprised if there are any problems simply because the bug prevented the code patch from doing anything than ICE. In answer to some of your latest points: > > >> Can we prevent the export of this artificial s

Re: [PATCH v3 1/6] libstdc++: Handle encodings in localized chrono formatting [PR109162]

2024-07-16 Thread Jonathan Wakely
On Tue, 16 Jul 2024 at 13:34, Jonathan Wakely wrote: > > On Tue, 16 Jul 2024 at 13:05, Jonathan Wakely wrote: > > > > On Fri, 12 Jul 2024 at 00:23, I wrote: > > > > > > I sent v1 of this patch in February, and it added the new symbols to > > > libstdc++exp.a which meant users needed to use -lstdc

Re: [PATCH] rs6000, update effective target for tests builtins-10*.c and, vec_perm-runnable-i128.c

2024-07-16 Thread Carl Love
Peter: On 7/15/24 4:14 PM, Peter Bergner wrote: On 7/15/24 5:43 PM, Carl Love wrote: -/* { dg-do run } */ +/* { dg-do run { target { lp64 } && { int128 } } } */ Why isn't this just: /* { dg-do run { target int128 } } */ ??? The int128 test should disable this on 32-bit systems just fine

Re: [PATCH v9 08/10] Add tests for C/C++ musttail attributes

2024-07-16 Thread Andi Kleen
On Tue, Jul 16, 2024 at 11:17:14AM -0400, Jason Merrill wrote: > On 7/16/24 11:15 AM, Andi Kleen wrote: > > > In the adjusted test it looks like the types of f and g match, so I > > > wouldn't > > > expect an error. > > > > Good point! Missing the forest for the trees. > > > > Anyways are the C+

Re: [PATCH] c++/modules: Propagate BINDING_VECTOR_*_DUPS_P on realloc [PR99242]

2024-07-16 Thread Jason Merrill
On 7/8/24 8:30 AM, Nathaniel Shead wrote: Bootstrapped and regtested (so far just modules.exp) on x86_64-pc-linux-gnu, OK for trunk/14 if full regtest succeeds? OK. -- >8 -- When importing modules, when a binding vector for a name runs out of slots it gets reallocated with a larger size, and

Re: [PATCH v1] c++: Hash placeholder constraint in ctp_hasher

2024-07-16 Thread Jason Merrill
On 7/12/24 4:42 PM, Seyed Sajad Kahani wrote: This patch addresses a difference between the hash function and the equality function for canonical types of template parameters (ctp_hasher). The equality function uses comptypes (typeck.cc) (with COMPARE_STRUCTURAL) and checks constraint equality fo

Re: [PATCH] c++, coroutines, contracts: Handle coroutine and void functions [PR110871,PR110872,PR115434].

2024-07-16 Thread Iain Sandoe
Hi Jason, > On 15 Jul 2024, at 23:29, Jason Merrill wrote: > > On 7/12/24 1:03 PM, Iain Sandoe wrote: >> >> - More helpful for optimization might be to make the contracts a wrapper >> - function (for non-variadic functions), that could be inlined into a >> - caller while preserving the c

Re: [avr,patch,applied] testsuite - Add noipa function attribute to noclone functions.

2024-07-16 Thread Sam James
Georg-Johann Lay writes: > Applied as obvious. > > Johann I think you can change all of those to just noipa which implies noclone and noinline.

[avr,patch,applied] testsuite - Add noipa function attribute to noclone functions.

2024-07-16 Thread Georg-Johann Lay
Applied as obvious. Johann -- AVR: testsuite - Add noipa function attribute to noclone functions. Many functions under test have the noinline and noclone function attributes attached so that no (constant) values are propagated into the functions, so that we actually are testing what's supposed

Re: [PATCH] rtl-ssa: Fix move range canonicalisation [PR115929]

2024-07-16 Thread Richard Biener
On Tue, Jul 16, 2024 at 4:30 PM Richard Sandiford wrote: > > In this PR, canonicalize_move_range walked off the end of a list > and triggered a null dereference. There are multiple ways of fixing > that, but I think the approach taken in the patch should be > relatively efficient. > > Tested on a

Re: [PATCH v1] Vect: Promote unsigned .SAT_ADD constant operand for vectorizable_call

2024-07-16 Thread Richard Biener
On Tue, Jul 16, 2024 at 3:22 PM Li, Pan2 wrote: > > > I think that's a bug. Do you say __builtin_add_overflow fails to promote > > (constant) arguments? > > I double checked the 022t.ssa pass for the __builtin_add_overflow operands > tree type. It looks like that > the 2 operands of .ADD_OVERFLO

Re: [pushed] rtl-ssa: Fix removal of order_nodes [PR115929]

2024-07-16 Thread Jeff Law
On 7/16/24 8:34 AM, Richard Sandiford wrote: order_nodes are used to implement ordered comparisons between two insns with the same program point number. remove_insn would remove an order_node from its splay tree, but didn't remove it from the insn. This caused confusion if the insn was later

Re: [PATCH] c++/contracts: ICE in C++ Contracts with '-fno-exceptions' [PR 110159]

2024-07-16 Thread Nina Dinka Ranns
On Tue, 16 Jul 2024 at 15:55, Jason Merrill wrote: > On 7/16/24 5:03 AM, Nina Dinka Ranns wrote: > > Hello, > > > > We currently only initialise terminate_fn if exceptions are enabled. > > However, contract handling requires terminate_fn when building the > > contract as a contract failure may re

libgomp: Document 'GOMP_teams4' (was: GCN: Honor OpenMP 5.1 'num_teams' lower bound)

2024-07-16 Thread Thomas Schwinge
Hi! On 2024-07-15T17:01:46+0100, Andrew Stubbs wrote: > On 15/07/2024 16:36, Thomas Schwinge wrote: >> On 2024-07-15T12:16:30+0100, Andrew Stubbs wrote: >>> On 15/07/2024 10:29, Thomas Schwinge wrote: On 2021-11-12T18:58:04+0100, Jakub Jelinek via Gcc-patches wrote: > And finally

Re: [PATCH v9 08/10] Add tests for C/C++ musttail attributes

2024-07-16 Thread Jason Merrill
On 7/16/24 11:15 AM, Andi Kleen wrote: In the adjusted test it looks like the types of f and g match, so I wouldn't expect an error. Good point! Missing the forest for the trees. Anyways are the C++ patches ok with this change? I'm still looking for a test which does error because the types

Re: [PATCH v9 08/10] Add tests for C/C++ musttail attributes

2024-07-16 Thread Andi Kleen
> In the adjusted test it looks like the types of f and g match, so I wouldn't > expect an error. Good point! Missing the forest for the trees. Anyways are the C++ patches ok with this change? Thanks, -Andi

Re: [RFC][middle-end] SLP Early break and control flow support in GCC

2024-07-16 Thread Richard Biener
On Mon, 15 Jul 2024, Tamar Christina wrote: > Hi All, > > This RFC document covers at a high level how to extend early break support in > GCC to support SLP and how this will be extended in the future to support > full control flow in GCC. > > The basic idea in this is based on the paper "All Yo

[PATCH] s390: Fix unresolved iterators bhfgq and xdee

2024-07-16 Thread Stefan Schulze Frielinghaus
Code attribute bhfgq is missing a mapping for TF. This results in unresolved iterators in assembler templates for *bswaptf. With the TF mapping added the base mnemonics vlbr and vstbr are not "used" anymore but only the extended mnemonics (vlbr was interpreted as vlbr; likewise for vstbr). There

Re: [PATCH] c++/contracts: ICE in C++ Contracts with '-fno-exceptions' [PR 110159]

2024-07-16 Thread Jason Merrill
On 7/16/24 5:03 AM, Nina Dinka Ranns wrote: Hello, We currently only initialise terminate_fn if exceptions are enabled. However, contract handling requires terminate_fn when building the contract as a contract failure may result in std::terminate call regardless of whether the exceptions are ena

[PATCH] RISC-V: Implement __init_riscv_features_bits, __riscv_feature_bits, and __riscv_vendor_feature_bits

2024-07-16 Thread Kito Cheng
This provides a common abstraction layer to probe the available extensions at run-time. These functions can be used to implement function multi-versioning or to detect available extensions. The advantages of providing this abstraction layer are: - Easy to port to other new platforms. - Easier to m

Re: [PATCH] c++: missing -Wunused-value for ! [PR114104]

2024-07-16 Thread Jason Merrill
On 7/16/24 10:31 AM, Eric Gallager wrote: On Mon, Jul 15, 2024 at 10:37 PM Patrick Palka wrote: Bootstrapped andrregtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- Here we're neglecting to emit a -Wunused-value for eligible ! operator expressions, and in turn for != oper

Re: [PATCH] c++: missing -Wunused-value for ! [PR114104]

2024-07-16 Thread Patrick Palka
On Tue, 16 Jul 2024, Eric Gallager wrote: > On Mon, Jul 15, 2024 at 10:37 PM Patrick Palka wrote: > > > > Bootstrapped andrregtested on x86_64-pc-linux-gnu, does this look > > OK for trunk? > > > > -- >8 -- > > > > Here we're neglecting to emit a -Wunused-value for eligible ! operator > > express

[pushed] rtl-ssa: Fix removal of order_nodes [PR115929]

2024-07-16 Thread Richard Sandiford
order_nodes are used to implement ordered comparisons between two insns with the same program point number. remove_insn would remove an order_node from its splay tree, but didn't remove it from the insn. This caused confusion if the insn was later reinserted somewhere else that also needed an ord

Re: [PATCH v9 08/10] Add tests for C/C++ musttail attributes

2024-07-16 Thread Jason Merrill
On 7/15/24 11:24 PM, Andi Kleen wrote: On Mon, Jul 15, 2024 at 06:57:57PM -0400, Jason Merrill wrote: On 7/8/24 12:56 PM, Andi Kleen wrote: diff --git a/gcc/testsuite/g++.dg/musttail10.C b/gcc/testsuite/g++.dg/musttail10.C new file mode 100644 index ..9b7043b8a306 --- /dev/null +++

Re: [PATCH] c++: missing -Wunused-value for ! [PR114104]

2024-07-16 Thread Eric Gallager
On Mon, Jul 15, 2024 at 10:37 PM Patrick Palka wrote: > > Bootstrapped andrregtested on x86_64-pc-linux-gnu, does this look > OK for trunk? > > -- >8 -- > > Here we're neglecting to emit a -Wunused-value for eligible ! operator > expressions, and in turn for != operator expressions that are rewrit

[PATCH] rtl-ssa: Fix move range canonicalisation [PR115929]

2024-07-16 Thread Richard Sandiford
In this PR, canonicalize_move_range walked off the end of a list and triggered a null dereference. There are multiple ways of fixing that, but I think the approach taken in the patch should be relatively efficient. Tested on aarch64-linux-gnu & x86_64-linux-gnu. OK to install? Richard gcc/

[patch,avr,applied] Overhaul add, sub that extend one operand

2024-07-16 Thread Georg-Johann Lay
This is a mechanical patch that replaces a bunch of similar insns with one insn with iterators. Johann -- AVR: Overhaul add and sub insns that extend one operand. These are insns of the forms (set (regA:M) (plus:M (extend:M (regB:L)) (regA:M))) and (set (regA:M)

[PATCH] rtl-ssa: Fix split_clobber_group [PR115928]

2024-07-16 Thread Richard Sandiford
One of the goals of the rtl-ssa representation was to allow a group of consecutive clobbers to be skipped in constant time, with amortised sublinear insertion and deletion. This involves putting consecutive clobbers in groups. Splitting or joining groups would be linear if we had to update every

RE: Lower zeroing array assignment to memset for allocatable arrays

2024-07-16 Thread Prathamesh Kulkarni
> -Original Message- > From: Harald Anlauf > Sent: Tuesday, July 16, 2024 12:06 AM > To: Prathamesh Kulkarni ; gcc- > patc...@gcc.gnu.org; fort...@gcc.gnu.org > Subject: Re: Lower zeroing array assignment to memset for allocatable > arrays > > External email: Use caution opening links or

Re: [PATCH] gimple ssa: Teach switch conversion to optimize powers of 2 switches

2024-07-16 Thread Filip Kastl
On Wed 2024-07-10 11:34:44, Richard Biener wrote: > On Mon, 8 Jul 2024, Filip Kastl wrote: > > > Hi, > > > > I'm replying to Richard and keeping Andrew in cc since your suggestions > > overlap. > > > > > > On Tue 2024-06-11 14:48:06, Richard Biener wrote: > > > On Thu, 30 May 2024, Filip Kastl

Re: [PATCH] Fixup unaligned load/store cost for znver4

2024-07-16 Thread Richard Biener
On Tue, 16 Jul 2024, Richard Biener wrote: > On Mon, 15 Jul 2024, Jan Hubicka wrote: > > > > Currently unaligned YMM and ZMM load and store costs are cheaper than > > > aligned which causes the vectorizer to purposely mis-align accesses > > > by adding an alignment prologue. It looks like the un

Re: [PATCH] Output CodeView function information

2024-07-16 Thread Jeff Law
On 7/13/24 3:23 PM, Mark Harmstone wrote: Translate DW_TAG_subprogram DIEs into CodeView LF_FUNC_ID types and S_GPROC32_ID / S_LPROC32_ID symbols. ld will then transform these into S_GPROC32 / S_LPROC32 symbols, which map addresses to unmangled function names. gcc/ * dwarf2codeview.c

Re: [PATCH] recog: restrict paradoxical mode punning in insn_propagation [PR115901]

2024-07-16 Thread Jeff Law
On 7/13/24 9:15 AM, Richard Sandiford wrote: In g:44fc801e97a8dc626a4806ff4124439003420b20 I'd extended insn_propagation to handle simple cases of hard-reg mode punning. One of the checks was that the new use mode occupied the same number of registers as the original definition mode. However,

[PATCH v2] MATCH: Simplify (a ? x : y) eq/ne (b ? x : y) [PR111150]

2024-07-16 Thread Eikansh Gupta
This patch adds match pattern for `(a ? x : y) eq/ne (b ? x : y)`. In forwprop1 pass, depending on the type of `a` and `b`, GCC produces `vec_cond` or `cond_expr`. Based on the observation that `(x != y)` is TRUE, the pattern can be optimized to produce `(a^b ? TRUE : FALSE)`. The patch adds match

[patch,avr,applied] AVR: Allow more combinations of XOR / IOR with byte-shifts.

2024-07-16 Thread Georg-Johann Lay
This patch allows for more insn combine opportunities. It extends some existing pattern to allow more patches by iterators. Johann -- AVR: Allow more combinations of XOR / IOR with byte-shifts. This patch takes some existing patterns that have QImode as one input and uses a mode iterator to al

RE: [PATCH v1] Vect: Promote unsigned .SAT_ADD constant operand for vectorizable_call

2024-07-16 Thread Li, Pan2
> I think that's a bug. Do you say __builtin_add_overflow fails to promote > (constant) arguments? I double checked the 022t.ssa pass for the __builtin_add_overflow operands tree type. It looks like that the 2 operands of .ADD_OVERFLOW has different tree types when one of them is constant. One

Re: [PATCH v2 1/8] Fix warnings for tree formats in gfc_error

2024-07-16 Thread Tobias Burnus
I think it would be nice if some C/C++/global maintainer could rubber stamp the following patch. Otherwise, I think it is trivial, i.e. I think it can be committed in a few days, unless someone has concerns. This change to gcc/c-family/c-format.cc LGTM from the *gfortran* POV and is trivial

Re: [PATCH v2 01/12] OpenMP: metadirective tree data structures and front-end interfaces

2024-07-16 Thread Tobias Burnus
Hi Sandra, Sandra Loosemore wrote: +    /* omp_initial_device is -1, omp_invalid_device is -4; choose +   a value that isn't otherwise defined to indicate the default +   device.  */ +    device_num = build_int_cst (integer_type_node, -2); Don't do this - we do it differently for 'targ

Re: [PATCHv2 2/2] libiberty/buildargv: handle input consisting of only white space

2024-07-16 Thread Andrew Burgess
Jeff Law writes: > On 6/11/24 4:39 AM, Andrew Burgess wrote: > >> >> Jeff, >> >> Thanks for looking these patches over. >> >> For testing, using current(ish) gcc HEAD, on x86-64 GNU/Linux, I: >> >>../src/configure --prefix=$(cd .. && pwd)/install >>make >>make check >> >> I did t

Re: [PATCH v3 1/6] libstdc++: Handle encodings in localized chrono formatting [PR109162]

2024-07-16 Thread Jonathan Wakely
On Tue, 16 Jul 2024 at 13:05, Jonathan Wakely wrote: > > On Fri, 12 Jul 2024 at 00:23, I wrote: > > > > I sent v1 of this patch in February, and it added the new symbols to > > libstdc++exp.a which meant users needed to use -lstdc++exp to format > > chrono types in C++23 mode. That was less than i

[PATCH] libstdc++: Remove __find_if unrolling for random access iterators

2024-07-16 Thread Jonathan Wakely
I have some follow-up patches which are enabled by this, so that other algos which use std::__find_if can benefit from the memchr optimizations recently added to std::find. Currently, they can't benefit because they use the internal __find_if and only std::find is optimized. Tested x86_64-linux. I

[PATCH 6/6] libstdc++: Bump __cpp_lib_format value for std::runtime_format

2024-07-16 Thread Jonathan Wakely
Tested x86_64-linux. -- >8 -- We already supported this feature, but couldn't set the feature test macro accordingly because we were missing support for older features. Now that we support all the older changes, we can set this to the correct value. libstdc++-v3/ChangeLog: * include/bi

[PATCH 5/6] libstdc++: Define C++26 member visit for std::basic_format_arg [PR110356]

2024-07-16 Thread Jonathan Wakely
Tested x86_64-linux. -- >8 -- Implement the std::format changes from P2637R3. This adds visit member functions to std::basic_format_arg and deprecates the non-member function std::visit_format_arg. libstdc++-v3/ChangeLog: PR libstdc++/110356 * include/bits/c++config (_GLIBCXX26_

[PATCH 3/6] libstdc++: Implement C++26 type checking for std::format args [PR115776]

2024-07-16 Thread Jonathan Wakely
Tested x86_64-linux. -- >8 -- Implement the changes from P2757R3, which enhance the parse context to be able to do type checking on format arguments, and to use that to ensure that args used for width and precisions are integral types. libstdc++-v3/ChangeLog: PR libstdc++/115776

[PATCH v3 1/6] libstdc++: Handle encodings in localized chrono formatting [PR109162]

2024-07-16 Thread Jonathan Wakely
On Fri, 12 Jul 2024 at 00:23, I wrote: > > I sent v1 of this patch in February, and it added the new symbols to > libstdc++exp.a which meant users needed to use -lstdc++exp to format > chrono types in C++23 mode. That was less than ideal. > > This v2 patch adds the new symbols to the main library,

[PATCH 4/6] libstdc++: Define C++26 member visit for std::variant [PR110356]

2024-07-16 Thread Jonathan Wakely
Tested x86_64-linux. -- >8 -- Implement the std::variant changes from P2637R3. libstdc++-v3/ChangeLog: PR libstdc++/110356 * include/bits/version.def (variant): Update for C++26. * include/bits/version.h: Regenerate. * include/std/variant (variant::visit): New me

[PATCH 2/6] libstdc++: Support P2510R3 "Formatting pointers" as a DR for C++20

2024-07-16 Thread Jonathan Wakely
Tested x86_64-linux. -- >8 -- We already enable this for -std=gnu++20 but we can do it for -std=c++20 too. Both libc++ and MSVC also treat this change as a DR for C++20. Now that the previous change to the value of __cpp_lib_format is supported, we can finally update it to 202304 to indicate sup

Re: [PATCH]middle-end: fix 0 offset creation and folding [PR115936]

2024-07-16 Thread Richard Biener
On Tue, 16 Jul 2024, Tamar Christina wrote: > Hi All, > > As shown in PR115936 SCEV and IVOPTS create an invalidate IV when the IV is > a pointer type: > > ivtmp.39_65 = ivtmp.39_59 + 0B; > > where the IVs are DI mode and the offset is a pointer. > This comes from this weird candidate: > > Can

Re: [PATCH] Fixup unaligned load/store cost for znver4

2024-07-16 Thread Richard Biener
On Tue, 16 Jul 2024, Jakub Jelinek wrote: > On Tue, Jul 16, 2024 at 01:04:50PM +0200, Richard Biener wrote: > > Do you think this needs a new RC? > > Guess that depends on if somebody would actually perform testing with that > option... ... on a Zen4 machine. I think that's unlikely, let's see

Re: [PATCH] [alpha] adjust MEM alignment for block move [PR115459]

2024-07-16 Thread Alexandre Oliva
On Jul 15, 2024, "Maciej W. Rozycki" wrote: > Thank you. It's Alexandre's change though, so I'll leave it up to him to > decide when to commit. I'm going ahead and blindly putting it in, with the caveat that testing on alpha remains a challenge for me. -- Alexandre Oliva, happy hacker

Re: [i386] adjust flag_omit_frame_pointer in a single function [PR113719]

2024-07-16 Thread Alexandre Oliva
On Jul 15, 2024, Hongtao Liu wrote: >> Regstrapped on x86_64-linux-gnu. Also verified that the regression is >> cured with a i686-solaris cross compiler. Ok to install? > Ok. thanks. As recommended in the PR, I've backported both this patch and the previous one to the same branches that had t

[committed][GCC-14] RISC-V: Rewrite target attribute handling

2024-07-16 Thread Christoph Müllner
The target-arch attribute handling in RISC-V is only a few months old, but already saw a rewrite (9941f0295a14), which addressed an important issue. This rewrite introduced a hash table in the backend, which is used to keep track of target-arch attributes of all functions. The index of this hash t

[committed][GCC-14] RISC-V: Deduplicate arch subset list processing

2024-07-16 Thread Christoph Müllner
We have a code duplication in riscv_set_arch_by_subset_list() and riscv_parse_arch_string(), where the latter function parses an ISA string into a subset_list before doing the same as the former function. riscv_parse_arch_string() is used to process command line options and riscv_set_arch_by_subse

[committed][GCC-14] RISC-V: Allow adding enabled extension via target arch attributes

2024-07-16 Thread Christoph Müllner
The set of enabled extensions can be extended via target arch function attributes by listing each extension with a '+' prefix and a comma as list separator. E.g.: __attribute__((target("arch=+zba,+zbb"))) void foo(); The programmer intends to ensure that one or more extensions are enabled when

[committed][GCC-14] RISC-V: Fix comment/naming in attribute parsing code

2024-07-16 Thread Christoph Müllner
Function target attributes have to be separated by semi-colons. Let's fix the comment and variable naming to better explain what the code does. gcc/ChangeLog: * config/riscv/riscv-target-attr.cc (riscv_process_target_attr): Fix comments and variable names. (cherry picked from com

[committed][GCC-14] RISC-V: testsuite: Properly gate LTO tests

2024-07-16 Thread Christoph Müllner
There are two test cases with the following skip directive: dg-skip-if "" { *-*-* } { "-flto -fno-fat-lto-objects" } This reads as: skip if both '-flto' and '-fno-fat-lto-objects' are present. This is not the case if only '-flto' is present. Since both tests depend on instruction sequences (one

[PING^1][Patch, rs6000, middle-end] v6: Add implementation for different targets for pair mem fusion

2024-07-16 Thread Ajit Agarwal
Ping^1. Ok to install? Thanks & Regards Ajit Forwarded Message Subject: [PING^0][Patch, rs6000, middle-end] v6: Add implementation for different targets for pair mem fusion Date: Mon, 8 Jul 2024 07:55:19 +0530 From: Ajit Agarwal To: Alex Coplan , Richard Sandiford , Kewen.Li

[PATCH]middle-end: fix 0 offset creation and folding [PR115936]

2024-07-16 Thread Tamar Christina
Hi All, As shown in PR115936 SCEV and IVOPTS create an invalidate IV when the IV is a pointer type: ivtmp.39_65 = ivtmp.39_59 + 0B; where the IVs are DI mode and the offset is a pointer. This comes from this weird candidate: Candidate 8: Var befor: ivtmp.39_59 Var after: ivtmp.39_65 Incr

Re: [PATCH] Fixup unaligned load/store cost for znver4

2024-07-16 Thread Jakub Jelinek
On Tue, Jul 16, 2024 at 01:04:50PM +0200, Richard Biener wrote: > Do you think this needs a new RC? Guess that depends on if somebody would actually perform testing with that option... Jakub

[PATCH] [strub] adjust all at-calls type variants at once [PR115848]

2024-07-16 Thread Alexandre Oliva
TYPE_ARG_TYPES of type variants must compare equal, according to verify_type, but adjust_at_calls_type didn't preserve this invariant. Adjust the main type variant and propagate TYPE_ARG_TYPES to all variants. While at that, also adjust the canonical type and its variants, and then verify_type.

Re: [PATCH] Fixup unaligned load/store cost for znver4

2024-07-16 Thread Richard Biener
On Tue, 16 Jul 2024, Richard Biener wrote: > On Tue, 16 Jul 2024, Jakub Jelinek wrote: > > > On Tue, Jul 16, 2024 at 10:55:30AM +0200, Richard Biener wrote: > > > On Tue, 16 Jul 2024, Jakub Jelinek wrote: > > > > > > > On Tue, Jul 16, 2024 at 10:43:27AM +0200, Richard Biener wrote: > > > > > I'v

Re: [PATCH] Fixup unaligned load/store cost for znver4

2024-07-16 Thread Richard Biener
On Tue, 16 Jul 2024, Jakub Jelinek wrote: > On Tue, Jul 16, 2024 at 10:55:30AM +0200, Richard Biener wrote: > > On Tue, 16 Jul 2024, Jakub Jelinek wrote: > > > > > On Tue, Jul 16, 2024 at 10:43:27AM +0200, Richard Biener wrote: > > > > I've pushed it to trunk now and am running local CPU 2017 to

[PATCH] tree-optimization/115841 - reduction epilogue placement issue

2024-07-16 Thread Richard Biener
When emitting the compensation to the vectorized main loop for a vector reduction value to be re-used in the vectorized epilogue we fail to place it in the correct block when the main loop is known to be entered (no loop_vinfo->main_loop_edge) but the epilogue is not (a loop_vinfo->skip_this_loop_e

Re: [PATCH] Fixup unaligned load/store cost for znver4

2024-07-16 Thread Jakub Jelinek
On Tue, Jul 16, 2024 at 10:55:30AM +0200, Richard Biener wrote: > On Tue, 16 Jul 2024, Jakub Jelinek wrote: > > > On Tue, Jul 16, 2024 at 10:43:27AM +0200, Richard Biener wrote: > > > I've pushed it to trunk now and am running local CPU 2017 to check for > > > obvious fallout on Zen4 so we can mak

Re: [PATCH] c++/contracts: ICE in C++ Contracts with '-fno-exceptions' [PR 110159]

2024-07-16 Thread Nina Dinka Ranns
It would help if I attached the patch Apologies, Nina On Tue, 16 Jul 2024 at 10:03, Nina Dinka Ranns wrote: > Hello, > > We currently only initialise terminate_fn if exceptions are enabled. > However, contract handling requires terminate_fn when building the > contract as a contract failure may

[PATCH] c++/contracts: ICE in C++ Contracts with '-fno-exceptions' [PR 110159]

2024-07-16 Thread Nina Dinka Ranns
Hello, We currently only initialise terminate_fn if exceptions are enabled. However, contract handling requires terminate_fn when building the contract as a contract failure may result in std::terminate call regardless of whether the exceptions are enabled. Added possible initialisation of termina

  1   2   >