[PATCH] bitintlower: Fix interaction of gimple_assign_copy_p stmts vs. has_single_use [PR119808]

2025-04-15 Thread Jakub Jelinek
Hi! The following testcase is miscompiled, because we emit a CLOBBER in a place where it shouldn't be emitted. Before lowering we have: b_5 = 0; b.0_6 = b_5; b.1_1 = (unsigned _BitInt(129)) b.0_6; ... = b_5; The bitint coalescing assigns the same partition/underlying variable for both b_5

Re: [PATCH] [testsuite] [ppc] compile [PR112822] with -mvsx

2025-04-15 Thread Alexandre Oliva
On Apr 15, 2025, Peter Bergner wrote: > On 4/14/25 11:30 PM, Alexandre Oliva wrote: >> On Apr 14, 2025, Peter Bergner wrote: >> >>> This is an architecture independent test case, so I'm surprised this >>> doesn't FAIL on non-powerpc targets since they don't know anything >>> about altivec. >>

[committed] testsuite: Add testcase for already fixed PR [PR116093]

2025-04-15 Thread Jakub Jelinek
Hi! This testcase got fixed with r15-9397 PR119722 fix. Tested on x86_64-linux -m32/-m64 with vanilla trunk as well as with r15-9397 fix reverted (where it FAILs), committed to trunk as obvious. 2025-04-16 Jakub Jelinek PR tree-optimization/116093 * gcc.dg/bitint-122.c: New t

Re: [PATCH] [testsuite] [ppc] disable -mpowerpc64 for various ilp32 asm-out checks

2025-04-15 Thread Alexandre Oliva
On Apr 15, 2025, Peter Bergner wrote: > On 4/15/25 9:36 AM, Peter Bergner wrote: >> So what ABI does powerpc-elf use and what does it mandate? That's not for me to decide, but to me the patch that introduced OS_MISSING_POWERPC64 and the PR106680 coversation suggests that enabling -mpowerpc64 wit

Re:[committed] [PATCH] AArch64: Fix operands order in vec_extract expander

2025-04-15 Thread Tejas Belagod
On 4/15/25 1:56 PM, Richard Sandiford wrote: Tejas Belagod writes: The operand order to gen_vcond_mask call in the vec_extract pattern is wrong. Fix the order where predicate is operand 3. Tested and bootstrapped on aarch64-linux-gnu. OK for trunk? gcc/ChangeLog * config/aarch64/aarc

Re: [PATCH] [testsuite] [ppc] pr87600, pr89313: test for __PPC__ as well

2025-04-15 Thread Alexandre Oliva
On Apr 14, 2025, Peter Bergner wrote: > On 4/11/25 1:03 PM, Alexandre Oliva wrote: >> gcc.dg/pr87600.h and gcc.dg/pr89313.c test for __powerpc__ and >> __POWERPC__ to choose ppc register names, but ppc-elf defines neither; >> it defines __PPC__, so test for that as well. > Is there a reason why

Re: [PATCH] [testsuite] [ppc] compile [PR112822] with -mvsx

2025-04-15 Thread Alexandre Oliva
On Apr 14, 2025, Peter Bergner wrote: > diff --git a/gcc/testsuite/g++.dg/pr112822.C b/gcc/testsuite/g++.dg/pr112822.C > -typedef __attribute__((altivec(vector__))) double co; > +typedef double co __attribute__ ((vector_size (16))); FWIW, I've tested this change on gcc-14 powerpc-elf and I confi

Re: [PATCH v2] riscv: Fix incorrect gnu property alignment on rv32

2025-04-15 Thread Kito Cheng
Thanks, committed to trunk :) On Fri, Apr 11, 2025 at 12:27 PM Jesse Huang wrote: > > Codegen is incorrectly emitting a ".p2align 3" that coerces the > alignment of the .note.gnu.property section from 4 to 8 on rv32. > > 2025-04-11 Jesse Huang > > gcc/ChangeLog > > * config/riscv/riscv

Re: [PATCH] RISC-V: Put jump table in text for large code model

2025-04-15 Thread Kito Cheng
committed :) On Mon, Apr 14, 2025 at 6:01 PM Kito Cheng wrote: > > This patch will be committed this week if CI passes and not strong > objections since it's bug to large code model, also change is small > > On Mon, Apr 14, 2025 at 6:00 PM Kito Cheng wrote: > > > > Large code model assume the da

Re: [PATCH STAGE 4] aarch64: Disable sysreg feature gating

2025-04-15 Thread Richard Sandiford
Alice Carlotti writes: > This applies to the sysreg read/write intrinsics __arm_[wr]sr*. It does > not depend on changes to Binutils, because GCC converts recognised > sysreg names to an encoding based form, which is already ungated in Binutils. > > We have, however, agreed to make an equivalent

[PATCH v2] c: Fully fold each parameter for call to .ACCESS_WITH_SIZE [PR119717]

2025-04-15 Thread Qing Zhao
This is the 2nd version of the patch, the change is to replace "FALSE" with "false" per Marek's comments. C_MAYBE_CONST_EXPR is a C FE operator that will be removed by c_fully_fold. In c_fully_fold, it assumes that operands of function calls have already been folded. However, when we build call to

Re: [RFC] [C]New syntax for the argument of counted_by attribute for C language

2025-04-15 Thread Martin Uecker
Am Dienstag, dem 15.04.2025 um 14:50 +0200 schrieb Michael Matz: > Hello, ... > > struct A { > > int *buf __counted_by(len); // 'len' *must* be in the struct. > > int len; > > }; > > ... means that we would have to implement general delayed parsing for > expressions in C parsers. I have to

Re: [PATCH] [PR119765] testsuite: adjust amd64-abi-9.c to check both ms and sysv ABIs

2025-04-15 Thread NightStrike
On Tue, Apr 15, 2025 at 5:02 AM LIU Hao wrote: > > 在 2025-4-14 04:10, Peter Damianov 写道: > > diff --git a/gcc/testsuite/gcc.target/i386/amd64-abi-9.c > > b/gcc/testsuite/gcc.target/i386/amd64-abi-9.c > > index 9b2cd7e7b49..827215be3e2 100644 > > --- a/gcc/testsuite/gcc.target/i386/amd64-abi-9.c >

[PATCH][GCC14] Extend check-function-bodies to allow label and directives

2025-04-15 Thread H.J. Lu
Hi, I'd like to backport this testsuite enhancement to GCC 14 so that https://gcc.gnu.org/pipermail/gcc-patches/2025-April/680896.html can be backported to GCC 14 with testcases unchanged. H.J. --- As PR target/116174 shown, we may need to verify labels and the directive order. Extend check-f

Re: [PATCH 2/4] cfgloopmanip: Add infrastructure for scaling of multi-exit loops [PR117790]

2025-04-15 Thread Jan Hubicka
> Hi, > > gcc/ChangeLog: > > > > PR tree-optimization/117790 > > * cfgloopmanip.cc (can_flow_scale_loop_freqs_p): New. > > (flow_scale_loop_freqs): New. > > (scale_loop_freqs_with_exit_counts): New. > > (scale_loop_freqs_hold_exit_counts): New. > > (scale_loop_profile): Ref

Re: [PATCH 2/4] cfgloopmanip: Add infrastructure for scaling of multi-exit loops [PR117790]

2025-04-15 Thread Jan Hubicka
Hi, > gcc/ChangeLog: > > PR tree-optimization/117790 > * cfgloopmanip.cc (can_flow_scale_loop_freqs_p): New. > (flow_scale_loop_freqs): New. > (scale_loop_freqs_with_exit_counts): New. > (scale_loop_freqs_hold_exit_counts): New. > (scale_loop_profile): Refactor

Re: [PATCH 2/4] cfgloopmanip: Add infrastructure for scaling of multi-exit loops [PR117790]

2025-04-15 Thread Jan Hubicka
Hi, > gcc/ChangeLog: > > PR tree-optimization/117790 > * tree-vect-loop.cc (scale_profile_for_vect_loop): Use > scale_loop_profile_hold_exit_counts instead of scale_loop_profile. Drop > the exit edge parameter, since the code now handles multiple exits. > Adjust the

[PATCH] ipa-prop: Extend the tailc IPA-VRP hack to LTO [PR119614]

2025-04-15 Thread Jakub Jelinek
Hi! Here is my attempt at the PR119614 LTO fix. Of course, if Martin can come up with something cleaner, let's go with that instead. This patch just remembers when ipa_record_return_value_range was set to a singleton range with CONSTANT_CLASS_P value and propagates that value through LTO to ltran

Re: COBOL: Is anything stalled because of me?

2025-04-15 Thread Jakub Jelinek
On Tue, Apr 15, 2025 at 10:47:13AM -0500, Robert Dubner wrote: > Speaking purely casually: I thought that that COBOL would be released with > documented limited capability. "Yeah, it works on x86_64-linux and > aarch64-linux. More to come.". We knew that we didn't know how to > cross-compile

[pushed] c++: constexpr, trivial, and non-alias target [PR111075]

2025-04-15 Thread Jason Merrill
Tested the testcase fix with a Darwin cross-compiler. Regression tested x86_64-pc-linux-gnu. Applying to trunk. -- 8< -- On Darwin and other targets with !can_alias_cdtor, we instead go to maybe_thunk_ctor, which builds a thunk function that calls the general constructor. And then cp_fold tries

Re: [PATCH] x86: Update gcc.target/i386/apx-interrupt-1.c

2025-04-15 Thread Uros Bizjak
On Tue, Apr 15, 2025 at 2:23 PM H.J. Lu wrote: > > On Tue, Apr 15, 2025 at 12:45 AM Uros Bizjak wrote: > > > > On Tue, Apr 15, 2025 at 1:06 AM H.J. Lu wrote: > > > > > > ix86_add_cfa_restore_note omits the REG_CFA_RESTORE REG note for registers > > > pushed in red-zone. Since > > > > > > commit

[COMMITTED] Docs: Address -fivopts, -O0, and -Q confusion [PR71094]

2025-04-15 Thread Sandra Loosemore
There's a blurb at the top of the "Optimize Options" node telling people that most optimization options are completely disabled at -O0 and a similar blurb in the entry for -Og, but nothing at the entry for -O0. Since this is a continuing point of confusion it seems wise to duplicate the informatio

[PATCH STAGE 4] aarch64: Disable sysreg feature gating

2025-04-15 Thread Alice Carlotti
This applies to the sysreg read/write intrinsics __arm_[wr]sr*. It does not depend on changes to Binutils, because GCC converts recognised sysreg names to an encoding based form, which is already ungated in Binutils. We have, however, agreed to make an equivalent change in Binutils (which would t

[pushed] configure, Darwin: Recognise new naming for Xcode ld.

2025-04-15 Thread Iain Sandoe
Tested on i686, x86_64 and aarch64 Darwin, plus x86_64, aarch64 and powerpc64le Linux, pushed to trunk, thanks Iain --- 8 --- The latest editions of XCode have altered the identify reported by 'ld -v' (again). This means that GCC configure no longer detects the version. Fixed by adding the new

[PATCH] Fortran: pure subroutine with pure procedure as dummy [PR106948]

2025-04-15 Thread Harald Anlauf
Dear all, the testcase in the PR shows a case where the pureness of a function is not properly determined, even though the function is resolved, and its attributes clearly show that it is pure, because gfc_pure_function relies on isym or esym being set. This does not happen here, probably becaus

Re: [GCC16,RFC,V2 05/14] aarch64: add new definition for post-index stg

2025-04-15 Thread Richard Sandiford
Indu Bhagat writes: > Using post-index stg is a faster way of memory tagging/untagging. > > TBD: > - Currently generated by in the aarch64 backend. Not sure if this > is the right way to do it. > - Also not clear how to weave in the generation of stzg. Similarly to patch 4, I think we sh

RE: COBOL: Is anything stalled because of me?

2025-04-15 Thread Robert Dubner
> -Original Message- > From: Jakub Jelinek > Sent: Tuesday, April 15, 2025 13:54 > To: Robert Dubner > Cc: 'Jeff Law' ; gcc-patches@gcc.gnu.org; 'James K. > Lowden' > Subject: Re: COBOL: Is anything stalled because of me? > > On Tue, Apr 15, 2025 at 10:47:13AM -0500, Robert Dubner wr

Re: [GCC16,RFC,V2 04/14] aarch64: add new definition for post-index st2g

2025-04-15 Thread Richard Sandiford
Indu Bhagat writes: > Using post-index st2g is a faster way of memory tagging/untagging. > Because a post-index 'st2g tag, [addr], #32' is equivalent to: >stg tag, addr, #0 >stg tag, addr, #16 >add addr, addr, #32 > > TBD: > - Currently generated by in the aarch64 backend. Not sure

Re: [PATCH] c++: Properly mangle CONST_DECL without a INTEGER_CST value [PR116511]

2025-04-15 Thread Simon Martin
Hi Jason, On Thu Apr 10, 2025 at 10:42 PM CEST, Jason Merrill wrote: > On 9/6/24 7:15 AM, Simon Martin wrote: >> We ICE upon the following *valid* code when mangling the requires >> clause >> >> === cut here === >> template struct s1 { >>enum { e1 = 1 }; >> }; >> template struct s2 { >>

Re: [PATCH v2] c: Fully fold each parameter for call to .ACCESS_WITH_SIZE [PR119717]

2025-04-15 Thread Marek Polacek
On Tue, Apr 15, 2025 at 06:46:26PM +, Qing Zhao wrote: > This is the 2nd version of the patch, the change is to replace "FALSE" with > "false" per Marek's comments. > > C_MAYBE_CONST_EXPR is a C FE operator that will be removed by c_fully_fold. > In c_fully_fold, it assumes that operands of fu

Re: [PATCH] OpenMP: omp.h omp::allocator C++ Allocator interface

2025-04-15 Thread Tobias Burnus
Alex wrote: Tested on x86_64-pc-linux-gnu, this is only a library addition (and a few tests) so it shouldn't cause any major impacts. I also tested libgomp C to ensure the conditional compile was working. Namely, the change is only to omp.h(.in) - effective for __cplusplus >= 201103L. Note th

Re: [PATCH] discriminators: Fix assigning discriminators on edge [PR113546]

2025-04-15 Thread Andrew Pinski
On Sun, Mar 16, 2025 at 11:43 AM Jeff Law wrote: > > > > On 3/15/25 9:01 PM, Andrew Pinski wrote: > > The problem here is there was a compare debug since the discriminators > > would still take into account debug statements. For the edge we would look > > at the first statement after the labels an

Re: [RFC] [C]New syntax for the argument of counted_by attribute for C language

2025-04-15 Thread Kees Cook
On Tue, Apr 15, 2025 at 09:07:44PM +0200, Martin Uecker wrote: > Am Dienstag, dem 15.04.2025 um 14:50 +0200 schrieb Michael Matz: > > Hello, > ... > > > > struct A { > > > int *buf __counted_by(len); // 'len' *must* be in the struct. > > > int len; > > > }; > > > > ... means that we would hav

Re: [PATCH v2] c: Fully fold each parameter for call to .ACCESS_WITH_SIZE [PR119717]

2025-04-15 Thread Qing Zhao
Thanks. Pushed to trunk. Qing > On Apr 15, 2025, at 14:56, Marek Polacek wrote: > > On Tue, Apr 15, 2025 at 06:46:26PM +, Qing Zhao wrote: >> This is the 2nd version of the patch, the change is to replace "FALSE" with >> "false" per Marek's comments. >> >> C_MAYBE_CONST_EXPR is a C FE ope

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

2025-04-15 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 commit uses direct initialization to perform the conversion,

Re: [PATCH] [PR119765] testsuite: adjust amd64-abi-9.c to check both ms and sysv ABIs

2025-04-15 Thread LIU Hao
在 2025-4-14 04:10, Peter Damianov 写道: diff --git a/gcc/testsuite/gcc.target/i386/amd64-abi-9.c b/gcc/testsuite/gcc.target/i386/amd64-abi-9.c index 9b2cd7e7b49..827215be3e2 100644 --- a/gcc/testsuite/gcc.target/i386/amd64-abi-9.c +++ b/gcc/testsuite/gcc.target/i386/amd64-abi-9.c @@ -1,18 +1,46 @@

Re: [PATCH] c++: Prune lambda captures from more places [PR119755]

2025-04-15 Thread Jason Merrill
On 4/15/25 2:56 AM, Nathaniel Shead wrote: On Mon, Apr 14, 2025 at 05:33:05PM -0400, Jason Merrill wrote: On 4/13/25 6:32 AM, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? -- >8 -- Currently, pruned lambda captures are still leftover in the function's

[PATCH v4 18/20] Fix FMV return type ambiguation

2025-04-15 Thread Alfie Richards
Add logic for the case of two FMV annotated functions with identical signature other than the return type. Previously this was ignored, this changes the behavior to emit a diagnostic. gcc/cp/ChangeLog: PR c++/119498 * decl.cc (duplicate_decls): Change logic to not always exclude F

[committed] libstdc++: Do not define __cpp_lib_ranges_iota in

2025-04-15 Thread Jonathan Wakely
In r14-7153-gadbc46942aee75 we removed a duplicate definition of __glibcxx_want_range_iota from , but __cpp_lib_ranges_iota should be defined in at all. libstdc++-v3/ChangeLog: * include/std/ranges (__glibcxx_want_ranges_iota): Do not define. --- Tested x86_64-linux. Pushed to t

[committed] libstdc++: Do not declare namespace ranges in unconditionally

2025-04-15 Thread Jonathan Wakely
Move namespace ranges inside the feature test macro guard, because 'ranges' is not a reserved name before C++20. libstdc++-v3/ChangeLog: * include/std/numeric (ranges): Only declare namespace for C++23 and later. (ranges::iota_result): Fix indentation. * testsuite/

[PUSHED/14 6/6] testcase: Add testcase for already fixed PR [PR118476]

2025-04-15 Thread Andrew Pinski
This testcase was fixed by r15-3052-gc7b76a076cb2c6ded but is a testcase that failed in a different fashion and a much older failure than the one added with r15-3052. Pushed as obvious after a quick test. PR tree-optimization/118476 gcc/testsuite/ChangeLog: * gcc.dg/torture/pr11

Re: [PATCH v2] libstdc++: Implement formatter for ranges and range_formatter [PR109162]

2025-04-15 Thread Jonathan Wakely
A few spelling and grammar fixes, and whitespace tweaks, but the only significant thing is to qualify some calls to prevent ADL ... On 14/04/25 16:13 +0200, Tomasz Kamiński wrote: This patch implements formatter specialization for input_ranges and range_formatter class form P2286R8, as adjusted

Re: [PATCH] Locality cloning pass (was: Introduce -flto-partition=locality)

2025-04-15 Thread Kyrylo Tkachov
> On 15 Apr 2025, at 15:42, Richard Biener wrote: > > On Mon, Apr 14, 2025 at 3:11 PM Kyrylo Tkachov wrote: >> >> Hi Honza, >> >>> On 13 Apr 2025, at 23:19, Jan Hubicka wrote: >>> +@opindex fipa-reorder-for-locality +@item -fipa-reorder-for-locality +Group call chains close

COBOL: Is anything stalled because of me?

2025-04-15 Thread Robert Dubner
Speaking purely casually: I thought that that COBOL would be released with documented limited capability. "Yeah, it works on x86_64-linux and aarch64-linux. More to come.". We knew that we didn't know how to cross-compile, and we knew that other platforms would have to come, in time. It nev

Re: Mark const parameters passed by invisible reference as readonly in the function body

2025-04-15 Thread Jason Merrill
On 3/30/25 6:12 PM, Jan Hubicka wrote: Hi, I noticed that this patch got forgotten and I think it may be useful to solve this next stage 1. cp_apply_type_quals_to_decl drops 'const' if the type has mutable members. Unfortunately TREE_READONLY on the PARM_DECL isn't helpful in the case of an inv

Re: [PATCH] c: Fully fold each parameter for call to .ACCESS_WITH_SIZE [PR119717]

2025-04-15 Thread Marek Polacek
On Mon, Apr 14, 2025 at 08:28:55PM +, Qing Zhao wrote: > C_MAYBE_CONST_EXPR is a C FE operator that will be removed by c_fully_fold. > In c_fully_fold, it assumes that operands of function calls have already > been folded. However, when we build call to .ACCESS_WITH_SIZE, all its > operands are

[PATCH] x86: Update gcc.target/i386/apx-interrupt-1.c

2025-04-15 Thread H.J. Lu
ix86_add_cfa_restore_note omits the REG_CFA_RESTORE REG note for registers pushed in red-zone. Since commit 0a074b8c7e79f9d9359d044f1499b0a9ce9d2801 Author: H.J. Lu Date: Sun Apr 13 12:20:42 2025 -0700 APX: Don't use red-zone with 32 GPRs and no caller-saved registers disabled red-zone,

[PATCH v4] libstdc++: Implement formatter for ranges and range_formatter [PR109162]

2025-04-15 Thread Tomasz Kamiński
This patch implements formatter specialization for input_ranges and range_formatter class from P2286R8, as adjusted by P2585R1. The formatter for pair/tuple is not yet provided, making maps not formattable. This introduces an new _M_format_range member to internal __formatter_str, that formats ran

RE: [PATCH]middle-end: Fix incorrect codegen with PFA and VLS [PR119351]

2025-04-15 Thread Tamar Christina
> -Original Message- > From: Richard Biener > Sent: Tuesday, April 15, 2025 12:50 PM > To: Tamar Christina > Cc: Richard Sandiford ; gcc-patches@gcc.gnu.org; > nd > Subject: RE: [PATCH]middle-end: Fix incorrect codegen with PFA and VLS > [PR119351] > > On Tue, 15 Apr 2025, Tamar Christi

[PATCH v4 08/20] Add get_clone_versions and get_version functions.

2025-04-15 Thread Alfie Richards
This is a reimplementation of get_target_clone_attr_len, get_attr_str, and separate_attrs using string_slice and auto_vec to make memory management and use simpler. Adds get_target_version helper function to get the target_version string from a decl. gcc/c-family/ChangeLog: * c-attribs.c

Re: [PATCH v2] RISC-V: Do not lift up vsetvl into non-transparent blocks [PR119547].

2025-04-15 Thread Jeff Law
On 4/9/25 6:08 AM, Robin Dapp wrote: Hi, when lifting up a vsetvl into a block we currently don't consider the block's transparency with respect to the vsetvl as in other parts of the pass.  This patch does not perform the lift when transparency is not guaranteed. This condition is more rest

Re: [PATCH] c++: wrong targs printed in hard satisfaction error [PR99214]

2025-04-15 Thread Jason Merrill
On 4/13/25 1:56 PM, Patrick Palka wrote: Alternatively, rather than passing the most general template + args to push_tinst_level, we can pass the partially instantiated template + innermost args via just: gcc/cp/ChangeLog: * constraint.cc (satisfy_declaration_constraints): Pass the

Re: [PATCH] c: Fully fold each parameter for call to .ACCESS_WITH_SIZE [PR119717]

2025-04-15 Thread Qing Zhao
> On Apr 14, 2025, at 16:35, Marek Polacek wrote: > > On Mon, Apr 14, 2025 at 08:28:55PM +, Qing Zhao wrote: >> C_MAYBE_CONST_EXPR is a C FE operator that will be removed by c_fully_fold. >> In c_fully_fold, it assumes that operands of function calls have already >> been folded. However, wh

Re: [PATCH] MATCH: Fix patterns of type (a != b) and (a == b) [PR117760]

2025-04-15 Thread Jeff Law
On 4/15/25 12:24 AM, Eikansh Gupta wrote: The patterns can be simplified as shown below: (a != b) & ((a|b) != 0) -> (a != b) (a != b) | ((a|b) != 0) -> ((a|b) != 0) The similar simplification can be there for (a == b). This patch adds simplification for above patterns. The forwprop pass wa

Re: [GCC16,RFC,V2 02/14] aarch64: add new define_insn for subg

2025-04-15 Thread Richard Sandiford
Hi, Indu Bhagat writes: > subg (Subtract with Tag) is an Armv8.5-A memory tagging (MTE) > instruction. It can be used to subtract an immediate value scaled by > the tag granule from the address in the source register. > > gcc/ChangeLog: > > * config/aarch64/aarch64.md (subg): New definitio

[PATCH] OpenMP: omp.h omp::allocator C++ Allocator interface

2025-04-15 Thread Alex
Tested on x86_64-pc-linux-gnu, this is only a library addition (and a few tests) so it shouldn't cause any major impacts. I also tested libgomp C to ensure the conditional compile was working. Okay for trunk? From 1ef3fe0a1f026689e64963ec9ab0b04b7e6b1bde Mon Sep 17 00:00:00 2001 From: waffl3x Da

Regenerate common.opt.urls

2025-04-15 Thread Kyrylo Tkachov
Pushing as obvious. Thanks, Kyrill Signed-off-by: Kyrylo Tkachov * common.opt.urls: Regenerate. 0001-Regenerate-common.opt.urls.patch Description: 0001-Regenerate-common.opt.urls.patch

Re: [PATCH] x86: Update gcc.target/i386/apx-interrupt-1.c

2025-04-15 Thread Uros Bizjak
On Tue, Apr 15, 2025 at 1:06 AM H.J. Lu wrote: > > ix86_add_cfa_restore_note omits the REG_CFA_RESTORE REG note for registers > pushed in red-zone. Since > > commit 0a074b8c7e79f9d9359d044f1499b0a9ce9d2801 > Author: H.J. Lu > Date: Sun Apr 13 12:20:42 2025 -0700 > > APX: Don't use red-zone

Re: [PATCH v5 2/2] i386: Enable -mnop-mcount for -fpic with PLTs

2025-04-15 Thread Uros Bizjak
On Thu, Apr 10, 2025 at 2:26 PM Ard Biesheuvel wrote: > > From: Ard Biesheuvel > > -mnop-mcount can be trivially enabled for -fPIC codegen as long as PLTs > are being used, given that the instruction encodings are identical, only > the target may resolve differently depending on how the linker de

Re: [PATCH] combine: Correct comment about combine_validate_cost

2025-04-15 Thread Richard Sandiford
Hans-Peter Nilsson writes: > Noticed while investigating a regression for cris-elf with > r15-9239-g4d7a634f6d4102 "combine: Allow 2->2 combinations, > but with a tweak [PR116398]" (to-be-reported). > > The comment was introduced when breaking out the > combine_validate_cost function, in r0-59417-

Re: [PATCH v5 1/2] i386: Prefer PLT indirection for __fentry__ calls under -fPIC

2025-04-15 Thread Uros Bizjak
On Thu, Apr 10, 2025 at 2:27 PM Ard Biesheuvel wrote: > > From: Ard Biesheuvel > > Commit bde21de1205 ("i386: Honour -mdirect-extern-access when calling > __fentry__") updated the logic that emits mcount() / __fentry__() calls > into function prologues when profiling is enabled, to avoid GOT-base

[committed v3] libstdc++: Fix std::string construction from volatile char* [PR119748]

2025-04-15 Thread Jonathan Wakely
My recent r15-9381-g648d5c26e25497 change assumes that a contiguous iterator with the correct value_type can be converted to a const charT* but that's not true for volatile charT*. The optimization should only be done if it can be converted to the right pointer type. Additionally, some generic loo

[PATCH v2 4/4] libstdc++: Add tests for std::extents.

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

2025-04-15 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] tailc: Fix up musttail calls vs. -fsanitize=thread [PR119801]

2025-04-15 Thread Jakub Jelinek
Hi! Calls with musttail attribute don't really work with -fsanitize=thread in GCC. The problem is that TSan instrumentation adds __tsan_func_entry (__builtin_return_address (0)); calls at the start of each instrumented function and __tsan_func_exit (); call at the end of those and the latter

Re: [PATCH v2 2/4] libstdc++: Add header mdspan to the build-system.

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

Re: [PATCH v2 4/4] libstdc++: Add tests for std::extents.

2025-04-15 Thread Tomasz Kaminski
On Tue, Apr 15, 2025 at 10:55 AM Luc Grosheintz wrote: > 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 integ

[PATCH v4 09/20] Add assembler_name to cgraph_function_version_info.

2025-04-15 Thread Alfie Richards
Add the assembler_name member to cgraph_function_version_info to store the base assembler name of the funciton set, before FMV mangling. This is used in later patches for refactoring FMV mangling. gcc/ChangeLog: * cgraph.cc (cgraph_node::insert_new_function_version): Record assemb

[PATCH v4 00/20] FMV refactor and ACLE compliance.

2025-04-15 Thread Alfie Richards
Hi all, Another update to this series. This patch changes the version info structure to be sorted by priority. This allows easier reasoning for optimisations and prevents having to calculate the priority of functions repeatedly. The other change is that the target_clones pass was split in two. T

[PATCH v4 02/20] Add x86 FMV symbol tests

2025-04-15 Thread Alfie Richards
From: Alice Carlotti This is for testing the x86 mangling of FMV versioned function assembly names. gcc/testsuite/ChangeLog: * g++.target/i386/mv-symbols1.C: New test. * g++.target/i386/mv-symbols2.C: New test. * g++.target/i386/mv-symbols3.C: New test. * g++.tar

[PATCH v4 17/20] Support mixing of target_clones and target_version.

2025-04-15 Thread Alfie Richards
Add support for a FMV set defined by a combination of target_clones and target_version definitions. Additionally, change is_function_default_version to consider a function declaration annotated with target_clones containing default to be a default version. Lastly, add support for the case that a

[PATCH v4 13/20] Refactor riscv target parsing to take string_slice.

2025-04-15 Thread Alfie Richards
This is a quick refactor of the riscv target processing code to take a string_slice rather than a decl. The reason for this is to enable it to work with target_clones where merging logic requires reasoning about each version string individually in the front end. This refactor primarily serves jus

[PATCH v4 04/20] Remove unnecessary `record` argument from maybe_version_functions.

2025-04-15 Thread Alfie Richards
Previously, the `record` argument in maybe_version_function allowed the call to cgraph_node::record_function_versions to be skipped. However, this was only skipped when both decls were already marked as versioned, in which case we trigger the early exit in record_function_versions instead. Therefo

[PATCH v4 20/20] Remove FMV beta warning.

2025-04-15 Thread Alfie Richards
This patch removes the warning for target_version and target_clones in aarch64 as it is now spec compliant. gcc/ChangeLog: * config/aarch64/aarch64.cc (aarch64_process_target_version_attr): Remove warning. * config/aarch64/aarch64.opt: Mark -Wno-experimental-fmv-target

[PATCH v4 19/20] Add diagnostic tests for Aarch64 FMV.

2025-04-15 Thread Alfie Richards
Add tests covering many FMV errors for Aarch64, including redeclaration, and mixing target_clones and target_versions. gcc/testsuite/ChangeLog: * g++.target/aarch64/mv-and-mvc-error1.C: New test. * g++.target/aarch64/mv-and-mvc-error2.C: New test. * g++.target/aarch64/mv-a

[PATCH v4 12/20] Refactor FMV name mangling.

2025-04-15 Thread Alfie Richards
This patch is an overhaul of how FMV name mangling works. Previously mangling logic was duplicated in several places across both target specific and independent code. This patch changes this such that all mangling is done in targetm.mangle_decl_assembler_name (including for the dispatched symbol an

[PATCH v4 11/20] Add clone_identifier function.

2025-04-15 Thread Alfie Richards
This is similar to clone_function_name and its siblings but takes an identifier tree node rather than a function declaration. This is to be used in conjunction with the identifier node stored in cgraph_function_version_info::assembler_name to mangle FMV functions in later patches. gcc/ChangeLog:

[PATCH v4 03/20] Add string_slice class.

2025-04-15 Thread Alfie Richards
The string_slice inherits from array_slice and is used to refer to a substring of an array that is memory managed elsewhere without modifying the underlying array. For example, this is useful in cases such as when needing to refer to a substring of an attribute in the syntax tree. Adds some minim

[PATCH v4 06/20] Refactor record_function_versions.

2025-04-15 Thread Alfie Richards
Renames record_function_versions to add_function_version, and make it explicit that it is adding a single version to the function structure. Additionally, change the insertion point to always maintain priority ordering of the versions. This allows for removing logic for moving the default to the

[PATCH v4 08/20] Add get_clone_versions and get_target_version functions.

2025-04-15 Thread Alfie Richards
This is a reimplementation of get_target_clone_attr_len, get_attr_str, and separate_attrs using string_slice and auto_vec to make memory management and use simpler. Adds get_target_version helper function to get the target_version string from a decl. gcc/c-family/ChangeLog: * c-attribs.c

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

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

[PATCH]middle-end: Fix incorrect codegen with PFA and VLS [PR119351]

2025-04-15 Thread Tamar Christina
Hi All, The following example: #define N 512 #define START 2 #define END 505 int x[N] __attribute__((aligned(32))); int __attribute__((noipa)) foo (void) { for (signed int i = START; i < END; ++i) { if (x[i] == 0) return i; } return -1; } generates incorrect code with

[PATCH] ipa-cp: Fix up ipcp_print_widest_int

2025-04-15 Thread Jakub Jelinek
On Mon, Mar 31, 2025 at 03:34:07PM +0200, Martin Jambor wrote: > This patch just introduces a form of dumping of widest ints that only > have zeros in the lowest 128 bits so that instead of printing > thousands of f's the output looks like: > >Bits: value = 0x, mask = all ones folled b

Re: [PATCH]middle-end: Fix incorrect codegen with PFA and VLS [PR119351]

2025-04-15 Thread Richard Sandiford
Tamar Christina writes: > diff --git a/gcc/tree-vect-loop-manip.cc b/gcc/tree-vect-loop-manip.cc > index > 56a4e9a8b63f3cae0bf596bf5d22893887dc80e8..0722679d6e66e5dd5af4ec1ce591f7c38b76d07f > 100644 > --- a/gcc/tree-vect-loop-manip.cc > +++ b/gcc/tree-vect-loop-manip.cc > @@ -2195,6 +2195,22 @@

RE: [PATCH]middle-end: Fix incorrect codegen with PFA and VLS [PR119351]

2025-04-15 Thread Tamar Christina
> -Original Message- > From: Richard Sandiford > Sent: Tuesday, April 15, 2025 10:52 AM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; nd ; rguent...@suse.de > Subject: Re: [PATCH]middle-end: Fix incorrect codegen with PFA and VLS > [PR119351] > > Tamar Christina writes: > > diff

Re: [PATCH v1 0/4] Implement extents from the mdspan header.

2025-04-15 Thread Luc Grosheintz
The second iteration of this patch series is available here: https://gcc.gnu.org/pipermail/libstdc++/2025-April/060988.html Thank you for the reviews. On 4/9/25 9:23 AM, Luc Grosheintz wrote: Hi, This is a patch series that implements std::extents from . I've never contributed to GCC or libst

[PATCH v2 2/4] libstdc++: Add header mdspan to the build-system.

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

Re: [PATCH] AArch64: Fix operands order in vec_extract expander

2025-04-15 Thread Richard Sandiford
Tejas Belagod writes: > The operand order to gen_vcond_mask call in the vec_extract pattern is wrong. > Fix the order where predicate is operand 3. > > Tested and bootstrapped on aarch64-linux-gnu. OK for trunk? > > gcc/ChangeLog > > * config/aarch64/aarch64-sve.md (vec_extract): Fix operand

[committed] libstdc++: Enable __gnu_test::test_container constructor for C++98

2025-04-15 Thread Jonathan Wakely
The only reason this constructor wasn't defined for C++98 is that it uses constructor delegation, but that isn't necessary. libstdc++-v3/ChangeLog: * testsuite/util/testsuite_iterators.h (test_container): Define array constructor for C++98 as well. --- I don't remember why I defi

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

2025-04-15 Thread Luc Grosheintz
This is the second version of: https://gcc.gnu.org/pipermail/libstdc++/2025-April/060914.html Following the comments from Jonathan, I reorganized the tests. Using the very effective tricks pointed out by Tomasz, led to a much more concise implementation of `_ExtentsStorage`. If desired, this could

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

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

[committed] testsuite: Fix up ipa/pr119318.c test [PR119318]

2025-04-15 Thread Jakub Jelinek
Hi! dg-additional-options followed by dg-options is ignored. I've added the -w from there to dg-options and removed dg-additional-options. Tested on x86_64-linux, committed to trunk as obvious. 2025-04-15 Jakub Jelinek PR ipa/119318 * gcc.dg/ipa/pr119318.c: Remove dg-additio

[PATCH v1] FMV: Redirect to specific target

2025-04-15 Thread Alfie Richards
Hi all, This is an optimisation similar to the one discussed in [1] and posted in [2]. This is slightly stronger as it makes use of the callee version information *and* caller information, enabling slightly more cases to be covered. This also means it can replace most of the cases that the previ

[PATCH v4 07/20] Change make_attribute to take string_slice.

2025-04-15 Thread Alfie Richards
gcc/ChangeLog: * attribs.cc (make_attribute): Change arguments. * attribs.h (make_attribute): Change arguments. Approved by Richard Sandiford. --- gcc/attribs.cc | 16 +--- gcc/attribs.h | 2 +- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/gcc/att

[PATCH v4 01/20] Add PowerPC FMV symbol tests.

2025-04-15 Thread Alfie Richards
From: Alice Carlotti This tests the mangling of function assembly names when annotated with target_clones attributes. gcc/testsuite/ChangeLog: * g++.target/powerpc/mvc-symbols1.C: New test. * g++.target/powerpc/mvc-symbols2.C: New test. * g++.target/powerpc/mvc-symbols3.

[PATCH v4 05/20] Update is_function_default_version to work with target_version.

2025-04-15 Thread Alfie Richards
Notably this respects target_version semantics where an unannotated function can be the default version. gcc/ChangeLog: * attribs.cc (is_function_default_version): Add target_version logic. Approved by Richard Sandiford. --- gcc/attribs.cc | 27 --- 1 file change

[PATCH v4 14/20] Add reject_target_clone hook for filtering target_clone versions.

2025-04-15 Thread Alfie Richards
This patch introduces the TARGET_REJECT_FUNCTION_CLONE_VERSION hook which is used to determine if a target_clones version string parses. If true is returned, a warning is emitted and from then on the version is ignored. This is as specified in the Arm C Language Extension. The purpose of this is

[PATCH v4 15/20] Change target_version semantics to follow ACLE specification.

2025-04-15 Thread Alfie Richards
This patch changes the semantics of target_version and target_clones attributes to match the behavior described in the Arm C Language extension. The changes to behavior are: - The scope and signature of an FMV function set is now that of the default version. - The FMV resolver is now created at

[PATCH v4 10/20] Add dispatcher_resolver_function and is_target_clone flags to cgraph_node.

2025-04-15 Thread Alfie Richards
These are needed to correctly mangle FMV declarations. gcc/ChangeLog: * cgraph.h (struct cgraph_node): Add dispatcher_resolver_function and is_target_clone. --- gcc/cgraph.h | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/cgraph.h b/gcc/cgraph.h

[r15-9487 Regression] FAIL: gcc.dg/completion-2.c (test for excess errors) on Linux/x86_64

2025-04-15 Thread haochen.jiang
On Linux/x86_64, 6d9fdf4bf57353f9260a2e0c8774854fb50f5128 is the first bad commit commit 6d9fdf4bf57353f9260a2e0c8774854fb50f5128 Author: Kyrylo Tkachov Date: Thu Feb 27 09:24:10 2025 -0800 Locality cloning pass: -fipa-reorder-for-locality caused FAIL: gcc.dg/completion-2.c expected mult

  1   2   >