[PATCH] x86: Remove BREG from ix86_class_likely_spilled_p

2025-04-29 Thread H.J. Lu
AREG, DREG, CREG and AD_REGS are kept in ix86_class_likely_spilled_p to avoid the following regressions with $ make check RUNTESTFLAGS="--target_board='unix{-m32,}'" FAIL: gcc.dg/pr105911.c (internal compiler error: in lra_split_hard_reg_for, at lra-assigns.cc:1863) FAIL: gcc.dg/pr105911.c (test

Re: [COMMITTED] PR tree-optimization/119712 - Always reflect lower bits from mask in subranges.

2025-04-29 Thread Andrew MacLeod
On 4/28/25 17:26, Andrew MacLeod wrote: I have committed this patch to trunk after bootstrap/regression testing again on trunk. I'll get to gcc14/15 once I flush the current queue. Andrew On 4/17/25 06:44, Richard Biener wrote: On Wed, Apr 16, 2025 at 10:55 PM Andrew MacLeod wrote: This

Re: [PATCH] PR tree-optimization/95801 - infer non-zero for integral division RHS.

2025-04-29 Thread Andrew MacLeod
On 4/28/25 17:26, Andrew MacLeod wrote: I have committed this patch to trunk after bootstrap/regression testing again on trunk. I'll get to gcc14/15 once I flush the current queue. Andrew On 1/23/25 04:39, Richard Biener wrote: On Wed, Jan 22, 2025 at 12:49 AM Andrew MacLeod wrote: This p

Re: [PATCH v5 03/10] libstdc++: Implement std::extents [PR107761].

2025-04-29 Thread Tomasz Kaminski
On Tue, Apr 29, 2025 at 11:52 PM Jonathan Wakely wrote: > On Tue, 29 Apr 2025 at 14:55, Tomasz Kaminski wrote: > > > > > > > > On Tue, Apr 29, 2025 at 2:55 PM Luc Grosheintz > wrote: > >> > >> This implements std::extents from according to N4950 and > >> contains partial progress towards PR107

[PATCH v2] RISC-V: Fix missing implied Zicsr from Zve32x

2025-04-29 Thread Jerry Zhang Jian
The Zve32x extension depends on the Zicsr extension. Currently, enabling Zve32x alone does not automatically imply Zicsr in GCC. gcc/ChangeLog: * common/config/riscv/riscv-common.cc: Add Zve32x depends on Zicsr gcc/testsuite/ChangeLog: * gcc.target/riscv/predef-19.c: set the march to rv64

Re: [PATCH] Use incoming small integer argument value if possible

2025-04-29 Thread Richard Biener
On Tue, Apr 29, 2025 at 3:53 PM H.J. Lu wrote: > > On Tue, Apr 29, 2025 at 9:34 PM Richard Biener > wrote: > > > > On Tue, Apr 29, 2025 at 2:33 PM H.J. Lu wrote: > > > > > > On Tue, Apr 29, 2025 at 6:46 PM Richard Biener > > > wrote: > > > > > > > > On Tue, Apr 29, 2025 at 12:32 PM H.J. Lu wro

Re: [PATCH v2] Change __builtin_unreachable to __builtin_trap if only thing in function [PR109267]

2025-04-29 Thread Richard Biener
On Tue, Apr 29, 2025 at 4:25 PM Andrew Pinski wrote: > > When we have an empty function, things can go wrong with > cfi_startproc/cfi_endproc and a few other things like exceptions. So if > the only thing the function does is a call to __builtin_unreachable, > let's expand that to a __builtin_trap

[PATCH] sreal.h: fix typo in the comment for sreal::max

2025-04-29 Thread Vojtěch Káně
--- gcc/sreal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/sreal.h b/gcc/sreal.h index 8700807a131..c5aef1f3a82 100644 --- a/gcc/sreal.h +++ b/gcc/sreal.h @@ -118,7 +118,7 @@ public: return min; } - /* Global minimum sreal can hold. */ + /* Global maximum

Re: [PATCH] PR tree-optimization/119471 - If the LHS does not contain zero, neither do multiply operands.

2025-04-29 Thread Richard Biener
On Wed, Apr 30, 2025 at 12:00 AM Andrew MacLeod wrote: > > > On 3/28/25 10:36, Andrew MacLeod wrote: > > On 3/28/25 03:19, Richard Biener wrote: > >> On Fri, Mar 28, 2025 at 12:28 AM Andrew MacLeod > >> wrote: > >>> This patch fixes both 119471 and the remainder of 110992. > >>> > >>> At issue is

Re: [COMMITTED] PR tree-optimization/119712 - Always reflect lower bits from mask in subranges.

2025-04-29 Thread Richard Biener
On Wed, Apr 30, 2025 at 12:00 AM Andrew MacLeod wrote: > > > On 4/28/25 17:26, Andrew MacLeod wrote: > > I have committed this patch to trunk after bootstrap/regression > > testing again on trunk. > > > > I'll get to gcc14/15 once I flush the current queue. > > > > Andrew > > > > > > On 4/17/25 06

Re: [PATCH] PR tree-optimization/95801 - infer non-zero for integral division RHS.

2025-04-29 Thread Richard Biener
On Wed, Apr 30, 2025 at 12:00 AM Andrew MacLeod wrote: > > > On 4/28/25 17:26, Andrew MacLeod wrote: > > I have committed this patch to trunk after bootstrap/regression > > testing again on trunk. > > > > I'll get to gcc14/15 once I flush the current queue. > > > > Andrew > > > > On 1/23/25 04:39,

Re: [PATCH] ipa, cgraph: Enable constant propagation to OpenMP kernels

2025-04-29 Thread Jakub Jelinek
On Mon, Apr 28, 2025 at 07:27:31PM +0200, Josef Melcr wrote: > As for the attribute, I am honestly not too sure about what to do, as clang > is > not consistent in with its own indexing, be it with the unknown values, or > with > 'this'. I've tried to remain consistent with GCC's indexing style. I

Re: [PATCH v3] RISC-V: Fix missing implied Zicsr from Zve32x

2025-04-29 Thread Kito Cheng
Seems CI still fail: https://github.com/ewlu/gcc-precommit-ci/issues/3282#issue-3030037257 Executing on host: /home/ewlu/precommit-08/_work/gcc-precommit-ci/gcc-precommit-ci/riscv-gnu-toolchain/build/build-gcc-newlib-stage2/gcc/xgcc -B/home/ewlu/pre commit-08/_work/gcc-precommit-ci/gcc-precommit-

Re: [PATCH][_GLIBCXX_INLINE_VERSION] Fix several test failures

2025-04-29 Thread François Dumont
On 29/04/2025 08:55, Jonathan Wakely wrote: On Mon, 28 Apr 2025, 21:37 François Dumont, wrote: Much better indeed, there is only the aligned_storage adaptation left. It will simplify my big versioned namespace patch to use cxx11 abi, very nice ! libstdc++: [_GLIBCX

Re: [PATCH] RISC-V: Minimal support for ssnpm, smnpm and smmpm extensions.

2025-04-29 Thread Kito Cheng
Hi Dongyan: > diff --git a/gcc/testsuite/gcc.target/riscv/arch-46.c > b/gcc/testsuite/gcc.target/riscv/arch-46.c > new file mode 100644 > index ..fb2bdf72597f > --- /dev/null > +++ b/gcc/testsuite/gcc.target/riscv/arch-46.c > @@ -0,0 +1,10 @@ > +/* { dg-do compile } */ > +/* { dg-optio

Re: [PATCH v5 03/10] libstdc++: Implement std::extents [PR107761].

2025-04-29 Thread Jonathan Wakely
On Tue, 29 Apr 2025 at 14:55, Tomasz Kaminski wrote: > > > > On Tue, Apr 29, 2025 at 2:55 PM Luc Grosheintz > wrote: >> >> This implements std::extents from according to N4950 and >> contains partial progress towards PR107761. >> >> If an extent changes its type, there's a precondition in the s

Re: [PATCH] RISC-V: Allow different dynamic floating point mode to be merged [PR119832]

2025-04-29 Thread Robin Dapp
Although we already try to set the mode needed to FRM_DYN after a function call, there are still some corner cases where both FRM_DYN and FRM_DYN_CALL may appear on incoming edges. Therefore, we use TARGET_MODE_CONFLUENCE to tell GCC that FRM_DYN, FRM_DYN_CALL, and FRM_DYN_EXIT modes are compatib

Re: [PATCH v5 05/10] libstdc++: Implement layout_left from mdspan.

2025-04-29 Thread Tomasz Kaminski
Hi, As we will be landing patches for extends, this will become a separate patch series. I would prefer, if you could commit per layout, and start with layout_right (default) I try to provide prompt responses, so if that works better for you, you can post a patch only with this layout first, as mo

RE: [PATCH] RISC-V: Allow different dynamic floating point mode to be merged [PR119832]

2025-04-29 Thread Li, Pan2
Kind of surprise that this change doesn't make any of the existing frm tests fail(given we have many frm tests). No comment from myside. Pan -Original Message- From: Kito Cheng Sent: Tuesday, April 29, 2025 11:35 AM To: gcc-patches@gcc.gnu.org; kito.ch...@gmail.com; pal...@dabbelt.com

[PATCH v3] RISC-V: Fix missing implied Zicsr from Zve32x

2025-04-29 Thread Jerry Zhang Jian
The Zve32x extension depends on the Zicsr extension. Currently, enabling Zve32x alone does not automatically imply Zicsr in GCC. gcc/ChangeLog: * common/config/riscv/riscv-common.cc: Add Zve32x depends on Zicsr gcc/testsuite/ChangeLog: * gcc.target/riscv/predef-19.c: set the march to rv64

RE: [PATCH v2 1/3] RISC-V: Combine vec_duplicate + vadd.vv to vadd.vx on GR2VR cost

2025-04-29 Thread Li, Pan2
Thanks Robin for help. > as I suggested initializes total with an estimate of the mode size (total = 8 > for me) before we get to riscv_rtx_cost. This makes the rest of the > costs (which we assume to be relative to 4) inaccurate. I see, that explains how cost value 8 comes from. > Then we sho

Re: [PATCH] strlen: Handle empty constructor as memset for combining with malloc to calloc [PR87900]

2025-04-29 Thread Hans-Peter Nilsson
Random-typo-spotting-mode activated: On Sat, 19 Apr 2025, Andrew Pinski wrote: > +++ b/gcc/testsuite/gcc.dg/tree-ssa/calloc-10.c > +/* zeroing out via a CONSTRUCTOR should be treated similarly as a msmet and "memset" > diff --git a/gcc/testsuite/gcc.dg/tree-ssa/calloc-11.c > b/gcc/testsuite/gc

Re: [PATCH] RISC-V: Allow different dynamic floating point mode to be merged [PR119832]

2025-04-29 Thread 钟居哲
LGTM juzhe.zh...@rivai.ai From: Kito Cheng Date: 2025-04-29 11:35 To: gcc-patches; kito.cheng; palmer; jeffreyalaw; rdapp; juzhe.zhong; pan2.li; vineetg CC: Kito Cheng Subject: [PATCH] RISC-V: Allow different dynamic floating point mode to be merged [PR119832] Although we already try to set

RE: Make ix86 cost of VEC_SELECT equivalent to SUBREG same as of SUBREG

2025-04-29 Thread Liu, Hongtao
> -Original Message- > From: Jan Hubicka > Sent: Wednesday, April 30, 2025 4:11 AM > To: gcc-patches@gcc.gnu.org; Liu, Hongtao ; > ro...@nextmovesoftware.com; ubiz...@gmail.com > Subject: Make ix86 cost of VEC_SELECT equivalent to SUBREG same as of > SUBREG > > Hi, > this patch (partly

Re: [PATCH] PR tree-optimization/119471 - If the LHS does not contain zero, neither do multiply operands.

2025-04-29 Thread Andrew MacLeod
On 3/28/25 10:36, Andrew MacLeod wrote: On 3/28/25 03:19, Richard Biener wrote: On Fri, Mar 28, 2025 at 12:28 AM Andrew MacLeod wrote: This patch fixes both 119471 and the remainder of 110992. At issue is we do not recognize that if     "a * b != 0" , then neither "a" nor "b" can be zero.

Re: [PATCH v2] RISC-V: Recognized Svrsw60t59b extension

2025-04-29 Thread Kito Cheng
LGTM, but pending for the spec ratified, also a minor comment is the link seems dead, we may use https://github.com/riscv/riscv-isa-manual/pull/1907 instead On Fri, Mar 21, 2025 at 8:56 AM Mingzhu Yan wrote: > > This patch support svrsw60t59b extension[1]. > To enable GCC to recognize and process

[PATCH] MIPS: Fixed the problem that the nop instruction is inserted at the wrong position after enabling '-fpatchable-function-entry='

2025-04-29 Thread Lulu Cheng
Because MIPS function symbol is generated in the prologue function, this nop generation should be done in prologue. OK for trunk? PR target/99217 gcc/ChangeLog: * config/mips/mips.cc (mips_start_function_definition): Implements the functionality of '-fpatchable-function-e

Re: [PATCH][gcc13] PR tree-optimization/117287 - Backport new assume implementation

2025-04-29 Thread Andrew MacLeod
On 3/28/25 05:25, Jakub Jelinek wrote: On Fri, Mar 28, 2025 at 08:12:35AM +0100, Richard Biener wrote: On Thu, Mar 27, 2025 at 8:14 PM Andrew MacLeod wrote: This patch backports the ASSUME support that was rewritten in GCC 15. Its slightly more complicated than the port to GCC 14 was in that

[pushed] i386: Skip sub-RTXes of memory operand in ix86_update_stack_alignment

2025-04-29 Thread Uros Bizjak
Skip sub-RTXes of the memory operand if stack access register is not mentioned in the operand. gcc/ChangeLog: * config/i386/i386.cc (ix86_update_stack_alignment): Skip sub-RTXes of the memory operand if stack access register is not mentioned in the operand. Bootstrapped and regressio

[PATCH v3] libstdc++: Cleanup and stabilize format _Spec<_CharT> and _Pres_type.

2025-04-29 Thread Tomasz Kamiński
These patch makes following changes to _Pres_type values: * _Pres_esc is replaced with separate _M_debug flag. * _Pres_s, _Pres_p do not overlap with _Pres_none. * hexadecimal presentation use same values for pointer, integer and floating point types. Instead of `_M_reserved` and `_M_reserve

Re: [PATCH] x86-64: Don't expand UNSPEC_TLS_LD_BASE to a call

2025-04-29 Thread Uros Bizjak
On Tue, Apr 29, 2025 at 9:56 AM H.J. Lu wrote: > > Don't expand UNSPEC_TLS_LD_BASE to a call so that the RTL local copy > propagation pass can eliminate multiple __tls_get_addr calls. __tls_get_addr needs to be called with 16-byte aligned stack, I don't think the compiler will correctly handle re

Re: [PATCH v2] libstdc++: Use 'if constexpr' to slightly simplify

2025-04-29 Thread Tomasz Kaminski
On Tue, Apr 29, 2025 at 10:58 AM Jonathan Wakely wrote: > This will hardly make a dent in the very slow compile times for > but it seems worth doing anyway. > > libstdc++-v3/ChangeLog: > > * include/bits/regex_compiler.h: Replace _GLIBCXX17_CONSTEXPR > with constexpr and disable

Re: [PATCH] libstdc++: Use constexpr-if for C++11 and C++14

2025-04-29 Thread Tomasz Kaminski
On Tue, Apr 29, 2025 at 11:05 AM Jonathan Wakely wrote: > Replace remaining uses of _GLIBCXX17_CONSTEXPR for constexpr-if, so that > we always use constexpr-if in C++11 and C++14. Diagnostic pragmas are > used to suppress diagnostics. > > libstdc++-v3/ChangeLog: > > * include/bits/char_tr

[pushed] i386: Allow string instructions from non-default address space [PR111657]

2025-04-29 Thread Uros Bizjak
MOVS instructions allow segment override of their source operand, e.g.: rep movsq %gs:(%rsi), (%rdi) where %rsi is the address of the source location (with %gs segment override) and %rdi is the address of the destination location. The testcase improves from (-O2 -mno-sse -mtune=generic):

[PATCH 0/1] Fix BZ 119317: named loops (C2y) with debug info

2025-04-29 Thread Christopher Bazley
Fixed https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119317 Tested on AArch64 using the test case provided by the bug reporter: int fun() { main: while(1) continue main; } Without the fix, this program failed to compile: test.c: In function ‘fun’: test.c:5:14: error: ‘continue’ statement

[PATCH v5 01/10] libstdc++: Setup internal FTM for mdspan.

2025-04-29 Thread Luc Grosheintz
Uses the FTM infrastructure to create an internal feature testing macro for partial availability of mdspan; which is then used to hide the contents of the header mdspan when compiling against a standard prior to C++23. libstdc++-v3/ChangeLog: * include/bits/version.def: Add internal featu

[PATCH v5 07/10] libstdc++: Implement layout_right from mdspan.

2025-04-29 Thread Luc Grosheintz
Implement the parts of layout_left that depend on layout_right; and the parts of layout_right that don't depend on layout_stride. libstdc++/ChangeLog: * include/std/mdspan (layout_right): New class. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 147 +++

[PATCH v5 00/10] Implement extents and layouts from the mdspan header.

2025-04-29 Thread Luc Grosheintz
This patch series follows up on: https://gcc.gnu.org/pipermail/libstdc++/2025-April/061078.html As agreed, I'm appending commits that add the layouts to this patch series. Each layout is added in a separate commit and tests are added in the immediately following commit. Changes since v4 to std::e

[PATCH v5 03/10] libstdc++: Implement std::extents [PR107761].

2025-04-29 Thread Luc Grosheintz
This implements std::extents from according to N4950 and contains partial progress towards PR107761. If an extent changes its type, there's a precondition in the standard, that the value is representable in the target integer type. This precondition is not checked at runtime. The precondition fo

[PATCH v5 08/10] libstdc++: Add tests for layout_right.

2025-04-29 Thread Luc Grosheintz
Adds tests for layout_right and for the parts of layout_left that depend on layout_right. libstdc++/ChangeLog: * testsuite/23_containers/mdspan/layouts/class_mandate_neg.cc: Add tests for layout_stride. * testsuite/23_containers/mdspan/layouts/ctors.cc: Add tests for

[PATCH v5 04/10] libstdc++: Add tests for std::extents.

2025-04-29 Thread Luc Grosheintz
A prior commit added std::extents, this commit adds the tests. The bulk is focussed on testing the constructors. These are split into three groups: 1. the ctor from other extents and the copy ctor, 2. the ctor from a pack of integer-like objects, 3. the ctor from shapes, i.e. span and array. For

[PATCH v5 05/10] libstdc++: Implement layout_left from mdspan.

2025-04-29 Thread Luc Grosheintz
Implements the parts of layout_left that don't depend on any of the other layouts. libstdc++/ChangeLog: * include/std/mdspan (layout_left): New class. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 179 1 file changed, 179 insertion

[PATCH] c++: UNBOUND_CLASS_TEMPLATE context substitution [PR119981]

2025-04-29 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk/15/14? -- >8 -- In r15-123 and r14-11434 we unconditionally set processing_template_decl when substituting the context of an UNBOUND_CLASS_TEMPLATE, in order to handle instantiation of the dependently scoped friend dec

[PATCH v5 09/10] libstdc++: Implement layout_stride from mdspan.

2025-04-29 Thread Luc Grosheintz
Implements the remaining parts of layout_left and layout_right; and all of layout_stride. libstdc++/ChangeLog: * include/std/mdspan(layout_stride): New class. Signed-off-by: Luc Grosheintz --- libstdc++-v3/include/std/mdspan | 227 1 file changed, 227 i

[PATCH 1/1] Fix BZ 119317: named loops (C2y) with debug info

2025-04-29 Thread Christopher Bazley
Named loops (C2y) could not previously be compiled with -O1 and -ggdb2 or higher because the label preceding a loop (or switch) could not be found when using such command lines. This could be observed by compiling gcc/gcc/testsuite/gcc.dg/c2y-named-loops-1.c with the provoking command line (or any

[PATCH v5 06/10] libstdc++: Add tests for layout_left.

2025-04-29 Thread Luc Grosheintz
Implements a suite of tests for the currently implemented parts of layout_left. The individual tests are templated over the layout type, to allow reuse as more layouts are added. libstdc++/ChangeLog: * testsuite/23_containers/mdspan/layouts/class_mandate_neg.cc: New test. * testsu

[PATCH v5 10/10] libstdc++: Add tests for layout_stride.

2025-04-29 Thread Luc Grosheintz
Implements the tests for layout_stride and for the features of the other two layouts that depend on layout_stride. libstdc++/ChangeLog: * testsuite/23_containers/mdspan/layouts/class_mandate_neg.cc: Add tests for layout_stride. * testsuite/23_containers/mdspan/layouts/ctor

Re: [PATCH] RISC-V: Fix missing implied Zicsr from Zve32x

2025-04-29 Thread Kito Cheng
Seems like the testcase will fail https://github.com/ewlu/gcc-precommit-ci/issues/3278#issuecomment-2837806049 > diff --git a/gcc/testsuite/gcc.target/riscv/predef-19.c > b/gcc/testsuite/gcc.target/riscv/predef-19.c > index 2b90702192b..b29e60f9b99 100644 > --- a/gcc/testsuite/gcc.target/riscv/pr

[PATCH v6 1/2] RISC-V: Add intrinsics support for SiFive Xsfvcp extensions.

2025-04-29 Thread Kito Cheng
From: yulong This version is same as v5, but rebase to trunk, send out to trigger CI. This commit adds intrinsics support for Xsfvcp extension. Diff with V4: Delete the sifive_vector.h file. Co-Authored by: Jiawei Chen Co-Authored by: Shihua Liao Co-Authored by: Yixuan Chen gcc/ChangeLog:

Re: [PATCH v5 02/10] libstdc++: Add header mdspan to the build-system.

2025-04-29 Thread Jonathan Wakely
On Tue, 29 Apr 2025 at 13:59, Luc Grosheintz wrote: > > Creates a nearly empty header mdspan and adds it to the build-system and > Doxygen config file. > > libstdc++-v3/ChangeLog: > > * doc/doxygen/user.cfg.in: Add . > * include/Makefile.am: Ditto. > * include/Makefile.in:

[PATCH v6 2/2] RISC-V: Add intrinsics testcases for SiFive Xsfvcp extensions.

2025-04-29 Thread Kito Cheng
From: yulong This commit adds testcases for Xsfvcp. Co-Authored by: Jiawei Chen Co-Authored by: Shihua Liao Co-Authored by: Yixuan Chen gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/xsfvector/sf_vc_f.c: New test. * gcc.target/riscv/rvv/xsfvector/sf_vc_i.c: New test.

RE: [PATCH v2 1/3] RISC-V: Combine vec_duplicate + vadd.vv to vadd.vx on GR2VR cost

2025-04-29 Thread Li, Pan2
I see, let the vec_dup enter the rtx_cost again to append the total to vmv, I have a try testing. For example with below change: + switch (rcode) + { + case VEC_DUPLICATE: + *total += get_vector_costs ()->regmove->GR2VR * COSTS_N_INSNS (1); + break; +

Re: [PATCH] Use incoming small integer argument value if possible

2025-04-29 Thread H.J. Lu
On Tue, Apr 29, 2025 at 5:56 PM Richard Biener wrote: > > On Tue, Apr 29, 2025 at 10:48 AM H.J. Lu wrote: > > > > On Tue, Apr 29, 2025 at 4:25 PM Richard Biener > > wrote: > > > > > > On Tue, Apr 29, 2025 at 9:39 AM H.J. Lu wrote: > > > > > > > > For targets, like x86, which define TARGET_PROMO

Re: [PATCH] RISC-V: Fix register move cost for SIBCALL_REGS/JALR_REGS

2025-04-29 Thread Kito Cheng
LGTM, and pushed to the trunk :) On Mon, Apr 28, 2025 at 10:04 AM 曾治金 wrote: > > Hi, according to Jeff's requirement > (https://gcc.gnu.org/pipermail/gcc-patches/2025-April/681864.html), I divide > the change of riscv_register_move_cost into separate patch. Please help to > review. Thanks. > >

Re: [PATCH v5 03/10] libstdc++: Implement std::extents [PR107761].

2025-04-29 Thread Jonathan Wakely
On Tue, 29 Apr 2025 at 13:54, Luc Grosheintz wrote: > > This implements std::extents from according to N4950 and > contains partial progress towards PR107761. > > If an extent changes its type, there's a precondition in the standard, > that the value is representable in the target integer type. T

Re: [PATCH] i386/cygming: Decrease default preferred stack boundary for 32-bit targets

2025-04-29 Thread LIU Hao
在 2025-4-29 13:03, LIU Hao 写道: This fixes a long-standing issue that GCC used to assume 16-byte stack alignment on i686-w64-mingw32, which is not always the case for callbacks from system libraries. CC Zeb Figura This patch looks a bit risky. The overall effect of `__attribute__((__force_ali

[PATCH] tree-optimization/119997 - &ptr->field no longer subject to PRE

2025-04-29 Thread Richard Biener
The following makes PRE handle &ptr->field the same as VN by treating it as a POINTER_PLUS_EXPR when possible and thus as 'nary'. To facilitate this the patch splits out vn_pp_nary_for_addr and adds const overloads for vec::last. The patch also avoids handling an effective zero offset as POINTER_

Re: [PATCH] Use incoming small integer argument value if possible

2025-04-29 Thread Richard Biener
On Tue, Apr 29, 2025 at 12:32 PM H.J. Lu wrote: > > On Tue, Apr 29, 2025 at 5:56 PM Richard Biener > wrote: > > > > On Tue, Apr 29, 2025 at 10:48 AM H.J. Lu wrote: > > > > > > On Tue, Apr 29, 2025 at 4:25 PM Richard Biener > > > wrote: > > > > > > > > On Tue, Apr 29, 2025 at 9:39 AM H.J. Lu wr

Re: [pushed] i386: Allow string instructions from non-default address space [PR111657]

2025-04-29 Thread H.J. Lu
On Tue, Apr 29, 2025 at 5:52 PM Uros Bizjak wrote: > > MOVS instructions allow segment override of their source operand, e.g.: > > rep movsq %gs:(%rsi), (%rdi) > > where %rsi is the address of the source location (with %gs segment override) > and %rdi is the address of the destination location

RE: [EXTERNAL]Re: [PATCH]RISCV :Added MIPS P8700 Subtarget

2025-04-29 Thread Umesh Kalappa
Hi all, Here is the updated patch that address some of the @Jeff Law comments . P8700 don't have a vector engine and we support the insns type till https://github.com/gcc-mirror/gcc/blob/master/gcc/config/riscv/riscv.md#L358 and schedule module enabled the same . --- gcc/config/riscv/mips

Re: [PATCH] Use incoming small integer argument value if possible

2025-04-29 Thread H.J. Lu
On Tue, Apr 29, 2025 at 6:46 PM Richard Biener wrote: > > On Tue, Apr 29, 2025 at 12:32 PM H.J. Lu wrote: > > > > On Tue, Apr 29, 2025 at 5:56 PM Richard Biener > > wrote: > > > > > > On Tue, Apr 29, 2025 at 10:48 AM H.J. Lu wrote: > > > > > > > > On Tue, Apr 29, 2025 at 4:25 PM Richard Biener

Re: [pushed] i386: Allow string instructions from non-default address space [PR111657]

2025-04-29 Thread H.J. Lu
On Tue, Apr 29, 2025 at 6:49 PM Uros Bizjak wrote: > > On Tue, Apr 29, 2025 at 12:41 PM H.J. Lu wrote: > > > > On Tue, Apr 29, 2025 at 5:52 PM Uros Bizjak wrote: > > > > > > MOVS instructions allow segment override of their source operand, e.g.: > > > > > > rep movsq %gs:(%rsi), (%rdi) > > >

Re: [PATCH] Use incoming small integer argument value if possible

2025-04-29 Thread Richard Biener
On Tue, Apr 29, 2025 at 2:33 PM H.J. Lu wrote: > > On Tue, Apr 29, 2025 at 6:46 PM Richard Biener > wrote: > > > > On Tue, Apr 29, 2025 at 12:32 PM H.J. Lu wrote: > > > > > > On Tue, Apr 29, 2025 at 5:56 PM Richard Biener > > > wrote: > > > > > > > > On Tue, Apr 29, 2025 at 10:48 AM H.J. Lu wr

Re: [PATCH v2 1/3] RISC-V: Combine vec_duplicate + vadd.vv to vadd.vx on GR2VR cost

2025-04-29 Thread Robin Dapp
I see, let the vec_dup enter the rtx_cost again to append the total to vmv, I have a try testing. For example with below change: + switch (rcode) + { + case VEC_DUPLICATE: + *total += get_vector_costs ()->regmove->GR2VR * COSTS_N_INSNS (1); + break; +

[RFC 0/3] Use automatic make dependencies in aarch64

2025-04-29 Thread Alice Carlotti
This RFC series shows the steps that I believe are relevant to using automatic make depencies, and optionally automatic make rules, in the aarch64 backend. I believe the same steps and caveats would apply to other backends as well. This builds upon the work by Tom Tromey in 2013 (see e.g. [1]), w

Re: [PATCH v3] libstdc++: Cleanup and stabilize format _Spec<_CharT> and _Pres_type.

2025-04-29 Thread Tomasz Kaminski
On Tue, Apr 29, 2025 at 12:58 PM Tomasz Kaminski wrote: > > > On Tue, Apr 29, 2025 at 9:28 AM Tomasz Kamiński > wrote: > >> These patch makes following changes to _Pres_type values: >> * _Pres_esc is replaced with separate _M_debug flag. >> * _Pres_s, _Pres_p do not overlap with _Pres_none. >>

Re: [PATCH v3] libstdc++: Cleanup and stabilize format _Spec<_CharT> and _Pres_type.

2025-04-29 Thread Tomasz Kaminski
On Tue, Apr 29, 2025 at 9:28 AM Tomasz Kamiński wrote: > These patch makes following changes to _Pres_type values: > * _Pres_esc is replaced with separate _M_debug flag. > * _Pres_s, _Pres_p do not overlap with _Pres_none. > * hexadecimal presentation use same values for pointer, integer >

Re: [pushed] i386: Allow string instructions from non-default address space [PR111657]

2025-04-29 Thread Uros Bizjak
On Tue, Apr 29, 2025 at 12:41 PM H.J. Lu wrote: > > On Tue, Apr 29, 2025 at 5:52 PM Uros Bizjak wrote: > > > > MOVS instructions allow segment override of their source operand, e.g.: > > > > rep movsq %gs:(%rsi), (%rdi) > > > > where %rsi is the address of the source location (with %gs segmen

Re: [PATCH] AArch64: Fold LD1/ST1 with ptrue to LDR/STR for 128-bit VLS

2025-04-29 Thread Richard Sandiford
Jennifer Schmitz writes: > diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc > index f7bccf532f8..1c06b8528e9 100644 > --- a/gcc/config/aarch64/aarch64.cc > +++ b/gcc/config/aarch64/aarch64.cc > @@ -6416,13 +6416,30 @@ aarch64_stack_protect_canary_mem (machine_mode mode,

[PATCH v5 02/10] libstdc++: Add header mdspan to the build-system.

2025-04-29 Thread Luc Grosheintz
Creates a nearly empty header mdspan and adds it to the build-system and Doxygen config file. libstdc++-v3/ChangeLog: * doc/doxygen/user.cfg.in: Add . * include/Makefile.am: Ditto. * include/Makefile.in: Ditto. * include/precompiled/stdc++.h: Ditto. * inclu

Re: [PATCH v5 03/10] libstdc++: Implement std::extents [PR107761].

2025-04-29 Thread Jonathan Wakely
On Tue, 29 Apr 2025 at 13:54, Luc Grosheintz wrote: > > This implements std::extents from according to N4950 and > contains partial progress towards PR107761. > > If an extent changes its type, there's a precondition in the standard, > that the value is representable in the target integer type. T

[RFC 2/3] aarch64: Remove explicit make dependencies

2025-04-29 Thread Alice Carlotti
This might miss some dependencies when doing an incremental build where the previous build did not include generated dependency files, and the .cc file has not subsequently changed (but another dependency has). gcc/ChangeLog: * config/aarch64/t-aarch64: Remove explicit .o dependencies.

[RFC 3/3] aarch64: Use default .cc.o rule to build aarch64 .cc files

2025-04-29 Thread Alice Carlotti
The change to gcc/configure is a hack to illustrate where we need extra arguments available. If the rest of the change is desirable, then we could define a new variable to include these extra directories. diff --git a/gcc/config.gcc b/gcc/config.gcc index 6dbe880c9d45369a0128d79f5fa30ca07faf953

[PATCH 1/2] tree-optimization/119960 - fix and guard get_later_stmt

2025-04-29 Thread Richard Biener
The following makes get_later_stmt handle stmts from different basic-blocks in the case they are orderd and otherwise asserts. Bootstrap/regtest running on x86_64-unknown-linux-gnu. * tree-vectorizer.h (get_later_stmt): Robustify against stmts in different BBs, assert when they ar

[RFC 1/3] aarch64: Generate automatic dependency rules

2025-04-29 Thread Alice Carlotti
This also improves consistency of the compile commands, and eliminates an ALL_SPPFLAGS typo. gcc/ChangeLog: * config/aarch64/t-aarch64: Use $(COMPILE) and $(POSTCOMPILE) diff --git a/gcc/config/aarch64/t-aarch64 b/gcc/config/aarch64/t-aarch64 index 59571948479c0857df2cca70b18df6c5d9a72

[PATCH 2/2] tree-optimization/119960 - add validity checking to SLP scheduling

2025-04-29 Thread Richard Biener
The following adds checks that when we search for a vector stmt insert location we arrive at one where all required operand defs are dominating the insert location. At the moment any such failure only blows up during SSA verification. There's the long-standing issue that we do not verify there ex

Re: [PATCH] Use incoming small integer argument value if possible

2025-04-29 Thread H.J. Lu
On Tue, Apr 29, 2025 at 9:34 PM Richard Biener wrote: > > On Tue, Apr 29, 2025 at 2:33 PM H.J. Lu wrote: > > > > On Tue, Apr 29, 2025 at 6:46 PM Richard Biener > > wrote: > > > > > > On Tue, Apr 29, 2025 at 12:32 PM H.J. Lu wrote: > > > > > > > > On Tue, Apr 29, 2025 at 5:56 PM Richard Biener >

Re: [PATCH v5 03/10] libstdc++: Implement std::extents [PR107761].

2025-04-29 Thread Tomasz Kaminski
On Tue, Apr 29, 2025 at 2:55 PM Luc Grosheintz wrote: > This implements std::extents from according to N4950 and > contains partial progress towards PR107761. > > If an extent changes its type, there's a precondition in the standard, > that the value is representable in the target integer type.

Re: [PATCH v5 05/10] libstdc++: Implement layout_left from mdspan.

2025-04-29 Thread Jonathan Wakely
On Tue, 29 Apr 2025 at 13:56, Luc Grosheintz wrote: > > Implements the parts of layout_left that don't depend on any of the > other layouts. > > libstdc++/ChangeLog: N.B. this needs to be libstdc++-v3/Changelog with "-v3", or the git hooks will reject it. Similarly in patches 6/10 to 10/10. Ther

[PATCH v3] x86: Add a pass to remove redundant all 0s/1s vector load

2025-04-29 Thread H.J. Lu
On Tue, Apr 29, 2025 at 11:27 AM H.J. Lu wrote: > > On Tue, Apr 29, 2025 at 10:08 AM Hongtao Liu wrote: > > > > On Mon, Apr 28, 2025 at 5:07 PM H.J. Lu wrote: > > > > > > On Mon, Apr 28, 2025 at 4:26 PM H.J. Lu wrote: > > > > > > > > > > > > > This is what my patch does: > > > > > But it iterat

Re: [PATCH] i386: Add ix86_expand_unsigned_small_int_cst_argument

2025-04-29 Thread H.J. Lu
On Tue, Apr 29, 2025 at 2:51 PM Liu, Hongtao wrote: > > > > > -Original Message- > > From: H.J. Lu > > Sent: Tuesday, April 29, 2025 1:58 PM > > To: Hongtao Liu > > Cc: GCC Patches ; Uros Bizjak > > ; Liu, Hongtao > > Subject: Re: [PATCH] i386: Add > > ix86_expand_unsigned_small_int_cst

RE: [PATCH v3] x86: Add a pass to remove redundant all 0s/1s vector load

2025-04-29 Thread Liu, Hongtao
> -Original Message- > From: H.J. Lu > Sent: Tuesday, April 29, 2025 2:59 PM > To: Hongtao Liu > Cc: GCC Patches ; Liu, Hongtao > ; Uros Bizjak > Subject: [PATCH v3] x86: Add a pass to remove redundant all 0s/1s vector > load > > On Tue, Apr 29, 2025 at 11:27 AM H.J. Lu wrote: > > >

[PATCH] RISC-V: Fix missing implied Zicsr from Zve32x

2025-04-29 Thread Jerry Zhang Jian
The Zve32x extension depends on the Zicsr extension. Currently, enabling Zve32x alone does not automatically imply Zicsr in GCC. gcc/ChangeLog: * common/config/riscv/riscv-common.cc: Add Zve32x depends on Zicsr gcc/testsuite/ChangeLog: * gcc.target/riscv/predef-19.c: set the march to rv64

Re: [PATCH] libstdc++: Use constexpr-if in std::function for C++11 and C++14

2025-04-29 Thread Tomasz Kaminski
On Tue, Apr 29, 2025 at 11:01 AM Jonathan Wakely wrote: > This allows removing the _Target_handler class template, because it's no > longer needed to prevent instantiating invalid specializations of > _Function_handler. > > libstdc++-v3/ChangeLog: > > * include/bits/std_function.h (_Targe

Re: [PATCH] libstdc++: Fix allocator propagation for rvalue+rvalue string concatenation

2025-04-29 Thread Tomasz Kaminski
On Tue, Apr 29, 2025 at 10:49 AM Jonathan Wakely wrote: > I made a last-minute change to Nina's r10-200-gf4e678ef74b272 > implementation of P1165R1 (consistent allocator propagation for > operator+ on strings), so that the rvalue+rvalue case assumes that COW > strings do not support stateful allo

Re: [PATCH] (not just) AArch64: Fold unsigned ADD + LSR by 1 to UHADD

2025-04-29 Thread Richard Biener
On Tue, 29 Apr 2025, Richard Sandiford wrote: > Pengfei Li writes: > > This patch implements the folding of a vector addition followed by a > > logical shift right by 1 (add + lsr #1) on AArch64 into an unsigned > > halving add, allowing GCC to emit NEON or SVE2 UHADD instructions. > > > > For ex

[PATCH] x86-64: Don't expand UNSPEC_TLS_LD_BASE to a call

2025-04-29 Thread H.J. Lu
Don't expand UNSPEC_TLS_LD_BASE to a call so that the RTL local copy propagation pass can eliminate multiple __tls_get_addr calls. gcc/ PR target/81501 * config/i386/i386-protos.h (ix86_split_tls_local_dynamic_base_64): New. * config/i386/i386.cc (ix86_split_tls_local_dynamic_base_64): New. (legi

[PATCH] c++/modules: Catch exposures of TU-local values through inline references [PR119996]

2025-04-29 Thread Nathaniel Shead
Bootstrapped and regtested on x86_64-pc-linux-gnu (so far just modules.exp), OK for trunk and 15 if full regtest succeeds? -- >8 -- In r15-9136-g0210bedf481a9f we started erroring for inline variables that exposed TU-local entities in their definition, as such variables would need to have their d

Re: [PATCH] target.def: Remove TARGET_PROMOTE_FUNCTION_RETURN reference

2025-04-29 Thread Richard Biener
On Tue, Apr 29, 2025 at 3:49 AM H.J. Lu wrote: > > Since TARGET_PROMOTE_FUNCTION_RETURN is no longer used, remove its > reference from target.def. > > PR target/119985 > * target.def: Remove TARGET_PROMOTE_FUNCTION_RETURN reference. > * doc/tm.texi: Regenerated. > > OK for master? OK. Richard.

[PATCH V3] [autofdo] Annotate empty bb with all debug_stmt with location of phi in the single_succ.

2025-04-29 Thread liuhongt
From: "hongtao.liu" > another thing, you can save the walk over PHI args by using > > gimple_phi_arg_location (phi, tmp_e->dest_idx); > Changed, use gimple_phi_arg_location_from_edge (phi, tmp_e); For an empty BB with all debug_stmt, it will be ignored by afdo_set_bb

[PATCH][15.2] nr2.0: late: Correctly initialize funny_error member

2025-04-29 Thread arthur . cohen
From: Arthur Cohen Hi everyone, We noticed inconsistent errors when running name-resolution 2.0 on certain files, where an invalid error was triggered and the message was from the `funny_ice` error finalizer function we had added as an easter egg. We realized yesterday that the undefined value w

Re: [PATCH V3] [autofdo] Annotate empty bb with all debug_stmt with location of phi in the single_succ.

2025-04-29 Thread Richard Biener
On Tue, Apr 29, 2025 at 10:21 AM liuhongt wrote: > > From: "hongtao.liu" > > > another thing, you can save the walk over PHI args by using > > > > gimple_phi_arg_location (phi, tmp_e->dest_idx); > > > Changed, use gimple_phi_arg_location_from_edge (phi, tmp_e); > > >

Re: [PATCH] (not just) AArch64: Fold unsigned ADD + LSR by 1 to UHADD

2025-04-29 Thread Richard Sandiford
Pengfei Li writes: > This patch implements the folding of a vector addition followed by a > logical shift right by 1 (add + lsr #1) on AArch64 into an unsigned > halving add, allowing GCC to emit NEON or SVE2 UHADD instructions. > > For example, this patch helps improve the codegen from: > a

Re: [PATCH] Use incoming small integer argument value if possible

2025-04-29 Thread Richard Biener
On Tue, Apr 29, 2025 at 9:39 AM H.J. Lu wrote: > > For targets, like x86, which define TARGET_PROMOTE_PROTOTYPES to return > true, all integer arguments smaller than int are passed as int: > > [hjl@gnu-tgl-3 pr14907]$ cat x.c > extern int baz (char c1); > > int > foo (char c1) > { > return baz (

Re: [PATCH][15.2] nr2.0: late: Correctly initialize funny_error member

2025-04-29 Thread Andrew Pinski
On Tue, Apr 29, 2025 at 1:26 AM wrote: > > From: Arthur Cohen > > Hi everyone, > > We noticed inconsistent errors when running name-resolution 2.0 on > certain files, where an invalid error was triggered and the message was > from the `funny_ice` error finalizer function we had added as an easter

[PATCH] libstdc++: Fix parallel algos for move-only values [PR117905]

2025-04-29 Thread Jonathan Wakely
All of reduce, transform_reduce, exclusive_scan, and inclusive_scan, transform_exclusive_scan, and transform_inclusive_scan have a precondition that the type of init meets the Cpp17MoveConstructible requirements. It isn't required to be copy constructible, so when passing it to the next internal fu

Re: [PATCH] Use incoming small integer argument value if possible

2025-04-29 Thread H.J. Lu
On Tue, Apr 29, 2025 at 4:25 PM Richard Biener wrote: > > On Tue, Apr 29, 2025 at 9:39 AM H.J. Lu wrote: > > > > For targets, like x86, which define TARGET_PROMOTE_PROTOTYPES to return > > true, all integer arguments smaller than int are passed as int: > > > > [hjl@gnu-tgl-3 pr14907]$ cat x.c > >

Re: [PATCH][15.2] nr2.0: late: Correctly initialize funny_error member

2025-04-29 Thread Marc Poulhiès
April 29, 2025 at 10:39 AM, "Andrew Pinski" mailto:pins...@gmail.com?to=%22Andrew%20Pinski%22%20%3Cpinskia%40gmail.com%3E > wrote: > > On Tue, Apr 29, 2025 at 1:26 AM wrote: > > > > > From: Arthur Cohen > > > > Hi everyone, > > > > We noticed inconsistent errors when running name-resolu

[PATCH] libstdc++: Fix allocator propagation for rvalue+rvalue string concatenation

2025-04-29 Thread Jonathan Wakely
I made a last-minute change to Nina's r10-200-gf4e678ef74b272 implementation of P1165R1 (consistent allocator propagation for operator+ on strings), so that the rvalue+rvalue case assumes that COW strings do not support stateful allocators. I don't think that was true when the change went in, and c

[PATCH] libstdc++: Use 'if constexpr' to simplify std::vector relocation

2025-04-29 Thread Jonathan Wakely
Simplify std::vector's use of std::__relocate_a by using 'if constexpr' even in C++11 and C++14, with diagnostic pragmas to disable warnings. This allows us to call std::__relocate_a directly, instead of via _S_relocate and tag distpatching. Preserve _S_relocate so that explicit instantiations sti

  1   2   >