Re: [PATCH] x86: Remove BREG from ix86_class_likely_spilled_p

2025-04-30 Thread Uros Bizjak
On Wed, Apr 30, 2025 at 11:31 PM H.J. Lu wrote: > > On Wed, Apr 30, 2025 at 7:37 PM Uros Bizjak wrote: > > > > On Tue, Apr 29, 2025 at 11:40 PM H.J. Lu wrote: > > > > > > AREG, DREG, CREG and AD_REGS are kept in ix86_class_likely_spilled_p to > > > avoid the following regressions with > > > > >

Re: [PATCH v1][GCC16-Stage-1] RISC-V: Remove unnecessary frm restore volatile define_insn

2025-04-30 Thread Vineet Gupta
On 4/30/25 20:44, Jeff Law wrote: > On 4/30/25 6:03 PM, Li, Pan2 wrote: >>> Sorry this got backed up as I'm working on FRM overhaul - if this is not >>> super >>> urgent can you please wait for a few weeks for my work to be posted. >>> If you prefer this go in still, fine by me as well. >> Sure

[PATCH] phiopt: Remove special case for a sequence after match and simplify for early phiopt

2025-04-30 Thread Andrew Pinski
r16-189-g99aa410f5e0a72 fixed the case where match-and-simplify there was an extra assignment happening inside the sequence return. phiopt_early_allow had code to workaround that issue but now can be removed and simplify down to only allowing the sequence having only one MIN/MAX if the outer code

Re: [PATCH v1][GCC16-Stage-1] RISC-V: Remove unnecessary frm restore volatile define_insn

2025-04-30 Thread Jeff Law
On 4/30/25 6:03 PM, Li, Pan2 wrote: Hi Vineet, Sorry this got backed up as I'm working on FRM overhaul - if this is not super urgent can you please wait for a few weeks for my work to be posted. If you prefer this go in still, fine by me as well. Sure thing, feel free to ping me if there i

Re: [PUSHED] vectorizer: Fix riscv build [PR120042]

2025-04-30 Thread Jeff Law
On 4/30/25 4:13 PM, Andrew Pinski wrote: r15-9859-ga6cfde60d8c added a call to dominated_by_p to tree-vectorizer.h but dominance.h is not always included; and you get a build failure on riscv building riscv-vector-costs.cc. Let's add the include of dominance.h to tree-vectorizer.h Pushed as

RE: [PATCH v1][GCC16-Stage-1] RISC-V: Remove unnecessary frm restore volatile define_insn

2025-04-30 Thread Li, Pan2
Hi Vineet, > Sorry this got backed up as I'm working on FRM overhaul - if this is not super > urgent can you please wait for a few weeks for my work to be posted. > If you prefer this go in still, fine by me as well. Sure thing, feel free to ping me if there is something I can help. Pan -O

Re: [PATCH] x86: Update TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P

2025-04-30 Thread H.J. Lu
On Wed, Apr 30, 2025 at 7:48 PM Uros Bizjak wrote: > > On Tue, Apr 29, 2025 at 11:40 PM H.J. Lu wrote: > > > > SMALL_REGISTER_CLASSES was added by > > > > commit c98f874233428d7e6ba83def7842fd703ac0ddf1 > > Author: James Van Artsdalen > > Date: Sun Feb 9 13:28:48 1992 + > > > > Initial

[PATCH] x86: Skip if the mode size is smaller than its natural size

2025-04-30 Thread H.J. Lu
When generating a SUBREG from V16QI to V2HF, validate_subreg fails since the V2HF size (4 bytes) is smaller than its natural size (word size). Update remove_redundant_vector_load to skip if the mode size is smaller than its natural size. gcc/ PR target/120036 * config/i386/i386-features.cc (remov

[PUSHED] vectorizer: Fix riscv build [PR120042]

2025-04-30 Thread Andrew Pinski
r15-9859-ga6cfde60d8c added a call to dominated_by_p to tree-vectorizer.h but dominance.h is not always included; and you get a build failure on riscv building riscv-vector-costs.cc. Let's add the include of dominance.h to tree-vectorizer.h Pushed as obvious after builds for riscv and x86_64. g

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

2025-04-30 Thread Joseph Myers
On Tue, 29 Apr 2025, Christopher Bazley wrote: > 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.

Re: [PATCH] x86: Remove SSE_FIRST_REG from ix86_class_likely_spilled_p

2025-04-30 Thread H.J. Lu
On Wed, Apr 30, 2025 at 8:12 PM Uros Bizjak wrote: > > On Tue, Apr 29, 2025 at 11:40 PM H.J. Lu wrote: > > > > 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 bee

Re: [PATCH] x86: Remove BREG from ix86_class_likely_spilled_p

2025-04-30 Thread H.J. Lu
On Wed, Apr 30, 2025 at 7:37 PM Uros Bizjak wrote: > > On Tue, Apr 29, 2025 at 11:40 PM H.J. Lu wrote: > > > > 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,}'" > > > >

[pushed: r16-315] prime-paths.cc: remove redundant semicolons

2025-04-30 Thread David Malcolm
Fixes a couple of pedantic warnings. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r16-315-g49d2c6ced2c894. gcc/ChangeLog: * prime-paths.cc (limit_checked_add): Remove redundant trailing ';'. (enters_through_p): Likewise. --- gcc/prime-

[pushed: r16-314] sarif output: introduce sarif_serialization_format

2025-04-30 Thread David Malcolm
The SARIF 2.1.0 spec says that although a "SARIF log file SHALL contain a serialization of the SARIF object model into the JSON format ... in the future, other serializations might be defined." (§3.1) I've been experimenting with alternative serializations of SARIF (CBOR and JSON5 for now). To he

[pushed: r16-313] analyzer: add more test coverage for sprintf

2025-04-30 Thread David Malcolm
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r16-313-g8c80fc106482dd. gcc/testsuite/ChangeLog: PR analyzer/107017 * c-c++-common/analyzer/sprintf-3.c: New test, covering use of sprintf with specific format strings. Doesn't yet find prob

[pushed: r16-312] analyzer: avoid saying "'0' is NULL"

2025-04-30 Thread David Malcolm
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r16-312-g039ba6580f5328. gcc/analyzer/ChangeLog: * sm-malloc.cc (malloc_diagnostic::describe_state_change): Tweak the "EXPR is NULL" message for the case where EXPR is a null pointer. gcc/tes

Re: [PATCH] c: Suppress -Wdeprecated-non-prototype warnings for builtins

2025-04-30 Thread Joseph Myers
On Sat, 26 Apr 2025, Florian Weimer wrote: > Builtins defined with BT_FN_INT_VAR etc. show as functions without > a prototype and trigger the warning. > > gcc/c/ > > PR c/119950 > * c-typeck.cc (convert_arguments): Check for built-in > function declaration before warning. > >

Re: [PATCH 3/5] ipa: Dump cgraph_node UID instead of order into ipa-clones dump file

2025-04-30 Thread Martin Jambor
Hi, On Wed, Apr 30 2025, Michal Jires wrote: > On Mon, 2025-04-28 at 16:10:58 +0200, Martin Jambor wrote: >> Hi, >> >> starting with GCC 15 the order is not unique for any symtab_nodes but >> m_uid is, I believe we ought to dump the latter in the ipa-clones dump, >> if only so that people can rel

Re: Patch ping (Re: [PATCH] combine: Special case set_noop_p in two spots)

2025-04-30 Thread Jeff Law
On 4/28/25 1:26 AM, Jakub Jelinek wrote: On Fri, Mar 28, 2025 at 12:20:18PM +0100, Jakub Jelinek wrote: Here is the incremental patch I was talking about. For noop sets, we don't need to test much, they can go to i2 unless that would violate i3 JUMP condition. With this the try_combine on th

Re: [PATCH v1][GCC16-Stage-1] RISC-V: Remove unnecessary frm restore volatile define_insn

2025-04-30 Thread Vineet Gupta
Hi Pan, On 4/27/25 18:33, Li, Pan2 wrote: > Kindly ping. Sorry this got backed up as I'm working on FRM overhaul - if this is not super urgent can you please wait for a few weeks for my work to be posted. If you prefer this go in still, fine by me as well. Thx, -Vineet > > Pan > > -Origina

[PATCH] OpenMP: need_device_ptr and need_device_addr support for adjust_args

2025-04-30 Thread Sandra Loosemore
The attached patch adds some more missing pieces of support for the OpenMP "declare variant" directive -- handling for the "need_device_ptr" and "need_device_addr" modifiers to the "adjust_args" clause. It depends on the patch waffl3x posted last week here: https://gcc.gnu.org/pipermail/gcc-p

Re: [PATCH 3/5] ipa: Dump cgraph_node UID instead of order into ipa-clones dump file

2025-04-30 Thread Michal Jires
On Mon, 2025-04-28 at 16:10:58 +0200, Martin Jambor wrote: > Hi, > > starting with GCC 15 the order is not unique for any symtab_nodes but > m_uid is, I believe we ought to dump the latter in the ipa-clones dump, > if only so that people can reliably match entries about new clones to > those about

[PATCH v3 5/6] doc: document btf_type_tag and btf_decl_tag attributes

2025-04-30 Thread David Faust
gcc/ * doc/extend.texi (Common Function Attributes) (Common Variable Attributes): Document btf_decl_tag attribute. (Common Type Attributes): Document btf_type_tag attribute. --- gcc/doc/extend.texi | 79 + 1 file changed, 79 inser

[PATCH v3 4/6] btf: generate and output DECL_TAG and TYPE_TAG records

2025-04-30 Thread David Faust
Support the btf_decl_tag and btf_type_tag attributes in BTF by creating and emitting BTF_KIND_DECL_TAG and BTF_KIND_TYPE_TAG records, respectively, for them. Some care is required when -gprune-btf is in effect to avoid emitting decl or type tags for declarations or types which have been pruned and

[PATCH v3 3/6] ctf: translate annotation DIEs to internal ctf

2025-04-30 Thread David Faust
Translate DW_TAG_GNU_annotation DIEs created for C attributes btf_decl_tag and btf_type_tag into an in-memory representation in the CTF/BTF container. They will be output in BTF as BTF_KIND_DECL_TAG and BTF_KIND_TYPE_TAG records. The new CTF kinds used to represent these annotations, CTF_K_DECL_T

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

2025-04-30 Thread David Faust
[v2: https://gcc.gnu.org/pipermail/gcc-patches/2025-February/675241.html Changs from v2: - Change BTF format to match what is currently in use by clang, pahole and the linux kernel. The format in prior versions of this series was a new format meant to address issues with the existing one.

[PATCH v3 2/6] dwarf: create annotation DIEs for btf tags

2025-04-30 Thread David Faust
The btf_decl_tag and btf_type_tag attributes provide a means to annotate declarations and types respectively with arbitrary user provided strings. These strings are recorded in debug information for post-compilation uses, and despite the name they are meant to be recorded in DWARF as well as BTF.

[PATCH v3 6/6] bpf: add tests for CO-RE and BTF tag interaction

2025-04-30 Thread David Faust
Add a couple of tests to ensure that BTF type/decl tags do not interfere with generation of BPF CO-RE relocations. gcc/testsuite/ * gcc.target/bpf/core-btf-tag-1.c: New test. * gcc.target/bpf/core-btf-tag-2.c: New test. --- gcc/testsuite/gcc.target/bpf/core-btf-tag-1.c | 23 ++

[PATCH v3 1/6] c-family: add btf_type_tag and btf_decl_tag attributes

2025-04-30 Thread David Faust
Add two new c-family attributes, "btf_type_tag" and "btf_decl_tag" along with a simple shared handler for them. gcc/c-family/ * c-attribs.cc (c_common_attribute_table): Add btf_decl_tag and btf_type_tag attributes. (handle_btf_tag_attribute): New handler for both new attrib

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

2025-04-30 Thread Andrew MacLeod
On 4/30/25 02:56, Richard Biener wrote: 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/1

Re: [PATCH RFA (fold)] c++: remove TREE_STATIC from constexpr heap vars [PR119162]

2025-04-30 Thread Jakub Jelinek
On Mon, Apr 21, 2025 at 04:39:55PM -0400, Jason Merrill wrote: > Tested x86_64-pc-linux-gnu, OK for trunk? > > -- 8< -- > > While working on PR119162 it occurred to me that it would be simpler to > detect the problem of a value referring to a heap allocation if we stopped > setting TREE_STATIC on

[pushed] testsuite: Force -mcmodel=small for gcc.target/aarch64/pr115258.c

2025-04-30 Thread Richard Sandiford
The test implicitly assumed the default code model and so failed for -mcmodel=tiny. Tested on aarch64-linux-gnu & pushed to trunk, gcc-15 and gcc-14. Richard gcc/testsuite/ * gcc.target/aarch64/pr115258.c: Add -mcmodel=small. --- gcc/testsuite/gcc.target/aarch64/pr115258.c | 2 +- 1 fi

Re: [PATCH RFA (fold)] c++: remove TREE_STATIC from constexpr heap vars [PR119162]

2025-04-30 Thread Jason Merrill
On 4/21/25 4:39 PM, Jason Merrill wrote: Tested x86_64-pc-linux-gnu, OK for trunk? Ping. -- 8< -- While working on PR119162 it occurred to me that it would be simpler to detect the problem of a value referring to a heap allocation if we stopped setting TREE_STATIC on them so they naturally a

Re: [PATCH] c++/modules: Ensure deduction guides for imported types are reachable [PR120023]

2025-04-30 Thread Jason Merrill
On 4/30/25 9:40 AM, Nathaniel Shead wrote: Tested on x86_64-pc-linux-gnu (so far just modules.exp), OK for trunk and maybe 15 if full regtest+bootstrap succeeds? OK. -- >8 -- In the linked PR, because the deduction guides depend on an imported type, we never walk the type and so never call a

Re: [PATCH] c++/modules: Fix imported CNTTPs being considered non-constant [PR119938]

2025-04-30 Thread Jason Merrill
On 4/25/25 8:56 AM, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk/15? OK. -- >8 -- When importing a CNTTP object, since r15-3031-g0b7904e274fbd6 we shortcut the processing of the generated NTTP so that we don't attempt to recursively load pendings. H

Re: [PATCH v2] c++: Fix OpenMP support with C++20 modules [PR119864]

2025-04-30 Thread Jason Merrill
On 4/28/25 7:06 AM, Nathaniel Shead wrote: On Thu, Apr 24, 2025 at 12:06:52PM -0400, Jason Merrill wrote: On 4/22/25 4:48 PM, Jason Merrill wrote: On 4/22/25 1:21 PM, Tobias Burnus wrote: Jason Merrill wrote: On 4/22/25 11:04 AM, Tobias Burnus wrote: The question is why does this code trigge

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

2025-04-30 Thread Jason Merrill
On 4/29/25 3:59 AM, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu (so far just modules.exp), OK for trunk and 15 if full regtest succeeds? OK. -- >8 -- In r15-9136-g0210bedf481a9f we started erroring for inline variables that exposed TU-local entities in their defi

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

2025-04-30 Thread Jason Merrill
On 4/29/25 8:50 AM, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk/15/14? OK. -- >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

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

2025-04-30 Thread Richard Sandiford
Alice Carlotti writes: > On Wed, Apr 30, 2025 at 01:29:25PM +0100, Richard Sandiford wrote: >> Alice Carlotti writes: >> > 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 qu

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

2025-04-30 Thread Alice Carlotti
On Wed, Apr 30, 2025 at 01:29:25PM +0100, Richard Sandiford wrote: > Alice Carlotti writes: > > 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 t

Re: [PATCH] RISC-V: Implment H modifier for printing the next register name

2025-04-30 Thread Jeff Law
On 4/27/25 1:28 AM, Jin Ma wrote: For RV32 inline assembly, when handling 64-bit integer data, it is often necessary to process the lower and upper 32 bits separately. Unfortunately, we can only output the current register name (lower 32 bits) but not the next register name (upper 32 bits). T

Re: [PATCH] libstdc++: Preserve the argument type in basic_format_args [PR119246]

2025-04-30 Thread Tomasz Kaminski
On Wed, Apr 30, 2025 at 3:09 PM Tomasz Kaminski wrote: > > > On Wed, Apr 30, 2025 at 1:26 PM Tomasz Kamiński > wrote: > >> This commits adjust the way how the arguments are stored in the _Arg_value >> (and thus basic_format_args), by preserving the types of fixed width >> floating-point types, t

[PATCH] c++/modules: Ensure deduction guides for imported types are reachable [PR120023]

2025-04-30 Thread Nathaniel Shead
Tested on x86_64-pc-linux-gnu (so far just modules.exp), OK for trunk and maybe 15 if full regtest+bootstrap succeeds? -- >8 -- In the linked PR, because the deduction guides depend on an imported type, we never walk the type and so never call add_deduction_guides. This patch ensures that we make

[PATCH 3/3] Remove non-SLP path from vectorizable_conversion

2025-04-30 Thread Richard Biener
This removes the non-SLP paths from vectorizable_conversion and in the process eliminates uses of 'ncopies' and 'STMT_VINFO_VECTYPE' from the function. Bootstrap and regtest running on x86_64-unknown-linux-gnu. * tree-vect-stmts.cc (vectorizable_conversion): Remove non-SLP paths.

[PATCH 2/3] Remove non-SLP path from vectorizable_conversion

2025-04-30 Thread Richard Biener
Prunes code from the trivial true/false conditions. * tree-vect-stmts.cc (vectorizable_conversion): --- gcc/tree-vect-stmts.cc | 63 +- 1 file changed, 13 insertions(+), 50 deletions(-) diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc i

[PATCH 1/3] Remove non-SLP path from vectorizable_conversion

2025-04-30 Thread Richard Biener
This replaces trivially to fold conditions. * tree-vect-stmts.cc (vectorizable_conversion): --- gcc/tree-vect-stmts.cc | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc index 38612a16619..cf986d030a1

[PATCH 0/3] Remove non-SLP path from vectorizable_conversion

2025-04-30 Thread Richard Biener
This is an example on how I'd like to see cleanup for SLP happening in the vectorizable_* and related functions. While this example, vectorizable_conversion, is quite straight-forward it helps to isolate errors. I've done this in 3 steps: 1) fold trivially true/false conditions based on the s

Re: [PATCH] libstdc++: Preserve the argument type in basic_format_args [PR119246]

2025-04-30 Thread Tomasz Kaminski
On Wed, Apr 30, 2025 at 1:26 PM Tomasz Kamiński wrote: > This commits adjust the way how the arguments are stored in the _Arg_value > (and thus basic_format_args), by preserving the types of fixed width > floating-point types, that were previously converted to float, double, > long double. > > Th

Re: [PATCH] libstdc++: Preserve the argument type in basic_format_args [PR119246]

2025-04-30 Thread Tomasz Kaminski
On Wed, Apr 30, 2025 at 3:06 PM Jonathan Wakely wrote: > On Wed, 30 Apr 2025 at 13:54, Tomasz Kaminski wrote: > > > > > > > > On Wed, Apr 30, 2025 at 1:26 PM Tomasz Kamiński > wrote: > >> > >> This commits adjust the way how the arguments are stored in the > _Arg_value > >> (and thus basic_form

Re: [PATCH] libstdc++: Preserve the argument type in basic_format_args [PR119246]

2025-04-30 Thread Jonathan Wakely
On Wed, 30 Apr 2025 at 13:54, Tomasz Kaminski wrote: > > > > On Wed, Apr 30, 2025 at 1:26 PM Tomasz Kamiński wrote: >> >> This commits adjust the way how the arguments are stored in the _Arg_value >> (and thus basic_format_args), by preserving the types of fixed width >> floating-point types, tha

Re: [PATCH] libgcc: Cleanup HWCAP defines in cpuinfo.c

2025-04-30 Thread Richard Sandiford
Wilco Dijkstra writes: > Cleanup HWCAP defines - rather than including hwcap.h and then repeating it > using > #ifndef, just define the HWCAPs we need exactly as in hwcap.h. > > libgcc: > * config/aarch64/cpuinfo.c: Cleanup HWCAP defines. Thanks for doing this. I agree it's a significan

Re: [PATCH] libstdc++: Preserve the argument type in basic_format_args [PR119246]

2025-04-30 Thread Tomasz Kaminski
On Wed, Apr 30, 2025 at 1:26 PM Tomasz Kamiński wrote: > This commits adjust the way how the arguments are stored in the _Arg_value > (and thus basic_format_args), by preserving the types of fixed width > floating-point types, that were previously converted to float, double, > long double. > > Th

Revert 51ba233fe2db562390a6e0a3618420889761bc77

2025-04-30 Thread Richard Biener
I accidentially pushed the wrong commit, promptly reverted. Richard.

Re: [PATCH] libgcc: Update FMV features to latest ACLE spec 2024Q4

2025-04-30 Thread Richard Sandiford
Wilco Dijkstra writes: > Update FMV features to latest ACLE spec of 2024Q4 - several features have > been removed > or merged. Add FMV support for CSSC and MOPS. Preserve the ordering in enum > CPUFeatures. > > gcc: > * common/config/aarch64/cpuinfo.h: Remove unused features, add > FE

[RFC][GCC16 stage1][PATCH v3 3/3] Use the counted_by attribute of pointers in array bound checker.

2025-04-30 Thread Qing Zhao
Current array bound checker only instruments ARRAY_REF, and the INDEX information is the 2nd operand of the ARRAY_REF. When extending the array bound checker to pointer references with counted_by attributes, the hardest part is to get the INDEX of the corresponding array ref from the offset comput

[GCC16 stage1][PATCH v3 2/3] Convert a pointer reference with counted_by attribute to .ACCESS_WITH_SIZE and use it in builtinin-object-size.

2025-04-30 Thread Qing Zhao
gcc/c/ChangeLog: * c-typeck.cc (build_counted_by_ref): Handle pointers with counted_by. (build_access_with_size_for_counted_by): Likewise. gcc/ChangeLog: * tree-object-size.cc (access_with_size_object_size): Handle pointers with counted_by. (collect_object

[GCC16 stage1][PATCH v3 0/3] extend "counted_by" attribute to pointer fields of structures

2025-04-30 Thread Qing Zhao
Hi, This is the 3rd version of the patch set to extend "counted_by" attribute to pointer fields of structures. compared to the 2nd version: https://gcc.gnu.org/pipermail/gcc-patches/2025-April/681727.html https://gcc.gnu.org/pipermail/gcc-patches/2025-April/681728.html https://gcc.gnu.org/piper

[GCC16 stage1][PATCH v3 1/3] Extend "counted_by" attribute to pointer fields of structures.

2025-04-30 Thread Qing Zhao
For example: struct PP { size_t count2; char other1; char *array2 __attribute__ ((counted_by (count2))); int other2; } *pp; specifies that the "array2" is an array that is pointed by the pointer field, and its number of elements is given by the field "count2" in the same structure. gcc/c-

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

2025-04-30 Thread Jonathan Wakely
On Wed, 30 Apr 2025 at 12:12, Tomasz Kaminski wrote: > > > > On Tue, Apr 29, 2025 at 10:11 PM Jonathan Wakely wrote: >> >> 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 _GLIBCX

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

2025-04-30 Thread Richard Sandiford
Alice Carlotti writes: > 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 leas

[PATCH] libgcc: Cleanup HWCAP defines in cpuinfo.c

2025-04-30 Thread Wilco Dijkstra
Cleanup HWCAP defines - rather than including hwcap.h and then repeating it using #ifndef, just define the HWCAPs we need exactly as in hwcap.h. libgcc: * config/aarch64/cpuinfo.c: Cleanup HWCAP defines. --- diff --git a/libgcc/config/aarch64/cpuinfo.c b/libgcc/config/aarch64/cpuinfo.c

[PATCH v6 0/4] Implement extents from the mdspan header.

2025-04-30 Thread Luc Grosheintz
This is the sixth interation and replaces: https://gcc.gnu.org/pipermail/libstdc++/2025-April/061190.html Changes since v5: * Removed superfluous braces. * Fixed std.cc.in * Fixed Copyright statement. Any layout related code has been removed from this patch series. Luc Grosheintz (4): libstdc+

[PATCH v6 3/4] libstdc++: Implement std::extents [PR107761].

2025-04-30 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 v6 4/4] libstdc++: Add tests for std::extents.

2025-04-30 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 v6 2/4] libstdc++: Add header mdspan to the build-system.

2025-04-30 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 v6 1/4] libstdc++: Setup internal FTM for mdspan.

2025-04-30 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] ipa/120006 - wrong code with IPA PTA

2025-04-30 Thread Richard Biener
When PTA gets support for special-handling more builtins in find_func_aliases the corresponding code in find_func_clobbers needs updating as well since for unhandled cases it assumes the former will populate ESCAPED accordingly. The following fixes a few omissions, the testcase runs into the missi

Re: [PATCH] x86: Remove SSE_FIRST_REG from ix86_class_likely_spilled_p

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

[PATCH] libgcc: Update FMV features to latest ACLE spec 2024Q4

2025-04-30 Thread Wilco Dijkstra
Update FMV features to latest ACLE spec of 2024Q4 - several features have been removed or merged. Add FMV support for CSSC and MOPS. Preserve the ordering in enum CPUFeatures. gcc: * common/config/aarch64/cpuinfo.h: Remove unused features, add FEAT_CSSC and FEAT_MOPS.

Re: [PATCH] x86: Update TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P

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

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

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

Re: [PATCH] x86: Remove BREG from ix86_class_likely_spilled_p

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

[PATCH] tree-optimization/120003 - missed jump threading

2025-04-30 Thread Richard Biener
The following allows the entry and exit block of a jump thread path to be equal, which can easily happen when there isn't a forwarder on the interesting edge for an FSM thread conditional. We just don't want to enlarge the path from such a block. Bootstrapped and tested on x86_64-unknown-linux-gn

[PATCH] libstdc++: Preserve the argument type in basic_format_args [PR119246]

2025-04-30 Thread Tomasz Kamiński
This commits adjust the way how the arguments are stored in the _Arg_value (and thus basic_format_args), by preserving the types of fixed width floating-point types, that were previously converted to float, double, long double. The _Arg_value union now contains alternatives with std::bfloat16_t, s

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

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

[Ada] Fix PR ada/112958

2025-04-30 Thread Eric Botcazou
This fixes the long-standing build failure of GNAT for x86/FreeBSD. Applied on all active branches. 2025-04-30 Eric Botcazou PR ada/112958 * Makefile.rtl (LIBGNAT_TARGET_PAIRS) [x86 FreeBSD]: Add specific version of s-dorepr.adb. * libgnat/s-dorepr__freebsd.ad

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

2025-04-30 Thread Jonathan Wakely
On Wed, 30 Apr 2025 at 10:34, Luc Grosheintz wrote: > > > > On 4/29/25 3:11 PM, Jonathan Wakely wrote: > > 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/C

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

2025-04-30 Thread Luc Grosheintz
On 4/29/25 3:11 PM, Jonathan Wakely wrote: 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: Di

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

2025-04-30 Thread Kito Cheng
pushed to trunk On Tue, Apr 29, 2025 at 9:16 PM Kito Cheng wrote: > > 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/s

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

2025-04-30 Thread Kito Cheng
pushed to trunk On Tue, Apr 29, 2025 at 9:14 PM Kito Cheng wrote: > > 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: Jiawe

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

2025-04-30 Thread Kito Cheng
pushed to the trunk :) Vineet: Feel free to drop TARGET_MODE_CONFLUENCE once you have a better solution :) On Wed, Apr 30, 2025 at 12:50 PM Robin Dapp wrote: > > > Although we already try to set the mode needed to FRM_DYN after a function > > call, > > there are still some corner cases where bo

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

2025-04-30 Thread Kito Cheng
Thanks, pushe to trunk :) On Wed, Apr 30, 2025 at 3:35 PM Jerry Zhang Jian wrote: > > 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 depen

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

2025-04-30 Thread Jonathan Wakely
On Wed, 30 Apr 2025 at 09:55, Luc Grosheintz wrote: > On 4/30/25 4:37 AM, Tomasz Kaminski wrote: > > 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: > + t

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

2025-04-30 Thread Jennifer Schmitz
> On 29 Apr 2025, at 18:21, Richard Sandiford wrote: > > External email: Use caution opening links or attachments > > > 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), >> th

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

2025-04-30 Thread Luc Grosheintz
On 4/30/25 4:37 AM, Tomasz Kaminski wrote: 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 p

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

2025-04-30 Thread Iain Sandoe
> On 30 Apr 2025, at 09:26, Richard Biener wrote: > > On Wed, Apr 30, 2025 at 9:03 AM Andrew Pinski wrote: >> >> On Tue, Apr 29, 2025 at 11:49 PM Richard Biener >> wrote: >>> >>> On Tue, Apr 29, 2025 at 4:25 PM Andrew Pinski >>> wrote: When we have an empty function, things ca

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

2025-04-30 Thread Richard Biener
On Wed, Apr 30, 2025 at 9:03 AM Andrew Pinski wrote: > > On Tue, Apr 29, 2025 at 11:49 PM Richard Biener > wrote: > > > > 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

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

2025-04-30 Thread Dongyan Chen
The patch has been modified as follows: This patch support ssnpm, smnpm, smmpm, sspm and supm extensions[1]. To enable GCC to recognize and process ssnpm, smnpm, smmpm, sspm and supm extensions correctly at compile time. [1]https://github.com/riscv/riscv-j-extension/blob/master/zjpm/instructio

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

2025-04-30 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

[patch, avr, applied] PR119989: Missing clobbers in xload__libgcc

2025-04-30 Thread Georg-Johann Lay
libgcc's __xload_1...4 is clobbering Z (and also R21 is some cases), but avr.md had clobbers of respective GPRs only up to reload. Outcome was that code reading from the same __memx address twice could be wrong. This patch adds respective clobbers. Applied as obvious. Johann -- AVR: target/11

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

2025-04-30 Thread Andrew Pinski
On Tue, Apr 29, 2025 at 11:49 PM Richard Biener wrote: > > 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