Re: [PATCH v3 4/5] vect: Misalign checks for gather/scatter.

2025-07-22 Thread Richard Biener
On Tue, Jul 22, 2025 at 5:21 PM Robin Dapp wrote: > > > Note if-conversion emits IFN_MASK_LOAD/STORE, only the vectorizer later > > emits the LEN variants. So this is about whether there are (might) be > > uarchs that have vector aligned loads (aka target alignment is > > sizeof(vector)) > > and

Re: [PATCH] [RFC] Delayed parsing for bounds safety attributes

2025-07-22 Thread Martin Uecker
Am Montag, dem 21.07.2025 um 16:03 -0700 schrieb Bill Wendling: > On Mon, Jul 21, 2025 at 2:19 PM Martin Uecker wrote: > > Am Montag, dem 21.07.2025 um 04:29 -0700 schrieb Bill Wendling: > > > On Sun, Jul 20, 2025 at 4:41 AM Martin Uecker wrote: .. > > > > Re original context: The 'struct c_par

Re: [PATCH v3] gcc-16/changes.html: Add --enable-x86-64-mfentry

2025-07-22 Thread Gerald Pfeifer
On Tue, 15 Jul 2025, H.J. Lu wrote: >> This feels a bit complex to parse. How about something like >> >> + The new --enable-x86-64-mfentry configure option >> + makes -mfentry use __fentry__ instead >> + of mcount for profiling on x86-64. This option is >> + enabled by default for

Re: [PATCH] [RFC] Delayed parsing for bounds safety attributes

2025-07-22 Thread Martin Uecker
IMHO there are enough reasons to reject delayed parsing as bad design for C. We should work towards proper language features that cleanly fit into the language, instead of pushing the boundaries with macros. But this requires true collaboration, which can not exist when one side is not able to

[PATCH] testsuite: Mark fn1 in pr81627.c as noinline [PR120101]

2025-07-22 Thread Andrew Pinski
Since r16-372-g064cac730f88dc fn1 is now inlined into main which meant the scan dump was failing since it was looking for it only once. Marking fn1 as noinline gets us back to the old behavior and no longer dependent on the inliner. Pushed as obvious after a quick test. PR testsuite/12010

[PATCH v1 2/2] RISC-V: Add test case for vx combine polluting VXRM

2025-07-22 Thread pan2 . li
From: Pan Li Add asm check to make sure vx combine of vaaddu.vx will not pollute the vxrm. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/vx_vf/vx-fixed-vxrm-1-u16.c: New test. * gcc.target/riscv/rvv/autovec/vx_vf/vx-fixed-vxrm-1-u32.c: New test. * gcc.target/ri

[PATCH v1 1/2] RISC-V: Avoid vaaddu.vx combine pattern pollute VXRM csr

2025-07-22 Thread pan2 . li
From: Pan Li The vaaddu.vx combine almost comes from avg_floor, it will requires the vxrm to be RDN. But not all vaaddu.vx should depends on the RDN. The vaaddu.vx combine should leverage the VXRM value as is instead of pollute them all to RDN. This patch would like to fix this and set it as i

[PATCH v1 0/2] Avoid RVV fixed insn VX combine pollute VXRM

2025-07-22 Thread pan2 . li
From: Pan Li The RVV fixed point insn VX combine should focus on the insn itself, instead of any standard name like avg_floor, the vxrm should be the value of insn as is. The below test suites are passed for this patch series. * The rv64gcv fully regression test. Pan Li (2): RISC-V: Avoid vaa

Re: [PATCH] [RFC] Delayed parsing for bounds safety attributes

2025-07-22 Thread Kees Cook
[Explicitly CCing Joseph since this thread[1] is about the C front-end] On Tue, Jul 22, 2025 at 09:01:35PM +, Qing Zhao wrote: > However, given the current situation, I also think that provide two different > interfaces from CLANG > and GCC might be the practical solution to this endless disc

Re: [PATCH] RISC-V: Rework broadcast handling [PR121073].

2025-07-22 Thread Jeff Law
On 7/22/25 3:03 AM, Robin Dapp wrote: Hi, During the last weeks it became clear that our current broadcast handling needs an overhaul in order to improve maintainability. PR121073 showed that my intermediate fix wasn't enough and caused regressions. This patch now goes a first step towards u

Re: [PATCH v2] testsuite: Fix overflow in gcc.dg/vect/pr116125.c

2025-07-22 Thread Siddhesh Poyarekar
On 2025-07-21 04:52, Siddhesh Poyarekar wrote: On 2025-07-14 03:02, Richard Biener wrote: On Fri, Jul 11, 2025 at 8:27 PM Siddhesh Poyarekar wrote: The test ends up writing a byte beyond bounds of the buffer, which

[PATCH v2] defaults.h: Default MAX_FIXED_MODE_SIZE to MAX (BITS_PER_WORD * 2, 64)

2025-07-22 Thread Hans-Peter Nilsson
On Fri, 18 Jul 2025, Pietro Monteiro wrote: > I think you need to update the description of MAX_FIXED_MODE_SIZE in > gcc/doc/tm.texi.in with the new default. Oops, absolutely, thanks for pointing that out. Here's v2, with info and dvi results inspected for sanity. Ok to commit now? (Note: sciss

Re: [PATCH] zlib: import zlib-1.3.1

2025-07-22 Thread Jeff Law
On 7/20/25 6:54 PM, Sam James wrote: This is vanilla zlib-1.3.1 imported over the existing zlib/ dir with: * README adjusted to add the GCC note at the top; * GCC's ChangeLog merged with the upstream one, as before; * Deleted upstream Makefile as has been done before (we use an autoconf- ge

Re: [PATCH] strlen: Don't do the malloc+memset->calloc optimization in some cases [PR83022]

2025-07-22 Thread Andrew Pinski
On Fri, Apr 18, 2025 at 5:08 PM Andrew Pinski wrote: > > This fixes a long standing (since GCC 5) issue where the malloc+memset->calloc > optimization would happen even if the memset was not always executed. > This is a varient of Nathan's patch: > https://inbox.sourceware.org/gcc-patches/f4b5d10

Re: [PATCH] tree-optimization/120929: Limit MEM_REF handling to .ACCESS_WITH_SIZE

2025-07-22 Thread Siddhesh Poyarekar
[Apologies if I've missed some context in my reading since I'm coming back to this after a big break] On 2025-07-22 12:33, Qing Zhao wrote: Why it's wrong to pass the VALUE of the original pointer as the first argument to the call to .ACCESS_WITH_SIZE For a pointer field with counted_by attri

Re: [PATCH v2] x86-64: Remove redundant TLS calls

2025-07-22 Thread H.J. Lu
On Mon, Jul 21, 2025 at 8:09 PM Hongtao Liu wrote: > > On Tue, Jul 22, 2025 at 4:47 AM H.J. Lu wrote: > > > > For TLS calls: > > > > 1. UNSPEC_TLS_GD: > > > > (parallel [ > > (set (reg:DI 0 ax) > > (call:DI (mem:QI (symbol_ref:DI ("__tls_get_addr"))) > > (const_in

[PATCH v3] x86-64: Remove redundant TLS calls

2025-07-22 Thread H.J. Lu
For TLS calls: 1. UNSPEC_TLS_GD: (parallel [ (set (reg:DI 0 ax) (call:DI (mem:QI (symbol_ref:DI ("__tls_get_addr"))) (const_int 0 [0]))) (unspec:DI [(symbol_ref:DI ("e") [flags 0x50]) (reg/f:DI 7 sp)] UNSPEC_TLS_GD) (clobber (reg:DI 5 di))]

[RFC] RISC-V: support vnclip idiom [PR120378]

2025-07-22 Thread Edwin Lu
This patch would add a new middle-end representation for matching the x264 narrowing clip idiom: inline U_NT clip_uint8 (S_WT x) { return x & (~((U_NT)-1)) ? (-x) >> 31 : x; } which would be accessible through the define_expand clip2 optabs. For example, truncating int32_t to uint8_t would pro

Re: [PATCH] Fortran: fix passing of character length of function to procedure [PR121203]

2025-07-22 Thread Jerry D
On 7/22/25 11:28 AM, Harald Anlauf wrote: Dear all, the attached patch fixes a long-standing issue with legacy code, where an assumed-length character function is passed as actual argument to a procedure, and when there is no explicit interface. The solution is to do the same as in the case when

[pushed] c++: constexpr union placement new [PR121068]

2025-07-22 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- The note and example in [class.union] p6 think that placement new can be used to change the active member of a union, but we didn't support that for array members in constant-evaluation even after implementing P1330 and P2747. First I tried

Re: [PATCH v4] libstdc++: Implement Philox Engine [PR119794]

2025-07-22 Thread Patrick Palka
On Sat, 19 Jul 2025, 1nfocalypse wrote: > Implements Philox Engine (P2075R6) and associated tests. > > Implements additional feedback from v3 from Patrick Palka. > > I went ahead and qualified the STL functions to avoid ADL ambiguity, > as recommended. However, if this was erroneous, I'd be happ

Re: [PATCH] [RFC] Delayed parsing for bounds safety attributes

2025-07-22 Thread Qing Zhao
Hi, Bill, Thanks a lot for your effort to try to provide a consistent interface of counted_by attribute to the users. Really appreciate for this. However, given the current situation, I also think that provide two different interfaces from CLANG and GCC might be the practical solution to this

Re: [PATCH] c++: name lookup for non-dep rewritten != expr [PR121179]

2025-07-22 Thread Jason Merrill
On 7/22/25 4:18 PM, Patrick Palka wrote: Bootstrapped and rgetested on x86_64-pc-linux-gnu, does this look OK for trunk? In order to properly handle all rewritten operator expressions, I suppose we could teach build_min_non_dep_op_overload to carefully look through 'non_dep' and note when argume

Re: [PATCH v3] c++: consteval blocks

2025-07-22 Thread Jason Merrill
On 7/21/25 6:28 PM, Marek Polacek wrote: On Mon, Jul 21, 2025 at 11:26:08AM -0400, Jason Merrill wrote: On 7/18/25 5:11 PM, Marek Polacek wrote: On Thu, Jul 17, 2025 at 06:44:08PM -0400, Jason Merrill wrote: On 7/17/25 6:25 PM, Jakub Jelinek wrote: On Thu, Jul 17, 2025 at 05:31:27PM -0400, Ja

Re: [PATCH] c++: fix __is_invocable for std::reference_wrapper [PR121055]

2025-07-22 Thread Jason Merrill
On 7/22/25 4:18 PM, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? OK, and I think go ahead and apply it to the 15 branch as well. -- >8 -- Our implementation of the INVOKE spec ([func.require]) was incorrectly treating reference_wrapper:

[PATCH] c++: fix __is_invocable for std::reference_wrapper [PR121055]

2025-07-22 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- Our implementation of the INVOKE spec ([func.require]) was incorrectly treating reference_wrapper::get() as returning T instead of T&, which notably makes a difference when invoking a ref-qualified memfn poin

[PATCH] c++: name lookup for non-dep rewritten != expr [PR121179]

2025-07-22 Thread Patrick Palka
Bootstrapped and rgetested on x86_64-pc-linux-gnu, does this look OK for trunk? In order to properly handle all rewritten operator expressions, I suppose we could teach build_min_non_dep_op_overload to carefully look through 'non_dep' and note when arguments are reversed etc. But rather than that

Re: [RFC PATCH v2 2/6] aarch64: Enable dumping of AArch64 CPU tuning parameters to JSON

2025-07-22 Thread Andrew Pinski
On Tue, Jul 22, 2025 at 12:50 PM Andrew Pinski wrote: > > On Thu, Jul 17, 2025 at 10:35 PM wrote: > > > > From: Soumya AR > > > > This patch adds functionality to dump AArch64 CPU tuning parameters to a > > JSON > > file. The new '-fdump-tuning-model=' flag allows users to export the current >

Re: [RFC PATCH v2 2/6] aarch64: Enable dumping of AArch64 CPU tuning parameters to JSON

2025-07-22 Thread Andrew Pinski
On Thu, Jul 17, 2025 at 10:35 PM wrote: > > From: Soumya AR > > This patch adds functionality to dump AArch64 CPU tuning parameters to a JSON > file. The new '-fdump-tuning-model=' flag allows users to export the current > tuning model configuration to a JSON file. > > This patch was bootstrapped

Re: [PATCH v1] rs6000: Fix UBSAN runtime errors for powerpc64le-unknown-linux-gnu

2025-07-22 Thread Kishan Parmar
On 26/06/25 9:20 pm, Segher Boessenkool wrote: > Hi! > > [ Please don't say "patch v1", it's just clutter. ] > > The point of the patch is to improve some code that evokes undefined > behaviour. The sanitizer for that is how these problems were found, > you can remark that somewhere later in the

Re: [PATCH] [RFC] Delayed parsing for bounds safety attributes

2025-07-22 Thread Bill Wendling
+josmy...@redhat.com On Sun, Jul 20, 2025 at 4:20 AM wrote: > > From: Bill Wendling > > Also, this code doesn't go further than parsing. I.e., it doesn't generate the > internal gimple code that accesses the struct fields. The code is meant to > show > that it *is* possible to perform a delayed

Re: [Fortran, Coarray] Call-out to everyone having Fortran coarray-codes available

2025-07-22 Thread Toon Moene
On 7/22/25 17:22, Iain Sandoe wrote: Hi Andre 2. If I try linking a trivial Fortran code thus: gfortran /src-local/test/fortran/hello.f90 -o h -lcaf_shmem -fcoarray=lib the exe then hangs - it looks like it might be deadlocked in startup code: Call graph: 2166 Thread_408707810 Disp

Re: [PATCH] aarch64: Fix fma steering when rename fails [PR120119]

2025-07-22 Thread Andrew Pinski
On Tue, Jul 22, 2025, 11:05 AM Remi Machet wrote: > > On 7/22/25 13:32, Andrew Pinski wrote: > > External email: Use caution opening links or attachments > > > > > > Regrename can fail in some case and `insn_rr[INSN_UID (insn)].op_info` > > will be null. The FMA steering code was not expecting th

[PATCH] Fortran: fix passing of character length of function to procedure [PR121203]

2025-07-22 Thread Harald Anlauf
Dear all, the attached patch fixes a long-standing issue with legacy code, where an assumed-length character function is passed as actual argument to a procedure, and when there is no explicit interface. The solution is to do the same as in the case when there is an actual interface: take the cha

Re: [PATCH] aarch64: Fix fma steering when rename fails [PR120119]

2025-07-22 Thread Remi Machet
On 7/22/25 13:32, Andrew Pinski wrote: > External email: Use caution opening links or attachments > > > Regrename can fail in some case and `insn_rr[INSN_UID (insn)].op_info` > will be null. The FMA steering code was not expecting the failure to happen. > This started to happen after early RA was

[PATCH] switch-conversion: Reject VLA vector types [PR121091]

2025-07-22 Thread Andrew Pinski
The switch conversion code will generate an array with VLA vector constants in it in some cases but this does not work as the length of the vector type is not known at compile time; only the min size is known. I tried to reject this in initializer_constant_valid_p but code from the C++ front-en

[PATCH] aarch64: Fix fma steering when rename fails [PR120119]

2025-07-22 Thread Andrew Pinski
Regrename can fail in some case and `insn_rr[INSN_UID (insn)].op_info` will be null. The FMA steering code was not expecting the failure to happen. This started to happen after early RA was added but it has been a latent bug before that. Build and tested for aarch64-linux-gnu. PR target/1

Re: [PATCH 2/2] xtensa: Fix inaccuracy in xtensa_rtx_costs()

2025-07-22 Thread Max Filippov
On Wed, Jul 16, 2025 at 1:13 AM Takayuki 'January June' Suwa wrote: > > This patch fixes the following defects in the function: > >- The cost of move instructions larger than the natural word width, > specifically "movd[if]_internal", cannot be estimated correctly >- Floating-point or

Re: [PATCH] tree-optimization/120929: Limit MEM_REF handling to .ACCESS_WITH_SIZE

2025-07-22 Thread Qing Zhao
Hi, More thought on this over the weekend. -:) I summarized my thought in the following small writeup, please provide any comment or suggestion. Thanks a lot! Qing === Why it's wrong to pass the VALUE of the original pointer as the first argument to the call

Re: [PATCH] tree-sra: Avoid total SRA if there are incompat. aggregate accesses (PR119085)

2025-07-22 Thread Richard Biener
> Am 22.07.2025 um 17:05 schrieb Martin Jambor : > > Hi, > > we currently use the types encountered in the function body and not in > type declaration to perform total scalarization. Bug PR 119085 > uncovered that we miss a check that when the same data is accessed > with aggregate types tha

Re: [PING][PATCH 0/1] aarch64: testsuite: Keep -mtune=generic when specifying -moverride

2025-07-22 Thread Spencer Abson
Gentle ping. On Mon, Jul 14, 2025 at 09:43:29PM +, Spencer Abson wrote: > Hi all, > > Currently, using '-moverride' in the testsuite will reset the baseline tuning > model from 'generic' to the default tuning for the architecture level. Since > 'generic' is the tuning model relied upon by mo

Re: [Fortran, Coarray] Call-out to everyone having Fortran coarray-codes available

2025-07-22 Thread Iain Sandoe
Hi Andre It would be very helpful if there were such a thing as a “hello-coarrays.fxx” code for those of us who do not have existing installations of mpi &c. aand limited time to so tests… … experiments so far - below thanks Iain > >> > > We like everyone to test the new caf_shmem library an

Re: [PATCH v3 4/5] vect: Misalign checks for gather/scatter.

2025-07-22 Thread Robin Dapp
Note if-conversion emits IFN_MASK_LOAD/STORE, only the vectorizer later emits the LEN variants. So this is about whether there are (might) be uarchs that have vector aligned loads (aka target alignment is sizeof(vector)) and in addition to that have support for misaligned loads but those with sti

Re: [PATCH v6 1/3][Middle-end] Provide more contexts for -Warray-bounds, -Wstringop-*warning messages due to code movements from compiler transformation (Part 1) [PR109071,PR85788,PR88771,PR106762,PR1

2025-07-22 Thread Qing Zhao
Hi, an update on this feature: For a more complicated testing case like the following: #define MAX_LENGTH 10 int a[MAX_LENGTH]; void __attribute__ ((noinline)) foo (int i, bool is_day, bool is_dollar) { if (i < MAX_LENGTH) { if (is_day) __builtin_printf ("day"); else

[PATCH] tree-sra: Avoid total SRA if there are incompat. aggregate accesses (PR119085)

2025-07-22 Thread Martin Jambor
Hi, we currently use the types encountered in the function body and not in type declaration to perform total scalarization. Bug PR 119085 uncovered that we miss a check that when the same data is accessed with aggregate types that those are actually compatible. Without it, we can base total scal

Re: [PATCH v2] libstdc++: Negative tests for constexpr uses inplace_vector [PR119137]

2025-07-22 Thread Patrick Palka
On Tue, 22 Jul 2025, Tomasz Kamiński wrote: > Adds negative tests for preconditions on inserting into a full > inplace_vector and erasing non-existent elementsi at compile-time. > This ensures coverage for the inplace_vector specialization. > > Also extends element access tests to cover front() a

[PATCH 4/4] Do not set STMT_VINFO_VECTYPE from dataref analysis

2025-07-22 Thread Richard Biener
The following makes dataref analysis not set STMT_VINFO_VECTYPE. This leaves the field ready for taking when vectorizable_* transition to use SLP_TREE_VECTYPE. It also delays determining the vectorization mode a little bit - SLP build will first do that then. I have kept a check that there is any

[PATCH 1/4] Use SLP graph based walk to perform alignment analysis

2025-07-22 Thread Richard Biener
The following makes us use the SLP graph and its recorded vector types to perform alignment analysis even for loops. This avoids accessing STMT_VINFO_VECTYPE we want to get rid of. v2 adjusts alignment peeling to ignore DRs that are dead because of conditional store pattern recognition.

Re: [PATCH] [aarch64] check for non-NULL vectype in aarch64_vector_costs::add_stmt_cost

2025-07-22 Thread Andrew Pinski
On Tue, Jul 22, 2025, 6:09 AM Richard Biener wrote: > With a patch still in development we get NULL STMT_VINFO_VECTYPE. > One side-effect is that during scalar stmt testing we no longer > pass a vectype. The following adjusts aarch64_vector_costs::add_stmt_cost > to check for a non-NULL vectype

[PATCH v2] libstdc++: Negative tests for constexpr uses inplace_vector [PR119137]

2025-07-22 Thread Tomasz Kamiński
Adds negative tests for preconditions on inserting into a full inplace_vector and erasing non-existent elementsi at compile-time. This ensures coverage for the inplace_vector specialization. Also extends element access tests to cover front() and back() methods, and const and mutable overloads for

[PATCH] libstdc++: Negative tests for constexpr uses inplace_vector [PR119137]

2025-07-22 Thread Tomasz Kamiński
Adds negative tests for preconditions on inserting into a full inplace_vector and erasing non-existent elementsi at compile-time. This ensures coverage for the inplace_vector specialization. Also extends element access tests to cover front() and back() methods, and const and mutable overloads for

[PATCH 3/4] Pass vectype to vect_check_gather_scatter, handle early processing

2025-07-22 Thread Richard Biener
The following removes the STMT_VINFO_VECTYPE usage from vect_check_gather_scatter and instead gets the vector type passed in from the caller. For the two early callers, the one from dataref analysis and the one from vect_mark_stmts_to_be_vectorized we add a mode that works with a NULL vector type

[PATCH 2/4] [aarch64] check for non-NULL vectype in aarch64_vector_costs::add_stmt_cost

2025-07-22 Thread Richard Biener
With a patch still in development we get NULL STMT_VINFO_VECTYPE. One side-effect is that during scalar stmt testing we no longer pass a vectype. The following adjusts aarch64_vector_costs::add_stmt_cost to check for a non-NULL vectype before accessing it, like all the code surrounding it. The ot

Re: [PATCH] libstdc++: Make testsuite_iterators constexpr and expand inplace_vector tests [PR119137]

2025-07-22 Thread Patrick Palka
On Tue, 22 Jul 2025, Tomasz Kamiński wrote: > All functions in testsuite_iterators.h are now marked constexpr, > targeting the earliest possible standard. Most functions use C++14 due > to multi-statement bodies, with exceptions: > > * BoundsContainer and some constructors are C++11 compatible. >

Re: [PATCH v2 0/3] Implement aligned_accessor [P2897R7]

2025-07-22 Thread Luc Grosheintz
Hi Tomasz, there's no time-pressure or rush from my side. We've finished the C++23 parts of mdspan, I think that's the important milestone. Hence, I feel it makes a lot of sense if you deprioritize reviewing mdspan related patches for a while. Personally, I think it would be least work for every

[PATCH] middle-end/121216 - ICE with VLA const string initializer

2025-07-22 Thread Richard Biener
constant_byte_string fails to consider the string type might be VLA when initialized by an empty string CTOR. Bootstrap and regtest running on x86_64-unknown-linux-gnu. PR middle-end/121216 * expr.cc (constant_byte_string): Check the string type size fits an uhwi before co

Re: [PATCH] RISC-V: testsuite: Fix vx_vf_*run-1-f16.c run tests.

2025-07-22 Thread Jeff Law
On 7/22/25 3:04 AM, Robin Dapp wrote: Hi, This patch fixes the vf_vfmacc-run-1-f16.c test failures on rv32 by adding zvfh requirements as well as options to the test and the target harness. Regtested on rv64gcv_zvl512b and rv32gcv_zvl512b.  Going to commit as obvious if the CI agrees that it

[PATCH v7 11/13] c: Add target_version attribute support.

2025-07-22 Thread Alfie Richards
Hi All, Apologies, that previous patch was clearly hastily made and included some rubbish temp files. Cleaned up patch attached -- >8 -- This commit introduces support for the target_version attribute in the c frontend, following the behavior defined in the Arm C Language Extension. Key change

[PATCH v7 11/13] c: Add target_version attribute support.

2025-07-22 Thread Alfie Richards
Hello, Quick update for this patch as I found a minor bug with it. Changed the decl merging logic slightly and added a new test. Reg tested on Aarch64 and x68_64. Kind regards, Alfie -- >8 -- This commit introduces support for the target_version attribute in the c frontend, following the beha

[PATCH] [aarch64] check for non-NULL vectype in aarch64_vector_costs::add_stmt_cost

2025-07-22 Thread Richard Biener
With a patch still in development we get NULL STMT_VINFO_VECTYPE. One side-effect is that during scalar stmt testing we no longer pass a vectype. The following adjusts aarch64_vector_costs::add_stmt_cost to check for a non-NULL vectype before accessing it, like all the code surrounding it. The ot

[PATCH v2] MicroBlaze : Enhance support for atomics. Fix PR118280

2025-07-22 Thread Gopi Kumar Bulusu
namaskaaram Revised patch is attached. This patch no longer changes the default option value for xl-barrel-shift On Mon, Jul 14, 2025 at 10:29 AM Gopi Kumar Bulusu wrote: > > > On Fri, Jul 11, 2025 at 8:12 PM Michael Eager wrote: > >> On 7/10/25 4:41 AM, Gopi Kumar Bulusu wrote: >> > >> > nam

[PATCH] tree-optimization/121202 - fix vector stmt placement

2025-07-22 Thread Richard Biener
When we have a vector shift with a scalar the shift operand can be external - in that case we should not use the shift operand def as hint where to place the vector shift instruction. The ICE in the PR is because stmt dominance queries only work inside of the vector region. But we should also nev

Re: [PATCHv4] libstdc++: Add NTTP bind_front, -back, not_fn (P2714) [PR119744]

2025-07-22 Thread Tomasz Kaminski
On Tue, Jul 22, 2025 at 11:28 AM Tomasz Kaminski wrote: > > > On Tue, Jul 22, 2025 at 9:22 AM Nathan Myers wrote: > >> This should be close to ready. However, std::is_invocable >> and noexcept still fail oddly applied to the not_fp result. >> The remaining failing test cases in */nttp.cc, commen

Re: [PATCH v3 4/5] vect: Misalign checks for gather/scatter.

2025-07-22 Thread Richard Biener
On Tue, Jul 22, 2025 at 12:02 PM Robin Dapp wrote: > > > So this is the only part I think is odd - there is a dataref, it just > > has only DR_REF as relevant data. I would have expected we can > > adjust vect_supportable_dr_alignment to deal with the scatter/gather > > case. I'm OK with doing i

Re: [PATCH] [RFC] Move STMT_VINFO_TYPE to SLP_TREE_TYPE

2025-07-22 Thread Richard Biener
On Tue, 22 Jul 2025, Robin Dapp wrote: > The more I look at our heuristic the more it appears due for a rewrite. > But that's really not in my plans right now. I just sent a riscv patch > that does the necessary preparations so you can basically > > s/STMT_VINFO_TYPE (stmt_info)/SLP_TREE_TYPE (n

Re: [PATCH v5 0/3] Hard Register Constraints

2025-07-22 Thread Stefan Schulze Frielinghaus
On Mon, Jul 21, 2025 at 01:54:55PM -0700, H.J. Lu wrote: > On Mon, Jul 21, 2025 at 4:16 AM Stefan Schulze Frielinghaus > wrote: > > > > On Sat, Jul 19, 2025 at 08:26:22AM -0600, Jeff Law wrote: > > > > > > > > > On 7/17/25 2:24 AM, Stefan Schulze Frielinghaus wrote: > > > > On Wed, Jul 09, 2025 at

[PATCH] asf: Skip when an instruction doesn't satisfy the constraints [PR119795]

2025-07-22 Thread Konstantinos Eleftheriou
While scanning the instructions and upon reaching an instruction that doesn't satisfy the constraints that we have set, we were removing the already detected stores, but we were continuing adding stores from that point onward. This was causing issues when the address ranges from later stores overla

Re: [PATCH v2 0/3] Implement aligned_accessor [P2897R7]

2025-07-22 Thread Tomasz Kaminski
Hi, These commits mostly LGTM, as mentioned, but as I have mentioned in other emails, They may stay as is for some time. However, we could land a (test rewrite) patch soon, as it does not introduce any functional changes, so you could send a v2 of that, and then patch series with only functional p

Re: [PATCH v2 2/3] libstdc++: Prepare test code for default_accessor for reuse.

2025-07-22 Thread Tomasz Kaminski
On Tue, Jul 22, 2025 at 11:58 AM Tomasz Kaminski wrote: > > > On Mon, Jul 21, 2025 at 10:19 AM Luc Grosheintz > wrote: > >> All test code of default_accessor can be reused. This commit moves >> the reuseable code into a file generic.cc and prepares the tests for >> reuse with aligned_accessor. >

Re: [PATCH v2 3/3] libstdc++: Implement aligned_accessor from mdspan [PR120994]

2025-07-22 Thread Tomasz Kaminski
On Mon, Jul 21, 2025 at 10:25 AM Luc Grosheintz wrote: > This commit completes the implementation of P2897R7 by implementing and > testing the template class aligned_accessor. > > PR libstdc++/120994 > > libstdc++-v3/ChangeLog: > > * include/bits/version.def (aligned_accessor): Ad

Re: [PATCH v3 4/5] vect: Misalign checks for gather/scatter.

2025-07-22 Thread Robin Dapp
So this is the only part I think is odd - there is a dataref, it just has only DR_REF as relevant data. I would have expected we can adjust vect_supportable_dr_alignment to deal with the scatter/gather case. I'm OK with doing it how you did it here, but seeing the /* For now assume all condit

Re: [PATCH v2 2/3] libstdc++: Prepare test code for default_accessor for reuse.

2025-07-22 Thread Tomasz Kaminski
On Mon, Jul 21, 2025 at 10:19 AM Luc Grosheintz wrote: > All test code of default_accessor can be reused. This commit moves > the reuseable code into a file generic.cc and prepares the tests for > reuse with aligned_accessor. > > The AllocatorTrait creates a unified interface for creating both >

Re: [PATCH] [RFC] Move STMT_VINFO_TYPE to SLP_TREE_TYPE

2025-07-22 Thread Robin Dapp
The more I look at our heuristic the more it appears due for a rewrite. But that's really not in my plans right now. I just sent a riscv patch that does the necessary preparations so you can basically s/STMT_VINFO_TYPE (stmt_info)/SLP_TREE_TYPE (node)/ once it lands. I regtested with your patc

[PATCH] RISC-V: Prepare dynamic LMUL heuristic for SLP.

2025-07-22 Thread Robin Dapp
Hi, This patch prepares the dynamic LMUL vector costing to use the coming SLP_TREE_TYPE instead of the (to-be-removed) STMT_VINFO_TYPE. Even though the whole approach should be reviewed and adjusted at some point, the patch chooses the path of least resistance and uses a hash map for the stmt_in

[RFC] c++: Optimize out dynamic_cast call when target is final [PR63164]

2025-07-22 Thread Thomas de Bock
This patch optimizes out calls to __dynamic_cast when the type being cast to is final (or its destructor), replacing them with a simple comparison of the types' vtable addresses. This is already implemented and done by default in clang (https://reviews.llvm.org/D154658), but can be turned off wi

[PATCH] Run feedback directed ipa-split for flag_auto_profile

2025-07-22 Thread Kugan Vivekanandarajah
Hi, IPA split is now running before auto-profile annotation. Changing it after annotation as it is done for PGO. gcc/ChangeLog: 2025-07-21 Kugan Vivekanandarajah * ipa-split.cc (pass_split_functions::gate): Do not run when flag_auto_profile. (pass_feedback_split_funct

Re: [PATCHv4] libstdc++: Add NTTP bind_front, -back, not_fn (P2714) [PR119744]

2025-07-22 Thread Tomasz Kaminski
On Tue, Jul 22, 2025 at 9:22 AM Nathan Myers wrote: > This should be close to ready. However, std::is_invocable > and noexcept still fail oddly applied to the not_fp result. > The remaining failing test cases in */nttp.cc, commented > out, need careful examination to see whether they should > be

[PATCH][v2] Use SLP graph based walk to perform alignment analysis

2025-07-22 Thread Richard Biener
The following makes us use the SLP graph and its recorded vector types to perform alignment analysis even for loops. This avoids accessing STMT_VINFO_VECTYPE we want to get rid of. v2 adjusts alignment peeling to ignore DRs that are dead because of conditional store pattern recognition. Bootstap

Re: [PATCH] genpreds.cc: Do not use rawmemchr for insn_constraint_len

2025-07-22 Thread Richard Biener
On Mon, Jul 21, 2025 at 6:28 PM Stefan Schulze Frielinghaus wrote: > > Bootstrapped successfully on s390x and tests dg.exp=asm-hard-reg-\*.c > and s390.exp=asm-hard-reg-\*.c are successful, too. Ok for mainline? OK. Richard. > -- >8 -- > > The GNU extension rawmemchr cannot be used. Therefore

Re: [PATCH] Default to -mcpu=ultrasparc3 on Solaris/SPARC

2025-07-22 Thread Eric Botcazou
> Bootstrapped on sparc-sun-solaris2.11 and sparcv9-sun-solaris2.11 with > as/ld, gas/ld, and gas/gld configurations. > > There are currently two regressions exposed by this patch (PRs 121191 > and 121192), which are only present in gcc 16 resp. 15/16. > > There's one small caveat: while Solaris

[COMMITTED 22/22] ada: Nested use_type_clause with "all" cancels use_type_clause with wider scope

2025-07-22 Thread Marc Poulhiès
From: Gary Dismukes The compiler mishandles nested use_type_clauses in the case where the outer one is a normal use_type_clause and the inner one has "all". Upon leaving the scope of the inner use_type_clause, the outer one is effectively disabled, because it's not considered redundant (and in fa

[COMMITTED 21/22] ada: Only fold array attributes in SPARK when prefix is safe to evaluate

2025-07-22 Thread Marc Poulhiès
From: Piotr Trojanek Fix missing checks for prefixes of array attributes in GNATprove mode. gcc/ada/ChangeLog: * sem_attr.adb (Eval_Attribute): Only fold array attributes when prefix is static or at least safe to evaluate Tested on x86_64-pc-linux-gnu, committed on master. ---

[COMMITTED 20/22] ada: Fix minor issues in comments

2025-07-22 Thread Marc Poulhiès
From: Ronan Desplanques gcc/ada/ChangeLog: * einfo.ads (Is_Controlled_Active): Fix pasto in comment. * sem_util.ads (Propagate_Controlled_Flags): Update comment for Destructor aspect. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/einfo.ads| 2 +-

[COMMITTED 17/22] ada: Fix generation of Initialize and Adjust calls

2025-07-22 Thread Marc Poulhiès
From: Ronan Desplanques Before this patch, Make_Init_Call and Make_Adjust_Call made the assumption that if the type they were called with was untagged and a derived type, it was the untagged private view of a tagged type. That assumption made it possible to inspect the root type's primitives to h

[AutoFDO] Propagate single succ/pred block's annotation

2025-07-22 Thread Kugan Vivekanandarajah
Hi, In afdo_propagate_edge, annotate edge from the connected basic_block if they have single predcessor/succcessor. Tested with spec2017 intrate/intspeed and shows slight improvement. gcc/ChangeLog: 2025-07-21 Kugan Vivekanandarajah * auto-profile.cc (afdo_propagate_edge): Propagate

[COMMITTED 18/22] ada: Fix crash when creating extra formals for aliased types

2025-07-22 Thread Marc Poulhiès
From: Denis Mazzucato This patch makes sure that we return the same decision for all aliased types when checking if the BIP task extra actuals are needed. gcc/ada/ChangeLog: * sem_ch6.adb (Might_Need_BIP_Task_Actuals): Before retrieving the original corresponding operation we r

[COMMITTED 15/22] ada: Wrong dispatch on result in presence of dependent expression

2025-07-22 Thread Marc Poulhiès
From: Javier Miranda The compiler generates wrong code in a dispatching call on result when the call is performed under dependent conditional expressions or case-expressions. gcc/ada/ChangeLog: * sinfo.ads (Is_Expanded_Dispatching_Call): New flag. (Tag_Propagated): New flag.

[PATCH] RISC-V: testsuite: Fix vx_vf_*run-1-f16.c run tests.

2025-07-22 Thread Robin Dapp
Hi, This patch fixes the vf_vfmacc-run-1-f16.c test failures on rv32 by adding zvfh requirements as well as options to the test and the target harness. Regtested on rv64gcv_zvl512b and rv32gcv_zvl512b. Going to commit as obvious if the CI agrees that it's obvious ;) Regards Robin gcc/testsuit

[PATCH] RISC-V: Rework broadcast handling [PR121073].

2025-07-22 Thread Robin Dapp
Hi, During the last weeks it became clear that our current broadcast handling needs an overhaul in order to improve maintainability. PR121073 showed that my intermediate fix wasn't enough and caused regressions. This patch now goes a first step towards untangling broadcast (vmv.v.x), "set first"

[COMMITTED 14/22] ada: Additional condition for Capacity discriminant on bounded container aggregates

2025-07-22 Thread Marc Poulhiès
From: Gary Dismukes This change test an additional condition as part of the criteria used for deciding whether to generate a call to a container type's Length function (for passing to the Empty function) when determining the size of the object to allocate for a bounded container aggregate with a

[COMMITTED 08/22] ada: Tune check for restriction No_Relative_Delay and call to Set_Handler

2025-07-22 Thread Marc Poulhiès
From: Piotr Trojanek When checking restriction No_Relative_Delay and detecting calls to Ada.Real_Time.Timing_Events.Set_Handler with a Time_Span parameter, we looked at the exact type of the actual parameter, while we should look at its base type. This patch looks at the type of actual parameter

[COMMITTED 01/22] ada: Improved support for mutably tagged types

2025-07-22 Thread Marc Poulhiès
From: Steve Baird Fix bugs related to mutably tagged types in streaming operations, Put_Image attributes, aggregates, composite equality comparisons with mutably-tagged components, and other issues. gcc/ada/ChangeLog: * exp_aggr.adb (Build_Record_Aggr_Code.Gen_Assign): In the case of

[PATCH] libstdc++: Make testsuite_iterators constexpr and expand inplace_vector tests [PR119137]

2025-07-22 Thread Tomasz Kamiński
All functions in testsuite_iterators.h are now marked constexpr, targeting the earliest possible standard. Most functions use C++14 due to multi-statement bodies, with exceptions: * BoundsContainer and some constructors are C++11 compatible. * OutputContainer is C++20 due to operator new/delete us

[COMMITTED 19/22] ada: Add destructors extension

2025-07-22 Thread Marc Poulhiès
From: Ronan Desplanques This patch adds a GNAT-specific extension which enables "destructors". Destructors are an optional replacement for Ada.Finalization where some aspects of the interaction with type derivation are different. gcc/ada/ChangeLog: * doc/gnat_rm/gnat_language_extensions

Re: [PATCH v2 1/3] libstdc++: Implement is_sufficiently_aligned [PR120994]

2025-07-22 Thread Tomasz Kaminski
On Mon, Jul 21, 2025 at 10:18 AM Luc Grosheintz wrote: > This commit implements and tests the function is_sufficiently_aligned > from P2897R7. > > PR libstdc++/120994 > > libstdc++-v3/ChangeLog: > > * include/bits/align.h (is_sufficiently_aligned): New function. > * includ

[COMMITTED 06/22] ada: Replace "not Present" test with "No" test

2025-07-22 Thread Marc Poulhiès
From: Gary Dismukes Minor change to satisfy GNAT SAS checker. gcc/ada/ChangeLog: * exp_aggr.adb (Build_Size_Expr): Change test of "not Present (...)" to "No (...)". Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_aggr.adb | 3 +-- 1 file changed, 1 inserti

[PATCH] Default to -mcpu=ultrasparc3 on Solaris/SPARC

2025-07-22 Thread Rainer Orth
Prompted by the discussions around a recent clang bug, I realized that gcc still defaults to -mcpu=v9 on Solaris/SPARC. This is an oversight since the Oracle Studio 12.6 cc, released in 2017, already defaults to -xarch=sparcvis2, the equivalent of -mcpu=ultrasparc3. Besides, both the 32 and 64-bi

[COMMITTED 13/22] ada: Fix assertion failure on aggregate with controlled component

2025-07-22 Thread Marc Poulhiès
From: Eric Botcazou The assertion is: pragma Assert (Side_Effect_Free (L)); in Make_Tag_Ctrl_Assignment and demonstrates that the sequence: Remove_Side_Effects (L); pragma Assert (Side_Effect_Free (L)); does not hold in this case. What happens is that Remove_Side_Effects uses a ren

Re: [PATCH v3] libstdc++: Implement std::dims from .

2025-07-22 Thread Tomasz Kaminski
On Mon, Jul 21, 2025 at 5:51 PM Luc Grosheintz wrote: > This commit implements the C++26 feature std::dims described in P2389R2. > It sets the feature testing macro to 202406 and adds tests. > > Also fixes the test mdspan/version.cc > > libstdc++-v3/ChangeLog: > > * include/bits/version.d

[COMMITTED 16/22] ada: Remove obsolete code from Safe_Unchecked_Type_Conversion

2025-07-22 Thread Marc Poulhiès
From: Eric Botcazou That's a kludge added to work around the limitations of the stack checking mechanism used in the early days. gcc/ada/ChangeLog: * exp_util.ads (May_Generate_Large_Temp): Delete. * exp_util.adb (May_Generate_Large_Temp): Likewise. (Safe_Unchecked_Type_

  1   2   >