Re: [PATCH] varasm: Ensure each variable in mergeable section is aligned to the section [PR121394]

2025-08-06 Thread Richard Biener
On Thu, Aug 7, 2025 at 8:37 AM Andrew Pinski wrote: > > Like r0-46282-gf41115930523b3, but this time for normal variables > rather than the constant pool. > With the simple C++ code on ia32: > ``` > std::initializer_list a = {0.3l}; > ``` > GCC currently produces: > ``` > .section.

Re: [PATCH 1/3][v2] Allow fully masked loops with legacy gather/scatter

2025-08-06 Thread Richard Biener
On Wed, 6 Aug 2025, Robin Dapp wrote: > > + elsvals) > > + || gs_info->decl != NULL_TREE) > > Does GATHER_SCATTER_LEGACY_P work here? Or is ifn != IFN_LAST? It should work. Note I'm a bit unhappy about GATHER_SCATTER_LEGACY_P and friend

Re: [Patch] contrib/download_prerequisites: Update GMP, MPFR, MPC [PR120237]

2025-08-06 Thread Richard Biener
On Wed, 6 Aug 2025, Tobias Burnus wrote: > This patch updates contrib/download_prerequisites to download > newer versions (the latest) of GMP, MPFR and MPC. > > Main reason is a newer MPFR that provides C23 functions, > additionally, the usual bug fixes or the new "away from zero" > rounding in M

[PATCH] varasm: Ensure each variable in mergeable section is aligned to the section [PR121394]

2025-08-06 Thread Andrew Pinski
Like r0-46282-gf41115930523b3, but this time for normal variables rather than the constant pool. With the simple C++ code on ia32: ``` std::initializer_list a = {0.3l}; ``` GCC currently produces: ``` .section.rodata.cst16,"aM",@progbits,16 .align 16 .type _ZGR1a_,

Re: [PATCH 1/3] explow.cc: Allow targets to promote _BitInt arguments

2025-08-06 Thread Stefan Schulze Frielinghaus
On Wed, Aug 06, 2025 at 05:57:14PM +0200, Jakub Jelinek wrote: > On Wed, Aug 06, 2025 at 05:40:09PM +0200, Stefan Schulze Frielinghaus wrote: > > On Tue, Aug 05, 2025 at 04:55:37PM +0200, Stefan Schulze Frielinghaus wrote: > > > On Tue, Aug 05, 2025 at 04:25:43PM +0200, Jakub Jelinek wrote: > > > >

Re: [PATCH] Get rid of `with_multisrctop`

2025-08-06 Thread John Ericson
I think upon further reflection, I have a slightly different read of what's going on. See also https://gcc.gnu.org/legacy-ml/gcc/2005-07/msg00236.html / https://www.airs.com/ian/configure/configure_8.html (rendering of since-deleted from the GDB repo item referenced in reply), which I also foun

[PATCHv2] libstdc++: Adjust generate_canonical (P0952, LWG2524) [PR119739]

2025-08-06 Thread Nathan Myers
Changes in v2: * Re-initialize inner loop variables. * Compute result optimistically, check outcome reliably. Changes: * Whitespace tweaks aside, this just strips out the existing fixup and wraps the generator in a do .. while loop. Implement P0952R2 "A new specification for std::generate_ca

Re: [PATCH] c++: mangling cNTTP object w/ implicit initial zeros [PR121231]

2025-08-06 Thread Jason Merrill
On 8/6/25 3:34 PM, Patrick Palka wrote: On Tue, 5 Aug 2025, Jason Merrill wrote: On 7/31/25 10:51 AM, Patrick Palka wrote: On Thu, 31 Jul 2025, Jason Merrill wrote: On 7/30/25 5:48 PM, Patrick Palka wrote: On Wed, 30 Jul 2025, Patrick Palka wrote: On Wed, 30 Jul 2025, Patrick Palka wrote:

Re: [COMMITTED] testsuite: fix escaping of square brackets

2025-08-06 Thread Jason Merrill
On 8/6/25 6:27 PM, Sam James wrote: This fails for me as: +ERROR: g++.dg/cpp26/constexpr-new3.C -std=c++26: unknown dg option: 2 for " dg-error 40 "accessing value of 'int [2]' object through a 'long int' glvalue in a constant expression" " otherwise. Escape '[' and ']'. Oops, thanks. gc

Re: [PATCH] c++: extract_call_expr and C++20 rewritten cmp ops

2025-08-06 Thread Jason Merrill
On 7/25/25 2:24 PM, Patrick Palka wrote: After r16-2519-gba5a6787374dea, we should never see a C++20 rewritten comparison operator expressed as a built-in acting on an operator<=> call, e.g. operator<=>(x, y) < 0. This is because operator<=> always returns a class type (std::strong/weak/partial_

[PATCH] libstdc++: Patch generate_canonical (P0952, LWG2524) [PR119739]

2025-08-06 Thread Nathan Myers
Changes: * Whitespace tweaks aside, this just strips out the existing fixup and wraps the generator in a do .. while loop. Implement P0952R2 "A new specification for std::generate_canonical". It has us start over if the naive generation of a float in 0..1 comes up exactly equal to 1, which occu

Re: [PATCH] c++: Add testcase for CWG2576 [PR120778]

2025-08-06 Thread Jason Merrill
On 8/6/25 7:13 AM, Jakub Jelinek wrote: Hi! Another part of the C++26 P2843R3, this time in https://eel.is/c++draft/cpp.include#7 changing former (compile time) undefined behavior to IFNDR. With IFNDR we wouldn't have to test anything I guess, but this still adds the cases from the 3.4 section

Re: [PATCH] c++: Add testcase for CWG2575 [PR120778]

2025-08-06 Thread Jason Merrill
On 8/6/25 8:17 AM, Jakub Jelinek wrote: Hi! From the paper it isn't clear what caused the decision changes, not to drop the "the token defined is generated as a result of this replacement process or" part and make [cpp.cond]/10 violations IFNDR rather than ill-formed (the latter maybe so that t

Re: [PATCH] c++: Add testcase for CWG2577 [PR120778]

2025-08-06 Thread Jason Merrill
On 8/6/25 10:29 AM, Jakub Jelinek wrote: Hi! And here is the last part of the paper. Contrary what the paper claims (clearly they haven't tried -pedantic nor -pedantic-errors), I think we already diagnose everything we should. Tested on x86_64-linux and i686-linux, ok for trunk? OK. 2025-0

Re: [PATCH] RISC-V: Expand const_vector with 2 elts per pattern.

2025-08-06 Thread 钟居哲
LGTM. juzhe.zh...@rivai.ai From: Robin Dapp Date: 2025-08-04 17:09 To: gcc-patches CC: kito.ch...@gmail.com; juzhe.zh...@rivai.ai; jeffreya...@gmail.com; pan2...@intel.com; rdapp@gmail.com Subject: [PATCH] RISC-V: Expand const_vector with 2 elts per pattern. Hi, In PR121334 we are asked

RE: [PATCH v1] RISC-V: Refactor the vec_duplicate cost on gpr/fpr2vr-cost param

2025-08-06 Thread Li, Pan2
Thanks Robin. > I assume the test expectation changes are necessary because the subrtx check > captures all operations and with the default settings (scalar-vec-cost = 0) > we > always prefer vv over vx/vf? Yes, of course. The previous vx/vf combine patch(s) needs to do similar change too. Le

[COMMITTED] testsuite: fix escaping of square brackets

2025-08-06 Thread Sam James
This fails for me as: +ERROR: g++.dg/cpp26/constexpr-new3.C -std=c++26: unknown dg option: 2 for " dg-error 40 "accessing value of 'int [2]' object through a 'long int' glvalue in a constant expression" " otherwise. Escape '[' and ']'. gcc/testsuite/ChangeLog: * g++.dg/cpp26/constexpr

PSA: Testing infrastructure

2025-08-06 Thread Jeff Law
So just an FYI. My entire testing infrastructure system lost its mind over the last week or so. Initially it was just failing to record testresults, then is stopped running jobs. No idea why Jenkins lost its mind -- it's running inside a docker container and shouldn't have had anything ch

[PATCH v3 4/4] find_a_program: Search with machine prefix in some cases

2025-08-06 Thread John Ericson
From: John Ericson Prefatory note: I've since learned that this quite similar to https://inbox.sourceware.org/gcc-patches/20240522095404.1825269-1-...@gcc.gnu.org/, postdating my original patch series, but predating this version. See that thread for additional motivation. That patch updated a fe

[PATCH v3 3/4] for_each_pass: Pass to callback whether dir is machine-disambiguated

2025-08-06 Thread John Ericson
From: John Ericson We will use this in the subsequent patch to control what filenames we search for. gcc/ChangeLog: * gcc.cc (for_each_path): Pass an additional boolean argument to the callback specifying whether the current directly being searched is machine-specific, a

Re: [PATCH v2 1/3] find_a_program: First search with machine prefix

2025-08-06 Thread John Ericson
OK I am going to submit a new version which is now in 4 steps. The first 3 steps are entirely behavior non-changing (or at least that is their intent) --- pure refactors. The 4th and final one along does the behavior change, and contains the motivation for that behavior change. Clang prior art i

[PATCH v3 2/4] driver: Remove the mode field from `file_at_path_info`

2025-08-06 Thread John Ericson
Now that `find_a_program` and `find_a_file` have been separated, we don't need a mode parameter, because one is always doing `R_OK`, and the other is always doing `X_OK`. This change also proves that some of the code I removed from `find_a_file` in the previous commit is actually dead. gcc/Change

[PATCH v3 1/4] find_a_program: Separate from find_a_file

2025-08-06 Thread John Ericson
From: John Ericson This continues what I started in way back in 5fee8a0a9223d030c66d53c104fb0a431369248f --- there is no executable-specific logic cluttering up find_a_file either, but instead there is a clean separation. The cost of this is that there is now some code duplication, but in subseq

Re: [PATCH v6 0/6] c, dwarf, btf: Add btf_decl_tag and btf_type_tag C attributes

2025-08-06 Thread David Faust
On 8/6/25 13:22, Joseph Myers wrote: > On Wed, 6 Aug 2025, David Faust wrote: > >> So IMO the best option will be to reject wide strings in the attribute >> handler. (The alternative, I guess, is to ensure the argument is >> always exported to UTF-8 before being written (?)) >> >> I see that w

Re: [PATCH v6 0/6] c, dwarf, btf: Add btf_decl_tag and btf_type_tag C attributes

2025-08-06 Thread Joseph Myers
On Wed, 6 Aug 2025, David Faust wrote: > So IMO the best option will be to reject wide strings in the attribute > handler. (The alternative, I guess, is to ensure the argument is > always exported to UTF-8 before being written (?)) > > I see that we can get the character size from the TREE_TYPE

Re: [PATCH 0/2] aarch64: Add -msimd-memops option controlling SIMD usage

2025-08-06 Thread Keith Packard
> I don't see how this makes any sense. If TARGET_SIMD or TARGET_FP > are true, the compiler may at any time use a SIMD register for anything - > including in integer-only code. Thanks for reviewing my proposed patch. I'm struggling to migrate the Zephyr project from GCC 12.2 to a more recent ver

Re: [PATCH] c++: extract_call_expr and C++20 rewritten cmp ops

2025-08-06 Thread Patrick Palka
On Fri, 25 Jul 2025, Patrick Palka wrote: > > On Fri, 25 Jul 2025, Patrick Palka wrote: > > > After r16-2519-gba5a6787374dea, we should never see a C++20 rewritten > > comparison operator expressed as a built-in acting on an operator<=> > > call, e.g. operator<=>(x, y) < 0. This is because oper

Re: [PATCH] c++: mangling cNTTP object w/ implicit initial zeros [PR121231]

2025-08-06 Thread Patrick Palka
On Tue, 5 Aug 2025, Jason Merrill wrote: > On 7/31/25 10:51 AM, Patrick Palka wrote: > > On Thu, 31 Jul 2025, Jason Merrill wrote: > > > > > On 7/30/25 5:48 PM, Patrick Palka wrote: > > > > On Wed, 30 Jul 2025, Patrick Palka wrote: > > > > > > > > > On Wed, 30 Jul 2025, Patrick Palka wrote: > >

Re: [PATCH 1/2] aarch64: Add -msimd-memops option controlling SIMD usage in memset/memcpy

2025-08-06 Thread Keith Packard
Andrew Pinski wrote: > I am trying to understand the difference between this option and > -mgeneral-regs-only since you mentioned that FPU will be disabled for > those cases. Thanks for taking a look at the patch; I was also surprised that there wasn't some existing option that I could use. Thi

[pushed] install: Replace bzip2 by xz

2025-08-06 Thread Gerald Pfeifer
In addition to gzip format our snapshots and releases have been using xz instead of bzip2 for a while. gcc: PR target/69374 * doc/install.texi (Prerequisites): Replace bzip2 by xz. --- gcc/doc/install.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/doc

[PATCH 0/2] aarch64: Add -msimd-memops option controlling SIMD usage

2025-08-06 Thread Wilco Dijkstra
Hi Keith, > This option (enabled by default) preserves existing behavior by > allowing use of Advanced SIMD registers while expanding > memset/memcpy/memmove operations into inline instructions. > > Disabling this option prevents use of these registers for environments > where the FPU may be disab

Re: [PATCH] c++: Implement C++26 P1061R10 - Structured Bindings can introduce a Pack [PR117783]

2025-08-06 Thread Jason Merrill
On 5/1/25 3:26 AM, Jakub Jelinek wrote: Hi! The following patch implements the C++26 P1061R10 - Structured Bindings can introduce a Pack paper. One thing unresolved in the patch is mangling, I've raised https://github.com/itanium-cxx-abi/cxx-abi/issues/200 for that but no comments there yet. On

Re: [PATCH 1/2] aarch64: Add -msimd-memops option controlling SIMD usage in memset/memcpy

2025-08-06 Thread Andrew Pinski
On Wed, Aug 6, 2025 at 11:20 AM Keith Packard wrote: > > This option (enabled by default) preserves existing behavior by > allowing use of Advanced SIMD registers while expanding > memset/memcpy/memmove operations into inline instructions. > > Disabling this option prevents use of these registers

Re: [PATCH] c++, c, v3: Introduce -Wkeyword-macro warning/pedwarn - part of C++26 P2843R3 [PR120778]

2025-08-06 Thread Joseph Myers
On Wed, 6 Aug 2025, Jakub Jelinek wrote: > On Tue, Aug 05, 2025 at 03:52:12PM -0700, Jason Merrill wrote: > > Hmm, the names in "Table 4" > > https://eel.is/c++draft/lex.name#tab:lex.name.special are also > > context-sensitive. I agree with ignoring the ObjC keywords because they > > aren't part

Re: [PATCH v6 0/6] c, dwarf, btf: Add btf_decl_tag and btf_type_tag C attributes

2025-08-06 Thread David Faust
On 8/4/25 13:17, Joseph Myers wrote: > On Mon, 4 Aug 2025, David Faust wrote: > >> Hi Joseph, >> >> Could you please take a look at the front-end portion of this >> series when you have a moment? >> >> New attributes/handlers - Patch 1: >> https://gcc.gnu.org/pipermail/gcc-patches/2025-July/6

Re: [PATCH] Get rid of `with_multisrctop`

2025-08-06 Thread Joseph Myers
On Wed, 6 Aug 2025, John Ericson wrote: > I can't quite tell, but I have a nagging suspicion that this is unused. > It would be nice to simplify some of the multilib stuff, and the > complexity around source directory (rather than build directory) > handling seems like it ought not to be so necess

Re: [PATCH] x86: Add *one_cmplqi_ext_2

2025-08-06 Thread Uros Bizjak
On Tue, Aug 5, 2025 at 1:32 PM Richard Sandiford wrote: > > Richard Sandiford writes: > > "H.J. Lu" writes: > >> On Mon, Aug 4, 2025 at 3:28 PM H.J. Lu wrote: > >>> > >>> On Mon, Aug 4, 2025 at 2:04 PM H.J. Lu wrote: > >>> > > >>> > On Mon, Aug 4, 2025 at 8:50 AM Richard Sandiford > >>> > wro

[PATCH 0/2] aarch64: Add -msimd-memops option controlling SIMD usage

2025-08-06 Thread Keith Packard
This option (enabled by default) preserves existing behavior by allowing use of Advanced SIMD registers while expanding memset/memcpy/memmove operations into inline instructions. Disabling this option prevents use of these registers for environments where the FPU may be disabled to reduce the cost

[PATCH 1/2] aarch64: Add -msimd-memops option controlling SIMD usage in memset/memcpy

2025-08-06 Thread Keith Packard
This option (enabled by default) preserves existing behavior by allowing use of Advanced SIMD registers while expanding memset/memcpy/memmove operations into inline instructions. Disabling this option prevents use of these registers for environments where the FPU may be disabled to reduce the cost

[PATCH 2/2] aarch64: Make -mno-simd-memops default for aarch64*-*-elf targets

2025-08-06 Thread Keith Packard
These targets are regularly used for embedded applications for portions of code where the Advanced SIMD registers may not be preserved, such as interrupt handlers. Disabling the use of SIMD registers for memset/memcpy operations by default ensures that code which doesn't overtly perform FPU or SIM

[PATCH v3 5/5] forwprop: Copy prop aggregates into args

2025-08-06 Thread Andrew Pinski
This implements the simple copy prop of aggregates into arguments of function calls. This can reduce the number of copies done. Just like removing of an extra copy in general, this can and will help out SRA; since we might not need to do a full scalarization of the aggregate now. This is the simpl

[PATCH v3 4/5] forwprop: Recongize a store of integral zero for optimize_aggr_zeroprop.

2025-08-06 Thread Andrew Pinski
While looking into the gimple level after optimization of the highway code from google, I noticed in .optimized we still have: ``` MEM [(short int *)&a] = { 0, 0, 0, 0, 0, 0, 0, 0 }; D.4398 = a; a ={v} {CLOBBER(eos)}; D.4389 = D.4398; D.4390 = D.4389; D.4361 = D.4390; D.4195 = D.4361

[PATCH v3 0/5] New copyprop for aggregates patches

2025-08-06 Thread Andrew Pinski
This is version 3 of the patches: https://inbox.sourceware.org/gcc-patches/20250802035048.3815303-1-quic_apin...@quicinc.com/T/#m757887289de93b288be742132f9a56a9c3812514 For the memset patch, I had forgot to include the limit for the walker. This has now been added back and some minor formating is

[PATCH v3 2/5] forwprop: Change proping memset into memcpy into a forwprop rather than a backwalk

2025-08-06 Thread Andrew Pinski
One thing I noticed while working on copy prop for aggregates is that we start with a memcpy like statement and then walk backwards. This means we could have a few walks backwards to see there was no statement for zeroing. Instead this changes the walk backwards into a true forwprop. In the futu

[PATCH v3 3/5] forwprop: Don't do copy-prop-aggregates from statements that could throw [PR120599]

2025-08-06 Thread Andrew Pinski
In the testcase provided, currently we lose the landing pad for the exception that could throw from the aggregate load as we remove one copy and the second statement where load happens was not marked as throwable before so the landing pad for that internal throw is now gone. The fix is to ignor

[PATCH v3 1/5] forwprop: Change optimize_agr_copyprop into forward walk instead of backwards

2025-08-06 Thread Andrew Pinski
While thinking about how to implement the rest of the copy prop and makes sure not to introduce some compile time problems, optimize_agr_copyprop should be changed into a forwproping rather than looking backwards. Bootstrapped and tested on x86_64-linux-gnu. gcc/ChangeLog: * tree-ssa-fo

Re: [PATCH 1/3][v2] Allow fully masked loops with legacy gather/scatter

2025-08-06 Thread Robin Dapp
+ elsvals) + || gs_info->decl != NULL_TREE) Does GATHER_SCATTER_LEGACY_P work here? Or is ifn != IFN_LAST? -- Regards Robin

[PATCH] ctf: avoid overflow for array num elements [PR121411]

2025-08-06 Thread David Faust
CTF array encoding uses uint32 for number of elements. This means there is a hard upper limit on array types which the format can represent. GCC internally was also using a uint32_t for this, which would overflow when translating from DWARF for arrays with more with more than UINT32_MAX elements.

Re: [PATCH 1/3] explow.cc: Allow targets to promote _BitInt arguments

2025-08-06 Thread Jakub Jelinek
On Wed, Aug 06, 2025 at 05:40:09PM +0200, Stefan Schulze Frielinghaus wrote: > On Tue, Aug 05, 2025 at 04:55:37PM +0200, Stefan Schulze Frielinghaus wrote: > > On Tue, Aug 05, 2025 at 04:25:43PM +0200, Jakub Jelinek wrote: > > > On Tue, Aug 05, 2025 at 04:23:14PM +0200, Stefan Schulze Frielinghaus

Re: [PATCH 1/3] explow.cc: Allow targets to promote _BitInt arguments

2025-08-06 Thread Stefan Schulze Frielinghaus
On Tue, Aug 05, 2025 at 04:55:37PM +0200, Stefan Schulze Frielinghaus wrote: > On Tue, Aug 05, 2025 at 04:25:43PM +0200, Jakub Jelinek wrote: > > On Tue, Aug 05, 2025 at 04:23:14PM +0200, Stefan Schulze Frielinghaus wrote: > > > From: Stefan Schulze Frielinghaus > > > > > > From: Stefan Schulze F

Re: [PATCH v2] RISCV: MIPS prefetch extensions for MIPS RV64 P8700 and can be enabled with xmipscbop.

2025-08-06 Thread Umesh Kalappa
Hi @Jeff Law and @kito.ch...@sifive.com , Please do needful with your comments for the subjected patch . Thank you ~U On Wed, Jul 30, 2025 at 6:50 PM Umesh Kalappa wrote: > Hi All, > > Please do needful with reviewing the below changes (that enable mips > custom prefetch instruction ) and

Re: [PATCH] fortran: add optional lower arg to c_f_pointer

2025-08-06 Thread Yuao Ma
Oops, looks like I mess up a testcase name. Fixed in this version. On 8/6/2025 10:57 PM, Yuao Ma wrote: Hi Tobias, On 8/6/2025 4:32 PM, Tobias Burnus wrote: Hi Yuao, thanks for your patch. I have two nits: * There is no diagnostic for -std=f2018 (or lower);    can you add the 'gfc_notify_std

Re: [PATCH] fortran: add optional lower arg to c_f_pointer

2025-08-06 Thread Yuao Ma
Hi Tobias, On 8/6/2025 4:32 PM, Tobias Burnus wrote: Hi Yuao, thanks for your patch. I have two nits: * There is no diagnostic for -std=f2018 (or lower);   can you add the 'gfc_notify_std (GFC_STD_F2023' ? Done. Testcase added. * I have a minor documentation nit; current wording is   at

[PATCH] driver: Rework for_each_path using C++

2025-08-06 Thread John Ericson
The old C-style was cumbersome make making one responsible for manually create and pass a closure (separate function and *_info class for closed-over variables). I would have liked to redo this with C++ lambdas, so we could: - derive environment types implicitly - have fewer stray static function

[Patch] contrib/download_prerequisites: Update GMP, MPFR, MPC [PR120237]

2025-08-06 Thread Tobias Burnus
This patch updates contrib/download_prerequisites to download newer versions (the latest) of GMP, MPFR and MPC. Main reason is a newer MPFR that provides C23 functions, additionally, the usual bug fixes or the new "away from zero" rounding in MPC might turn out to be useful. GMP also claims bette

[PATCH v1] RISC-V: Refactor the vec_duplicate cost on gpr/fpr2vr-cost param

2025-08-06 Thread pan2 . li
From: Pan Li The previous cost value for vec_duplicate almost bases on the operators like add/minus. The rtx_cost function try to match them case by case and find if it has vec_duplicate, then update the cost values. It is Ok when we initially add it but looks confused/redundant as more and mor

Re: [PATCH v1] RISC-V: Refactor the vec_duplicate cost on gpr/fpr2vr-cost param

2025-08-06 Thread Robin Dapp
Looks much more reasonable, thanks. I assume the test expectation changes are necessary because the subrtx check captures all operations and with the default settings (scalar-vec-cost = 0) we always prefer vv over vx/vf? -- Regards Robin

[PATCH] c++: Add testcase for CWG2577 [PR120778]

2025-08-06 Thread Jakub Jelinek
Hi! And here is the last part of the paper. Contrary what the paper claims (clearly they haven't tried -pedantic nor -pedantic-errors), I think we already diagnose everything we should. Tested on x86_64-linux and i686-linux, ok for trunk? 2025-08-06 Jakub Jelinek PR preprocessor/120

[PATCH v1 1/1] libiberty: disable logging of list content for doubly-linked list tests

2025-08-06 Thread Matthieu Longo
When the doubly-linked list tests were introduced, the tests were printing the content of the list forward and backward. However, this printing is not needed outside of debugging, and confuses people because the output is not only composed of PASS: lines. This patch disables the printing of the li

[PATCH v1 0/1] libiberty: disable logging of list content for doubly-linked list tests

2025-08-06 Thread Matthieu Longo
This patch is a follow-up of the discussion in [1], and was already approved by Richard Sandiford (GCC), and Jan Beulich (binutils). [1]: https://inbox.sourceware.org/binutils/e8e281d1-cd6f-46d5-af80-dee81e73d...@suse.com/ Matthieu Longo (1): libiberty: disable logging of list content for dou

Re: [PATCH] fortran: cleanup duplicate tests for c_f_pointer_shape_driver; nfc

2025-08-06 Thread Yuao Ma
On 8/6/2025 5:20 PM, Tobias Burnus wrote: Hi Yuao, thanks for the patch. — I have one nit: Yuao Ma wrote: This patch cleans up a duplicate test driver. Regression-tested. OK for trunk? ... Subject: [PATCH] fortran: cleanup duplicate tests for   c_f_pointer_shape_driver; nfc '; nfc'? tes

[pushed] c++: improve constexpr type mismatch diagnostic

2025-08-06 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- This diagnostic failed to specify the actual type of the object being accessed through a glvalue of an incompatible type, and could also use to indicate where that object comes from. gcc/cp/ChangeLog: * constexpr.cc (cxx_eval_indir

[PATCH] Add new builtin __atomic_compare_exchange_local()

2025-08-06 Thread Surya Kumari Jangala
The PowerPC ISA has Load-And-Reserve and Store-Conditional instructions which can be used to construct a sequence of instructions that appears to perform an atomic update operation on an aligned storage location. The larx (load-and-reserve) instruction supports an Exclusive Access Hint (EH). A val

Re: [PATCH] vect: Extend peeling and versioning for alignment to VLA modes

2025-08-06 Thread Richard Biener
On Wed, 6 Aug 2025, Pengfei Li wrote: > Hi Richard, > > > Can you split this fix out? I guess the bug is latent on branches > > as well? > > > Otherwise the patch looks good to me - thanks for the very > > nice work. > > Thanks for your review. > > The small fix is in a code path that had bee

[PATCH 3/3][v2] Record gather/scatter scale and base in the SLP tree

2025-08-06 Thread Richard Biener
The main gather/scatter discovery happens at SLP discovery time, the base address and the offset scale are currently not explicitly represented in the SLP tree. This requires re-discovery of them during vectorizable_store/load. The following fixes this by recording this info into the SLP tree. T

Re: [PATCH] vect: Extend peeling and versioning for alignment to VLA modes

2025-08-06 Thread Pengfei Li
Hi Richard, > Can you split this fix out? I guess the bug is latent on branches > as well? > Otherwise the patch looks good to me - thanks for the very > nice work. Thanks for your review. The small fix is in a code path that had been unreachable before, since peeling with masking for VLA mode

[PATCH 2/3][v2] Use proper alias type for gather/scatter with SLP

2025-08-06 Thread Richard Biener
Both vectorizable_load and vectorizable_store compute an alias type commoning differences between SLP lanes. The following makes sure to use that for gather/scatter rather than the random one from the representative created during scalar stmt gather/scatter analysis. * tree-vect-stmts.cc

[PATCH 1/3][v2] Allow fully masked loops with legacy gather/scatter

2025-08-06 Thread Richard Biener
The following removes the redundant check on supported gather/scatter IFN in check_load_store_for_partial_vectors which is already done and adjusts those to check the recorded ifn, also allowing legacy gather/scatter which all handle masking. * tree-vect-stmts.cc (check_load_store_for_part

[PATCH] c++: Add testcase for CWG2575 [PR120778]

2025-08-06 Thread Jakub Jelinek
Hi! >From the paper it isn't clear what caused the decision changes, not to drop the "the token defined is generated as a result of this replacement process or" part and make [cpp.cond]/10 violations IFNDR rather than ill-formed (the latter maybe so that the extension to handle e.g. !A(A) below et

Re: [PATCH] vect: Extend peeling and versioning for alignment to VLA modes

2025-08-06 Thread Richard Biener
On Fri, 1 Aug 2025, Pengfei Li wrote: > This patch extends the support for peeling and versioning for alignment > from VLS modes to VLA modes. The key change is allowing the DR target > alignment to be set to a non-constant poly_int. Since the value must be > a power-of-two, for variable VFs, the

[PATCH 8/8] aarch64: Use cc when CB/CBB/CBH is out-of-range

2025-08-06 Thread Wilco Dijkstra
Hi Richard, +++ b/gcc/config/aarch64/aarch64.md @@ -876,10 +876,16 @@ (clobber (reg:CC CC_REGNUM))] "TARGET_CMPBR && aarch64_cb_rhs (, operands[1])" { -return (get_attr_far_branch (insn) == FAR_BRANCH_NO) - ? "cb\\t%0, %1, %l2" - : aarch64_gen_far_branch (operands, 2, -

Re: [PATCH 6/8] aarch64: Add cc clobber to compare-and-branch patterns

2025-08-06 Thread Richard Henderson
On 8/6/25 00:45, Karl Meakin wrote: Now that the body of `cbranch` and `cbranch` are the same, could we merge them into one rule? No, the bodies are the same but the predicates are not. r~

Re: [COMMITTED][PATCH] AArch64: Fix test for vector length safety

2025-08-06 Thread Tejas Belagod
On 05/08/2025 11:22, Tejas Belagod wrote: On 31/07/2025 15:20, Kyrylo Tkachov wrote: On 31 Jul 2025, at 14:34, Tejas Belagod wrote: The test was unsafe when tested on different vector lengths.  This patch fixes it to work on all lengths. Ok. I’ve seen this test fail on GCC 15 branch too,

[PATCH] c++: Add testcase for CWG2576 [PR120778]

2025-08-06 Thread Jakub Jelinek
Hi! Another part of the C++26 P2843R3, this time in https://eel.is/c++draft/cpp.include#7 changing former (compile time) undefined behavior to IFNDR. With IFNDR we wouldn't have to test anything I guess, but this still adds the cases from the 3.4 section of the paper plus related tests. The paper

[committed] bitint: Fix build [PR121413]

2025-08-06 Thread Jakub Jelinek
Hi! Sorry, my bootstrap failed last night because of this, I've fixed it up and it bootstrapped/regtested fine overnight, but in the morning forgot to adjust the patch before committing. Without this there is .../gimple-lower-bitint.cc:7678:36: error: comparison of integer expressions of differe

[PATCH v6 0/4] LoongArch: Add support for _BitInt [PR117599]

2025-08-06 Thread Yang Yujie
Changes from v5: 1. Fixes based on Jakub's review on v5. 2. Not including patches already approved. (Except for patch 4, which is here so that it's easier to commit if the series is OK for trunk.) This series was bootstrapped and tested on x86_64-linux-gnu and loongarch64-linux-gnu. Yang

Re: [PATCH v6 4/4] bitint: Do not optimize away conversion to _BitInt before a VCE

2025-08-06 Thread Jakub Jelinek
On Wed, Aug 06, 2025 at 05:57:52PM +0800, Yang Yujie wrote: > A _BitInt value may rely on a conversion to become properly extended. > So a conversion to _BitInt is not trivially removable even if the > types of the result and the operand have the same precision and size. > > This patch fixes gcc.d

Re: [PATCH v6 1/4] bitint: Avoid extending ABI-extended large/huge _BitInts on load

2025-08-06 Thread Yang Yujie
On Wed, Aug 06, 2025 at 11:58:09AM GMT, Jakub Jelinek wrote: > On Wed, Aug 06, 2025 at 05:57:49PM +0800, Yang Yujie wrote: > > This patch also make casts of ABI-extended large/huge _BitInts > > behave the same as the small/middle case, i.e. no-op for casts > > to a higher precision _BitInt with the

Re: [PATCH v6 3/4] bitint: Zero-extend the result of a signed->unsigned widening cast

2025-08-06 Thread Jakub Jelinek
On Wed, Aug 06, 2025 at 05:57:51PM +0800, Yang Yujie wrote: > A widening cast from a signed _BitInt operand to an unsigned _BitInt > type involves filling the extra limb(s) with sign extension. > On a target that wants _BitInts extended in memory, if this unsigned > type has a partial limb, the unu

Re: [PATCH v6 2/4] bitint: Make sure BEXTC checks extension when optimized

2025-08-06 Thread Jakub Jelinek
On Wed, Aug 06, 2025 at 05:57:50PM +0800, Yang Yujie wrote: > In BEXTC, whether a _BitInt object is properly extended is examined > by a value comparison against a copied object in a wider _BitInt > type that utilizes all of the partial limb. > > Since the (implicit) conversion to the wider type m

Re: [PATCH v6 1/4] bitint: Avoid extending ABI-extended large/huge _BitInts on load

2025-08-06 Thread Jakub Jelinek
On Wed, Aug 06, 2025 at 05:57:49PM +0800, Yang Yujie wrote: > This patch also make casts of ABI-extended large/huge _BitInts > behave the same as the small/middle case, i.e. no-op for casts > to a higher precision _BitInt with the same number of limbs / > extension for casts that turns a full top l

[PATCH v6 4/4] bitint: Do not optimize away conversion to _BitInt before a VCE

2025-08-06 Thread Yang Yujie
A _BitInt value may rely on a conversion to become properly extended. So a conversion to _BitInt is not trivially removable even if the types of the result and the operand have the same precision and size. This patch fixes gcc.dg/torture/bitint-64.c at -O2 on LoongArch, which fails because extensi

[PATCH v6 1/4] bitint: Avoid extending ABI-extended large/huge _BitInts on load

2025-08-06 Thread Yang Yujie
This patch also make casts of ABI-extended large/huge _BitInts behave the same as the small/middle case, i.e. no-op for casts to a higher precision _BitInt with the same number of limbs / extension for casts that turns a full top limb into a partial limb. This conveniently helps keep some code with

[PATCH v6 3/4] bitint: Zero-extend the result of a signed->unsigned widening cast

2025-08-06 Thread Yang Yujie
A widening cast from a signed _BitInt operand to an unsigned _BitInt type involves filling the extra limb(s) with sign extension. On a target that wants _BitInts extended in memory, if this unsigned type has a partial limb, the unused part of it should be zeroed. e.g. Assuming limb_mode == E_DImod

[PATCH v6 2/4] bitint: Make sure BEXTC checks extension when optimized

2025-08-06 Thread Yang Yujie
In BEXTC, whether a _BitInt object is properly extended is examined by a value comparison against a copied object in a wider _BitInt type that utilizes all of the partial limb. Since the (implicit) conversion to the wider type may be optimized away now and cause the result of the comparison to alw

[PATCH] c++, c, v3: Introduce -Wkeyword-macro warning/pedwarn - part of C++26 P2843R3 [PR120778]

2025-08-06 Thread Jakub Jelinek
On Tue, Aug 05, 2025 at 03:52:12PM -0700, Jason Merrill wrote: > Hmm, the names in "Table 4" > https://eel.is/c++draft/lex.name#tab:lex.name.special are also > context-sensitive. I agree with ignoring the ObjC keywords because they > aren't part of the C++ standard, but I'd drop the "context-sensi

Re: [PATCH] fortran: cleanup duplicate tests for c_f_pointer_shape_driver; nfc

2025-08-06 Thread Tobias Burnus
Hi Yuao, thanks for the patch. — I have one nit: Yuao Ma wrote: This patch cleans up a duplicate test driver. Regression-tested. OK for trunk? ... Subject: [PATCH] fortran: cleanup duplicate tests for c_f_pointer_shape_driver; nfc '; nfc'? tests_2_driver and tests_4_driver are identical,

Re: [PATCH,libgfortran] Fix PR121234, bogus diagnostic

2025-08-06 Thread Manfred Schwarb
Am 05.08.25 um 21:25 schrieb Jerry D: > Hello, > > The attached patch fixes the subject bug by adding checks for ';' it specific > places to avoid eating them and/or giving false errors. > Jerry, thanks a lot for tackling this! But in an ideal world, standards would define a delimiter argument f

[PATCH] libgcc: Remove useless forward declaration [PR121397]

2025-08-06 Thread Jakub Jelinek
Hi! aarch64 for some strange reason unconditionally enables -Werror for libgcc building and this particular file for some strange reason contains a useless static forward declaration of a function only defined in the #if defined __sun__ && defined __svr4__ block and not otherwise (with __attribu

Re: [PATCH] libgcc: Remove useless forward declaration [PR121397]

2025-08-06 Thread Richard Biener
On Wed, 6 Aug 2025, Jakub Jelinek wrote: > Hi! > > aarch64 for some strange reason unconditionally enables -Werror for libgcc > building and this particular file for some strange reason contains > a useless static forward declaration of a function only defined in the > #if defined __sun__ && de

Re: [PATCH] bitint: Fix up INTEGER_CST PHI handling [PR121413]

2025-08-06 Thread Richard Biener
On Wed, 6 Aug 2025, Jakub Jelinek wrote: > Hi! > > The following testcase is miscompiled on aarch64-linux. > The problem is in the optimization to shorten large constants > in PHI arguments. > In a couple of places during bitint lowering we compute > minimal precision of constant and if it is sig

Re: [PATCH] bitint: Fix up handling of uninitialized mul/div/float cast operands [PR121127]

2025-08-06 Thread Richard Biener
On Wed, 6 Aug 2025, Jakub Jelinek wrote: > Hi! > > handle_operand_addr (used for the cases where we use libgcc APIs, so > multiplication, division, modulo, casts of _BitInt to float/dfp) when it > sees default definition of an SSA_NAME which is not PARM_DECL (i.e. > uninitialized one) just alloca

Re: [PATCH v3] i386: Add missing PTA_POPCNT and PTA_LZCNT with PTA_ABM

2025-08-06 Thread Uros Bizjak
On Wed, Aug 6, 2025 at 10:18 AM Yangyu Chen wrote: > > I apologize for missing that. Although I don't have write access, > I have contributed numerous commits and thousands of lines of code > to GCC. > > Could you please commit this patch for me? No problem, will do later today. Thanks, Uros. >

[PATCH] bitint: Fix up INTEGER_CST PHI handling [PR121413]

2025-08-06 Thread Jakub Jelinek
Hi! The following testcase is miscompiled on aarch64-linux. The problem is in the optimization to shorten large constants in PHI arguments. In a couple of places during bitint lowering we compute minimal precision of constant and if it is significantly smaller than the precision of the type, store

Re: [PATCH] gengtype: Include system.h earlier in gengtype-lex.cc [PR121386]

2025-08-06 Thread Richard Biener
On Wed, 6 Aug 2025, Jakub Jelinek wrote: > Hi! > > OpenBSD headers apparently instead of just > #define SIZE_MAX something > do > #ifndef SIZE_MAX > #define SIZE_MAX something > #endif > This causes problem with gengtype-lex.cc, where the flex generated > code has > #ifndef SIZE_MAX > #defi

[PATCH 2/2] Use proper alias type for gather/scatter with SLP

2025-08-06 Thread Richard Biener
Both vectorizable_load and vectorizable_store compute an alias type commoning differences between SLP lanes. The following makes sure to use that for gather/scatter rather than the random one from the representative created during scalar stmt gather/scatter analysis. Bootstrapped and tested on x8

[PATCH 1/2] Simplify vect_supportable_dr_alignment

2025-08-06 Thread Richard Biener
The following simplifies vect_supportable_dr_alignment based on the observation that we always dereference dr_info so it cannot be NULL, likewise we always dereference dr so that cannot be NULL either. Bootstrapped and tested on x86_64-unknown-linux-gnu. * tree-vect-data-refs.cc (vect_sup

Re: [PATCH] fortran: add optional lower arg to c_f_pointer

2025-08-06 Thread Tobias Burnus
Hi Yuao, thanks for your patch. I have two nits: * There is no diagnostic for -std=f2018 (or lower); can you add the 'gfc_notify_std (GFC_STD_F2023' ? * I have a minor documentation nit; current wording is at https://gcc.gnu.org/onlinedocs/gfortran/C_005fF_005fPOINTER.html Namely, ... Yu

Re: [PATCH v3] i386: Add missing PTA_POPCNT and PTA_LZCNT with PTA_ABM

2025-08-06 Thread Uros Bizjak
On Wed, Jul 30, 2025 at 7:24 PM Yangyu Chen wrote: > > This patch adds the missing PTA_POPCNT and PTA_LZCNT with the PTA_ABM > bitmask definition for the bdver1, btver1, and lujiazui architectures > in the i386 architecture configuration file. > > Although these two features were not present in th

Re: [PATCH v3] i386: Add missing PTA_POPCNT and PTA_LZCNT with PTA_ABM

2025-08-06 Thread Yangyu Chen
I apologize for missing that. Although I don't have write access, I have contributed numerous commits and thousands of lines of code to GCC. Could you please commit this patch for me? Thanks, Yangyu Chen > On 6 Aug 2025, at 16:13, Uros Bizjak wrote: > > On Wed, Jul 30, 2025 at 7:24 PM Yangyu C

  1   2   >