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] 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] 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: [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/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: [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] 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

[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][_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 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 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] 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

[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] 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

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 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 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 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

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: 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][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

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: [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/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 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

[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

[PATCH] x86: Remove SSE_FIRST_REG from ix86_class_likely_spilled_p

2025-04-29 Thread H.J. Lu
SSE_FIRST_REG was added to CLASS_LIKELY_SPILLED_P, which became TARGET_CLASS_LIKELY_SPILLED_P, for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40470 Since RA has been improved and xmm0 is a commonly used register, remove SSE_FIRST_REG from ix86_class_likely_spilled_p to improve xmm0 codegen: 1.

[PATCH] x86: Update TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P

2025-04-29 Thread H.J. Lu
SMALL_REGISTER_CLASSES was added by commit c98f874233428d7e6ba83def7842fd703ac0ddf1 Author: James Van Artsdalen Date: Sun Feb 9 13:28:48 1992 + Initial revision which became TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P. It is false from day 1 for i386. Since x86-64 doubles the number of

Re: [PATCH v2] Consider frequency in cost estimation when converting scalar to vector.

2025-04-29 Thread Jan Hubicka
> > so gain is the difference of runtime of integer variant compared to > > vector vairant and cost are the extra int->see and sse->int conversions > > needed? > > > > If you scale everything by a BB frequency, you will get a weird > > behaviour if chain happens to consist only of instructions in

Fix cs_interesting_for_ipcp_p wrt flag_profile_partial_training.

2025-04-29 Thread Jan Hubicka
Hi, as noticed by Martin Jambor, I introduced a bug while simplifying cs_interesting_for_ipcp_p and reversed condition for flag_profile_partial_training. Also I noticed that we probably want to consider calls with unintialized counts for cloning so the pass does somehting with -fno-guess-branch-pr

Re: [PATCH v2] Consider frequency in cost estimation when converting scalar to vector.

2025-04-29 Thread Jan Hubicka
> > > I am generally trying to get rid of remaing uses of REG_FREQ since the > > > 1 based fixed point arithmetics iot always working that well. > > > > > > You can do the sums in profile_count type (doing something reasonable > > > when count is uninitialized) and then convert it to sreal for

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

2025-04-29 Thread Jan Hubicka
Hi, this patch (partly) solves problem in PR119900 where changing ix86_size_cost of chap SSE instruction from 2 bytes to 4 bytes regresses imagemagick with PGO (119% on core and 54% on Zen) There is an interesting chain of problems 1) the train run of the SPEC2017 imagick is wrong and it does not

[PATCH] libstdc++: Rewrite atomic builtin checks [PR70560]

2025-04-29 Thread Jonathan Wakely
Currently the GLIBCXX_ENABLE_ATOMIC_BUILTINS macro checks for a variety of __atomic built-ins for bool, short and int. If all those checks pass, then it defines _GLIBCXX_ATOMIC_BUILTINS and uses the definitions from config/cpu/generic/atomicity_builtins/atomicity.h for the non-inline versions of __

Re: [PATCH v2] Consider frequency in cost estimation when converting scalar to vector.

2025-04-29 Thread Jan Hubicka
> > I am generally trying to get rid of remaing uses of REG_FREQ since the > > 1 based fixed point arithmetics iot always working that well. > > > > You can do the sums in profile_count type (doing something reasonable > > when count is uninitialized) and then convert it to sreal for the final

Re: [PATCH] Fix for older version of GCC

2025-04-29 Thread David Malcolm
On Tue, 2025-04-29 at 21:51 +0200, Marc Poulhiès wrote: > Having both an enum and a variable with the same name triggers an > error with > gcc 5. > >   exploded-graph.h:351:29: error: ‘status’ is not a class, namespace, > or enumeration > > gcc/analyzer/ChangeLog: > * exploded-graph.h (set_

[committed] d: Use __builtin_clear_padding for zeroing alignment holes after set

2025-04-29 Thread Iain Buclaw
Hi, In an earlier change, a wrapper function was added to set CONSTRUCTOR_ZERO_PADDING_BITS on all CONSTRUCTOR nodes. This removes all the old generated calls to built-in memset and memcpy as zero padding is now taken care of by the middle-end. The remaining constructors that weren't getting zero

[committed] libstdc++: Use no_stdname for make_obj_using_allocator feature test macro

2025-04-29 Thread Jonathan Wakely
This is a non-standard feature test macro only used internally, so use the new no_stdname property for it. libstdc++-v3/ChangeLog: * include/bits/version.def (make_obj_using_allocator): Use no_stdname. * include/bits/version.h: Regenerate. --- Tested x86_64-linux. Pushed

[PATCH] Fix for older version of GCC

2025-04-29 Thread Marc Poulhiès
Having both an enum and a variable with the same name triggers an error with gcc 5. exploded-graph.h:351:29: error: ‘status’ is not a class, namespace, or enumeration gcc/analyzer/ChangeLog: * exploded-graph.h (set_status): Rename parameter. * constraint-manager.cc (bound::ensu

Re: [PATCH v2] libstdc++: Fix _Padding_sink in case when predicted is between padwidht and maxwidth [PR109162]

2025-04-29 Thread Jonathan Wakely
s/padwidht/padwidth/ in the summary line On 26/04/25 06:56 +0200, Tomasz Kamiński wrote: The _Padding_sink was behaving incorrectly, when the predicated width (based on predicted? code units count) was higher than _M_maxwidth, but lower than _M_padwidth. In this case _M_update() returned w

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

2025-04-29 Thread Alice Carlotti
On Tue, Apr 29, 2025 at 02:47:21PM +0100, Alice Carlotti wrote: > This demonstrates a clear benefit to make the makefile rules automatic. I > thought this might be quite tricky, but it turns out to be fairly > straightforward. Actually, it turns out I missed at least one more thing that's needed,

[PATCH] Add diffsummary.py to contrib

2025-04-29 Thread Andi Kleen
This adds an automatic downloader for the latest test results from the mailing list archive and supports diffing test_summary to it. Useful if you don't want to run your own baseline. contrib/ChangeLog: * diffsummary.py: New file. --- contrib/diffsummary.py | 104

Re: [PATCH v2] simplify-rtx: Combine bitwise operations in more cases

2025-04-29 Thread Richard Sandiford
Pengfei Li writes: > This patch transforms RTL expressions of the form (subreg (not X)) into > (not (subreg X)) if the subreg is an operand of another binary logical > operation. This transformation can expose opportunities to combine more > logical operations. > > For example, it improves the cod

Re: [PATCH] asf: Fix calling of emit_move_insn on registers of different modes [PR119884]

2025-04-29 Thread Richard Sandiford
Konstantinos Eleftheriou writes: > During the base register initialization, when we are eliminating the load > instruction, we were calling `emit_move_insn` on registers of the same > size but of different mode in some cases, causing an ICE. > > This patch fixes this, by adding a check for the mod

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

2025-04-29 Thread Richard Sandiford
Jennifer Schmitz writes: > If -msve-vector-bits=128, SVE loads and stores (LD1 and ST1) with a > ptrue predicate can be replaced by neon instructions (LDR and STR), > thus avoiding the predicate altogether. This also enables formation of > LDP/STP pairs. > > For example, the test cases > > svfloat

[pushed] i386: Disable string insn from non-default AS for Pmode != word_mode [PR111657]

2025-04-29 Thread Uros Bizjak
0x67 prefix is applied before segment register. That is in rep movsq %gs:(%esi), (%edi) the address is %gs + %esi. In case Pmode != word_mode (x32 with a default -maddress-mode=short) instructions should not allow segment override prefixes. Also, remove explicit addr32 prefix from asm templa

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

2025-04-29 Thread Jennifer Schmitz
> On 29 Apr 2025, at 14:03, Richard Sandiford wrote: > > External email: Use caution opening links or attachments > > > 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/

Re: [PATCH v3] libstdc++: Use constexpr-if to slightly simplify

2025-04-29 Thread Tomasz Kaminski
On Tue, Apr 29, 2025 at 4:11 PM 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 d

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

2025-04-29 Thread Andrew Pinski
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 instead. For most targets that is one instruction wide so it wo

[PATCH v3] libstdc++: Use constexpr-if to slightly simplify

2025-04-29 Thread Jonathan Wakely
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 diagnostics with pragmas. (_AnyMatcher::operator()): Use const

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

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] 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 >

[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

[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

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

[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 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

[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 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 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; +

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 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] 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. > >

[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 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 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] 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 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

[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] 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 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 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 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 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 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

[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 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 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 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 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 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

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 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: [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,

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 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] 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: [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: [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

[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 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] 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

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

2025-04-29 Thread H.J. Lu
On Tue, Apr 29, 2025 at 5:30 PM Uros Bizjak wrote: > > 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 a

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

2025-04-29 Thread Jonathan Wakely
On Tue, 29 Apr 2025 at 10:37, Tomasz Kaminski wrote: > > > > 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

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

2025-04-29 Thread Richard Biener
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_PROMOTE_PROTOTYPES to return > > > true, all integer arguments smaller than in

[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):

  1   2   >