RE: [PATCH][GCC16][GCC15] aarch64: Add support for FUJITSU-MONAKA (-mcpu=fujitsu-monaka) CPU

2025-05-29 Thread Yuta Mukai (Fujitsu)
Hi Kyrill-san Thank you for the review and for pushing. Yuta > -Original Message- > From: Kyrylo Tkachov > Sent: Thursday, May 29, 2025 6:45 PM > To: Mukai, Yuta/向井 優太 > Cc: gcc-patches@gcc.gnu.org; Richard Sandiford ; > andre.simoesdiasvie...@arm.com > Subject: Re: [PATCH][GCC16][GCC15

Re: [PATCH] scc_copy: conditional return TODO_cleanup_cfg.

2025-05-29 Thread Richard Biener
On Fri, May 30, 2025 at 3:53 AM Andrew Pinski wrote: > > Only have cleanup cfg happen if scc copy did some proping. > This should be a small compile time improvement by not doing cleanup > cfg if scc copy does nothing. > > Also removes TODO_update_ssa since it should not be needed. OK. Richard.

Re: [PATCH 1/2] forwprop: Change test in loop of optimize_memcpy_to_memset

2025-05-29 Thread Richard Biener
On Thu, May 29, 2025 at 11:48 PM Andrew Pinski wrote: > > On Tue, May 27, 2025 at 5:14 AM Richard Biener > wrote: > > > > On Tue, May 27, 2025 at 5:02 AM Andrew Pinski > > wrote: > > > > > > This was noticed in the review of copy propagation for aggregates > > > patch, instead of checking for a

Re: [PATCH] rtl-ssa: Reject non-address uses of autoinc regs [PR120347]

2025-05-29 Thread Richard Biener
On Wed, May 28, 2025 at 6:55 PM Richard Sandiford wrote: > > Richard Biener writes: > > On Thu, May 22, 2025 at 12:19 PM Richard Sandiford > > wrote: > >> > >> As the rtl.texi documentation of RTX_AUTOINC expressions says: > >> > >> If a register used as the operand of these expressions is use

Re: [PATCH] Fix crash with constant initializer caused by IPA

2025-05-29 Thread Richard Biener
On Thu, May 29, 2025 at 11:38 AM Eric Botcazou wrote: > > Hi, > > the attached Ada testcase compiled with -O2 -gnatn makes the compiler crash in > vect_can_force_dr_alignment_p during SLP vectorization: > > if (decl_in_symtab_p (decl) > && !symtab_node::get (decl)->can_increase_alignment_p

Re: [PATCH] expmed: Prevent non-canonical subreg generation in store_bit_field [PR118873]

2025-05-29 Thread Richard Biener
On Thu, May 29, 2025 at 12:27 PM Konstantinos Eleftheriou wrote: > > Hi Richard, thanks for the response. > > On Mon, May 26, 2025 at 11:55 AM Richard Biener wrote: > > > > On Mon, 26 May 2025, Konstantinos Eleftheriou wrote: > > > > > In `store_bit_field_1`, when the value to be written in the b

Re: [PATCH] c++tools: Don't check --enable-default-pie.

2025-05-29 Thread Richard Biener
On Thu, May 29, 2025 at 8:06 AM Kito Cheng wrote: > > `--enable-default-pie` is an option to specify whether to enable > position-independent executables by default for `target`. > > However c++tools is build for `host`, so it should just follow > `--enable-host-pie` option to determine whether to

Re: [PATCH 3/3] OpenMP: Handle more cases in user/condition selector

2025-05-29 Thread Tobias Burnus
Sandra Loosemore wrote: Like the attached V2 patch? LGTM. However, I think in metadirective-condition-template.C the "scan-tree-dump" should now be changed to "scan-tree-dump-times", given that there are several tests. Thanks, Tobias

Re: [PATCH 3/3] OpenMP: Handle more cases in user/condition selector

2025-05-29 Thread Sandra Loosemore
On 5/29/25 02:51, Tobias Burnus wrote: @Jason – The idea is make semantics.cc's maybe_convert_cond callable from parser.cc + pt.cc, i.e. to make it a non-static function. Any reasons not do so? Sandra Loosemore wrote: […] By using the existing front-end hooks for the implicit conversion to boo

[PATCH] scc_copy: conditional return TODO_cleanup_cfg.

2025-05-29 Thread Andrew Pinski
Only have cleanup cfg happen if scc copy did some proping. This should be a small compile time improvement by not doing cleanup cfg if scc copy does nothing. Also removes TODO_update_ssa since it should not be needed. gcc/ChangeLog: * gimple-ssa-sccopy.cc (scc_copy_prop::replace_scc_by_v

[PATCH v3] c++: Unwrap type traits defined in terms of builtins within diagnostics [PR117294]

2025-05-29 Thread Nathaniel Shead
On Wed, May 28, 2025 at 02:14:06PM -0400, Patrick Palka wrote: > On Tue, 27 May 2025, Nathaniel Shead wrote: > > > On Wed, Nov 27, 2024 at 11:45:40AM -0500, Patrick Palka wrote: > > > On Fri, 8 Nov 2024, Nathaniel Shead wrote: > > > > > > > Does this approach seem reasonable? I'm pretty sure tha

[PATCH] C: Flex array in union followed by a structure field is not reported [PR120354]

2025-05-29 Thread Qing Zhao
There is only one last_field for a structure type, but there might be multiple last_fields for a union type, therefore we should ORed the result of TYPE_INCLUDES_FLEXARRAY for multiple last_fields of a union type. The patch has been bootstrapped and regression tested on both x86 and aarch64. Okay

[PATCH v1 3/3] RISC-V: Add test cases for avg_ceil vaadd implementation

2025-05-29 Thread pan2 . li
From: Pan Li Add asm and run testcase for avg_ceil vaadd implementation. The below test suites are passed for this patch series. * The rv64gcv fully regression test. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/avg.h: Add test helper macros. * gcc.target/riscv/rvv/au

[PATCH v1 1/3] RISC-V: Leverage vaadd.vv for signed standard name avg_ceil

2025-05-29 Thread pan2 . li
From: Pan Li The avg_ceil has the rounding mode towards +inf, while the vaadd.vv has the rnu which totally match the sematics. From RVV spec, the fixed vaadd.vv with rnu, roundoff_signed(v, d) = (signed(v) >> d) + r r = v[d - 1] For vaadd, d = 1, then we have roundoff_signed(v, 1) = (signed(v

[PATCH v1 2/3] RISC-V: Reconcile the existing test for avg_ceil

2025-05-29 Thread pan2 . li
From: Pan Li Some existing avg_floor test need updated due to change to leverage vaadd.vv directly. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/vls/avg-4.c: Update asm check to vaadd. * gcc.target/riscv/rvv/autovec/vls/avg-5.c: Ditto. * gcc.target/ris

[PATCH v1 0/3] Refine the avg_ceil with fixed point vaadd

2025-05-29 Thread pan2 . li
From: Pan Li Similar to the avg_floor, the avg_ceil has the rounding mode towards +inf, while the vaadd.vv has the rnu which totally match the sematics. From RVV spec, the fixed vaadd.vv with rnu, roundoff_signed(v, d) = (signed(v) >> d) + r r = v[d - 1] For vaadd, d = 1, then we have roundof

Re: [PATCH 1/2] forwprop: Change test in loop of optimize_memcpy_to_memset

2025-05-29 Thread Andrew Pinski
On Tue, May 27, 2025 at 5:14 AM Richard Biener wrote: > > On Tue, May 27, 2025 at 5:02 AM Andrew Pinski > wrote: > > > > This was noticed in the review of copy propagation for aggregates > > patch, instead of checking for a NULL or a non-ssa name of vuse, > > we should instead check if it the vu

[pushed: r16-975] diagnostics: fix PatternFly URL

2025-05-29 Thread David Malcolm
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r16-975-g8b3300fe2c2794. gcc/ChangeLog: * diagnostic-format-html.cc (HTML_STYLE): Fix PatternFly URL in comment. Signed-off-by: David Malcolm --- gcc/diagnostic-format-html.cc | 2 +- 1 file change

[pushed: r16-974] diagnostics: reimplement html_token_printer in terms of xml::printer

2025-05-29 Thread David Malcolm
No functional change intended. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r16-974-g3d00efc156367e. gcc/ChangeLog: * diagnostic-format-html.cc (html_builder::make_element_for_diagnostic::html_token_printer): Reimplement in terms of xml

[pushed: r16-973] diagnostics: bulletproof html_builder::make_metadata_element

2025-05-29 Thread David Malcolm
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r16-973-g554d2a2f0e2006. gcc/ChangeLog: * diagnostic-format-html.cc (html_builder::make_metadata_element): Gracefully handle the case where "url" is null. Signed-off-by: David Malcolm --- gcc/diagn

[pushed: r16-972] diagnostics: use unique_ptr for m_format_postprocessor

2025-05-29 Thread David Malcolm
No functional change intended. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r16-972-gafee0b19dfdc39. gcc/cp/ChangeLog: * error.cc (cxx_format_postprocessor::clone): Update to use unique_ptr. (cxx_dump_pretty_printer::cxx_dump_pretty_pri

Re: [PATCH] C: Flex array in the middle via type alias is not reported [PR120353]

2025-05-29 Thread Joseph Myers
On Thu, 29 May 2025, Qing Zhao wrote: > The root cause of the bug is: the TYPE_INCLUDES_FLEXARRAY marking of the > structure type is not copied to its aliased type. > The fix is to copy this marking to all the variant types of the current > structure type. > > The patch has been bootstrapped and

Re: [PATCH] c: fix ICE related to tagged types with attributes in diagnostics [PR120380]

2025-05-29 Thread Joseph Myers
On Thu, 29 May 2025, Martin Uecker wrote: > get_aka_type will create a new type for diagnostics, but for tagged types > attributes will then be ignored with a warning. This can lead to > reentering > warning code which leads to an ICE. Fix this by ignoring the attributes > for t

Re: [PATCH] c: fix ICE for mutually recursive structures [PR120381]

2025-05-29 Thread Joseph Myers
On Thu, 29 May 2025, Martin Uecker wrote: > > This is a fun one.  > > Bootstrapped and regression tested for x86_64. > > Martin > > > c: fix ICE for mutually recursive structures [PR120381] > > For invalid nesting of a structure definition in a definition > of itself or when

[PATCH v2] libstdc++: Implement LWG 2439 for std::unique_copy [PR120386]

2025-05-29 Thread Jonathan Wakely
The current overload set for __unique_copy handles three cases: - The input range uses forward iterators, the output range does not. This is the simplest case, and can just compare adjacent elements of the input range. - Neither the input range nor output range use forward iterators. This r

[pushed] c++: xobj lambda 'this' capture [PR113563]

2025-05-29 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- Various places were still making assumptions that we could get to the 'this' capture through current_class_ref in a lambda op(), which is incorrect for an explicit object op(). PR c++/113563 gcc/cp/ChangeLog: * lambda.cc (

Re: [PATCH] libstdc++: Define flat_set::operator== in terms of ==

2025-05-29 Thread Tomasz Kaminski
On Thu, May 29, 2025 at 7:14 PM Patrick Palka wrote: > Tested on x86_64-pc-linux-gnu, does this look OK for trunk/15? > > -- >8 -- > > ... for consistency with the other standard container adaptors > (stack, queue, etc). > > libstdc++-v3/ChangeLog: > > * include/std/flat_set (_Flat_set_im

Re: [PATCH v4 0/8] Implement layouts from mdspan.

2025-05-29 Thread Tomasz Kaminski
Sending a bit after the fact, but: I have finished the review, and most of the commits have really minimal cosmetic changes. The only major functional one I have requested are for layout_stride implementation, On Wed, May 28, 2025 at 4:36 PM Tomasz Kaminski wrote: > I have reviewed and posted fe

Re: [PATCH] libstdc++: Compare keys and values separately in flat_map::operator==

2025-05-29 Thread Tomasz Kaminski
On Thu, May 29, 2025 at 4:49 PM Jonathan Wakely wrote: > On Thu, 29 May 2025 at 15:48, Jonathan Wakely wrote: > > > > On Thu, 29 May 2025 at 15:42, Tomasz Kaminski > wrote: > > > > > > > > > > > > On Thu, May 29, 2025 at 3:56 PM Patrick Palka > wrote: > > >> > > >> Tested on x86_64-pc-linux-gn

Re: [EXT] Re: [PATCH v3] rs6000: Adding missed ISA 3.0 atomic memory operation instructions.

2025-05-29 Thread Peter Bergner
On 5/29/25 5:35 AM, Segher Boessenkool wrote: > > Add yourself to suthors as well? Agreed. Just add your name/email address directly under mine, like so: 2025-05-29 Peter Bergner Jeevitha Palanisamy >> +{ \ >>

[PATCH v4] libstdc++: stringstream ctors from string_view [PR119741]

2025-05-29 Thread Nathan Myers
Change in V4: * Rename tests to string_view.cc * Adapt tests to cons/wchar_t directories * Define symbol __cpp_lib_sstream_from_string_view as 202406 * Define symbol __glibcxx_want_sstream_from_string_view before version.h * Include version.h after other includes * No include type_traits * D

Re: [PATCH RFA (diagnostic)] c++: modules and #pragma diagnostic

2025-05-29 Thread David Malcolm
On Thu, 2025-05-29 at 09:11 -0400, Jason Merrill wrote: > On 5/27/25 5:12 PM, Jason Merrill wrote: > > On 5/27/25 4:47 PM, Jason Merrill wrote: > > > On 5/27/25 1:33 PM, David Malcolm wrote: > > > > On Fri, 2025-05-23 at 16:58 -0400, Jason Merrill wrote: > > > > > On 4/14/25 9:57 AM, Jason Merrill

[PATCH] c++, coroutines: Improve diagnostics for awaiter/promise.

2025-05-29 Thread Iain Sandoe
Tested on x86_64-darwin, powerpc64le-linux, OK for trunk? thanks Iain --- 8< --- At present, we can issue diagnostics about missing or malformed awaiter or promise methods when we encounter their uses in the body of a users function. We might then re-issue the same diagnostics when processing th

[PATCH] c: fix ICE related to tagged types with attributes in diagnostics [PR120380]

2025-05-29 Thread Martin Uecker
This fixes an error recovery issue. Bootstrapped and regression tested for x86_64. Martin c: fix ICE related to tagged types with attributes in diagnostics [PR120380] get_aka_type will create a new type for diagnostics, but for tagged types attributes will then be ignored wit

[PATCH] c: fix ICE for mutually recursive structures [PR120381]

2025-05-29 Thread Martin Uecker
This is a fun one.  Bootstrapped and regression tested for x86_64. Martin c: fix ICE for mutually recursive structures [PR120381] For invalid nesting of a structure definition in a definition of itself or when using a rather obscure construction using statement expression

[PATCH] C: Flex array in the middle via type alias is not reported [PR120353]

2025-05-29 Thread Qing Zhao
The root cause of the bug is: the TYPE_INCLUDES_FLEXARRAY marking of the structure type is not copied to its aliased type. The fix is to copy this marking to all the variant types of the current structure type. The patch has been bootstrapped and regression tested on both x86 and aarch64. Okay for

[PATCH] c++, coroutines: Make analyze_fn_params into a class method.

2025-05-29 Thread Iain Sandoe
Tested on x86_64-darwin, powerpc64le-linux, OK for trunk? thanks Iain --- 8< --- This continues code cleanups and migration to encapsulation of the whole coroutine transform. gcc/cp/ChangeLog: * coroutines.cc (analyze_fn_parms): Move from free function.. (cp_coroutine_transform:

Re: [PATCH] c++, coroutines: Make a check more specific [PR109283].

2025-05-29 Thread Jason Merrill
On 5/29/25 11:34 AM, Iain Sandoe wrote: Tested on x86_64-darwin, powerpc64le-linux; I'd like to minimize effort on this code, since I expect that we will need some changes to deal with open BZs. This fixes an ICE tho, OK for trunk? OK. thanks Iain --- 8< --- The check was intended to asser

Re: [PATCH] RISC-V: Add 'bclr+binv' peephole2 optimization.

2025-05-29 Thread Jeff Law
On 5/28/25 9:05 PM, Jiawei wrote: This seems like it would be much better as a combine pattern.   In fact, I'm a bit surprised that combine didn't simplify this series of operations into a IOR.  So I'd really like to see the .combine dump with and without this hunk for the relevant testcas

[pushed] c++: C++17 constexpr lambda and goto/static

2025-05-29 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- We only want the error for these cases for functions explicitly declared constexpr, but we still want to set invalid_constexpr on C++17 lambdas so maybe_save_constexpr_fundef doesn't make them implicitly constexpr. The potential_constant_ex

Re: [PATCH] aarch64: Use LDR for first-element loads for Advanced SIMD

2025-05-29 Thread Richard Sandiford
Dhruv Chawla writes: > On 08/05/25 18:43, Richard Sandiford wrote: >> Otherwise it looks good. But I think we should think about how we >> plan to integrate the related optimisation for register inputs. E.g.: >> >> int32x4_t foo(int32_t x) { >> return vsetq_lane_s32(x, vdupq_n_s32(0), 0);

[PATCH] libstdc++: Define flat_set::operator== in terms of ==

2025-05-29 Thread Patrick Palka
Tested on x86_64-pc-linux-gnu, does this look OK for trunk/15? -- >8 -- ... for consistency with the other standard container adaptors (stack, queue, etc). libstdc++-v3/ChangeLog: * include/std/flat_set (_Flat_set_impl::operator==): Define in terms of ==, not std::equal. --- li

Minor patch committed.

2025-05-29 Thread Jerry D
This was a followup to make the error message a little better. Committed. commit c69afa2f1bd7455457ab4e028a6bc51211b2dd20 (HEAD -> master, origin/master, origin/HEAD) Author: Jerry DeLisle Date: Thu May 29 10:02:00 2025 -0700 Fortran: Make minor adjustment to error message.

Re: [PATCH v2 2/2] emit-rtl: Validate mode for paradoxical hardware subregs [PR119966]

2025-05-29 Thread Richard Sandiford
Sorry for the slow reply. Dimitar Dimitrov writes: > On Fri, May 16, 2025 at 06:14:30PM +0100, Richard Sandiford wrote: >> Dimitar Dimitrov writes: >> > After r16-160-ge6f89d78c1a752, late_combine2 started transforming the >> > following RTL for pru-unknown-elf: >> > >> > (insn 3949 3948 3951

Re: [PATCH] libstdc++: Compare keys and values separately in flat_map::operator==

2025-05-29 Thread Patrick Palka
On Thu, 29 May 2025, Tomasz Kaminski wrote: > > > On Thu, May 29, 2025 at 4:37 PM Tomasz Kaminski wrote: > > > On Thu, May 29, 2025 at 3:56 PM Patrick Palka wrote: > Tested on x86_64-pc-linux-gnu, does this look OK for trunk/15? > > -- >8 -- > > Instead of effectively doi

[PATCH] c++, coroutines: Make a check more specific [PR109283].

2025-05-29 Thread Iain Sandoe
Tested on x86_64-darwin, powerpc64le-linux; I'd like to minimize effort on this code, since I expect that we will need some changes to deal with open BZs. This fixes an ICE tho, OK for trunk? thanks Iain --- 8< --- The check was intended to assert that we had visited contained ternary expression

Re: [PATCH v3] rs6000: Adding missed ISA 3.0 atomic memory operation instructions.

2025-05-29 Thread Segher Boessenkool
Hi! On Thu, May 29, 2025 at 10:36:12AM +0530, jeevitha wrote: > Changes to amo.h include the addition of the following load atomic operations: > Compare and Swap Not Equal, Fetch and Increment Bounded, Fetch and Increment > Equal, and Fetch and Decrement Bounded. Additionally, Store Twin is added

[PATCH] rtl-optimization: Invalid CSE of inline asm with memory clobber [PR111901]

2025-05-29 Thread Uros Bizjak
The following test: --cut here-- int test (void) { unsigned int sum = 0; for (int i = 0; i < 4; i++) { unsigned int val; asm ("magic %0" : "=r" (val) : : "memory"); sum += val; } return sum; } --cut here-- compiles on x86_64 with -O2 -funroll-all-loops to nonsen

Re: [PATCH v5 02/24] i386: Add x86 FMV symbol tests

2025-05-29 Thread Jeff Law
On 5/29/25 6:40 AM, Alfie Richards wrote: 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/

Re: [PATCH v5 01/24] ppc: Add PowerPC FMV symbol tests.

2025-05-29 Thread Jeff Law
On 5/29/25 6:40 AM, Alfie Richards wrote: 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 t

[pushed] c++, coroutines: Delete now unused code for parm guards.

2025-05-29 Thread Iain Sandoe
tested on x86_64-darwin, powerpc64le-linux; NFC pushed as obvious, thanks, Iain --- 8< --- Since r16-775-g18df4a10bc9694 we use nested cleanups to handle parameter copy destructors in the ramp (and pass a list of cleanups required to the actor which will only be invoked if the parameter copies we

[PATCH] c++, coroutines: Simplify initial_await_resume_called.

2025-05-29 Thread Iain Sandoe
Tested on x86_64-darwin, powerpc64le-linux, OK for trunk? thanks Iain --- 8< --- We do not need to generate this code early, since it does not affect any of the analysis. Lowering it later takes less code, and avoids modifying the initial await expresssion which will simplify changes to analysis

[PATCH v1] doc: Replace "fixed-point" with "integer"

2025-05-29 Thread Karl Meakin
In some places the documentation refers to "fixed-point" types or values when talking about plain integer types. Although this is meant to mean "the opposite of floating-point", it is misleading and can be confused with the fractional types that are also known as "fixed-point". For the avoidance of

Re: [PATCH] libstdc++: Compare keys and values separately in flat_map::operator==

2025-05-29 Thread Jonathan Wakely
On Thu, 29 May 2025 at 15:48, Jonathan Wakely wrote: > > On Thu, 29 May 2025 at 15:42, Tomasz Kaminski wrote: > > > > > > > > On Thu, May 29, 2025 at 3:56 PM Patrick Palka wrote: > >> > >> Tested on x86_64-pc-linux-gnu, does this look OK for trunk/15? > >> > >> -- >8 -- > >> > >> Instead of effe

Re: [PATCH] libstdc++: Compare keys and values separately in flat_map::operator==

2025-05-29 Thread Jonathan Wakely
On Thu, 29 May 2025 at 15:42, Tomasz Kaminski wrote: > > > > On Thu, May 29, 2025 at 3:56 PM Patrick Palka wrote: >> >> Tested on x86_64-pc-linux-gnu, does this look OK for trunk/15? >> >> -- >8 -- >> >> Instead of effectively doing a zipped comparison of the keys and values, >> compare them sepa

Re: [PATCH] libstdc++: Compare keys and values separately in flat_map::operator==

2025-05-29 Thread Tomasz Kaminski
On Thu, May 29, 2025 at 4:37 PM Tomasz Kaminski wrote: > > > On Thu, May 29, 2025 at 3:56 PM Patrick Palka wrote: > >> Tested on x86_64-pc-linux-gnu, does this look OK for trunk/15? >> >> -- >8 -- >> >> Instead of effectively doing a zipped comparison of the keys and values, >> compare them sepa

Re: [PATCH] libstdc++: Compare keys and values separately in flat_map::operator==

2025-05-29 Thread Tomasz Kaminski
On Thu, May 29, 2025 at 3:56 PM Patrick Palka wrote: > Tested on x86_64-pc-linux-gnu, does this look OK for trunk/15? > > -- >8 -- > > Instead of effectively doing a zipped comparison of the keys and values, > compare them separately to leverage the underlying containers' optimized > equality imp

Re: [PATCH v3] libstdc++: Implement stringstream from string_view [PR119741]

2025-05-29 Thread Jonathan Wakely
On 29/05/25 09:50 -0400, Nathan Myers wrote: Change in V3: * Comment that p2495 specifies a drive-by constraint omitted as redundant * Adjust whitespace to fit in 80 columns Change in V2: * apply all review comments * remove redundant drive-by "requires" on ctor from string allocator arg * check

Re: [PATCH] ipa: When inlining, don't combine PT JFs changing signedness (PR120295)

2025-05-29 Thread Jan Hubicka
> Hi, > > in GCC 15 we allowed jump-function generation code to skip over a > type-cast converting one integer to another as long as the latter can > hold all the values of the former or has at least the same precision. > This works well for IPA-CP where we do then evaluate each jump > function as

Re: [PATCH] libstdc++: Compare keys and values separately in flat_map::operator==

2025-05-29 Thread Jonathan Wakely
On Thu, 29 May 2025 at 14:55, Patrick Palka wrote: > > Tested on x86_64-pc-linux-gnu, does this look OK for trunk/15? OK for both, thanks. > > -- >8 -- > > Instead of effectively doing a zipped comparison of the keys and values, > compare them separately to leverage the underlying containers' opt

[PATCH] libstdc++: Compare keys and values separately in flat_map::operator==

2025-05-29 Thread Patrick Palka
Tested on x86_64-pc-linux-gnu, does this look OK for trunk/15? -- >8 -- Instead of effectively doing a zipped comparison of the keys and values, compare them separately to leverage the underlying containers' optimized equality implementations. libstdc++-v3/ChangeLog: * include/std/flat_

[PATCH v3] libstdc++: Implement stringstream from string_view [PR119741]

2025-05-29 Thread Nathan Myers
Change in V3: * Comment that p2495 specifies a drive-by constraint omitted as redundant * Adjust whitespace to fit in 80 columns Change in V2: * apply all review comments * remove redundant drive-by "requires" on ctor from string allocator arg * check allocators are plumbed through -- >8 --

Re: [AUTOFDO] Fix annotated profile for de-duplicated call

2025-05-29 Thread Jan Hubicka
> > However i do not quite follow the old or new logic here. > So if I have only one unknown edge out (or in) from BB and I know > its count, I can determine count of that edge by Kirhoff law. > > But then the old code computes number of edges out of the BB > and if it is only one it updates the

Re: [AUTOFDO] Fix annotated profile for de-duplicated call

2025-05-29 Thread Jan Hubicka
> diff --git a/gcc/auto-profile.cc b/gcc/auto-profile.cc > index 7e0e8c66124..8a317d85277 100644 > --- a/gcc/auto-profile.cc > +++ b/gcc/auto-profile.cc > @@ -1129,6 +1129,26 @@ afdo_set_bb_count (basic_block bb, const stmt_set > &promoted) >gimple *stmt = gsi_stmt (gsi); >if (gimp

[PATCH] RISC-V: Add svbare extension.

2025-05-29 Thread Dongyan Chen
This patch support svbare extension, which is an extension in RVA23 profile. To enable GCC to recognize and process svbare extension correctly at compile time. --- gcc/config/riscv/riscv-ext.def | 13 + gcc/config/riscv/riscv-ext.opt | 2 ++ gcc/doc/riscv-ext.texi

Re: [PATCH] c++, coroutines: Fix identification of coroutine ramps [PR120453].

2025-05-29 Thread Jason Merrill
On 5/29/25 6:56 AM, Iain Sandoe wrote: Tested on x86_64-darwin, confirming that the original reported code fails without the change here. Unfortunately, if we add a move constructor to the reduced case, it no longer fails on unpatched trunk - so not proposing to add that as a testcase (since it

Re: [PATCH RFA (diagnostic)] c++: modules and #pragma diagnostic

2025-05-29 Thread Jason Merrill
On 5/27/25 5:12 PM, Jason Merrill wrote: On 5/27/25 4:47 PM, Jason Merrill wrote: On 5/27/25 1:33 PM, David Malcolm wrote: On Fri, 2025-05-23 at 16:58 -0400, Jason Merrill wrote: On 4/14/25 9:57 AM, Jason Merrill wrote: On 1/9/25 10:00 PM, Jason Merrill wrote: Tested x86_64-pc-linux-gnu.  Is

[PATCH] RISC-V: Imply zicsr for svade and svadu extensions.

2025-05-29 Thread Dongyan Chen
This patch implies zicsr for svade and svadu extensions. According to the riscv-privileged spec, the svade and svadu extensions are privileged instructions, so they should imply zicsr. gcc/ChangeLog: * config/riscv/riscv-ext.def: Imply zicsr. --- gcc/config/riscv/riscv-ext.def | 4 ++--

[committed] libstdc++: Fix lwg4084.cc test FAIL on AIX

2025-05-29 Thread Jonathan Wakely
On AIX printf formats a quiet NaN as "NaNQ" and it doesn't matter whether %f or %F is used. Similarly, it always prints "INF" for infinity, even when %f is used. Adjust a test that currently fails due to this AIX-specific (and non-conforming) behaviour. libstdc++-v3/ChangeLog: * testsuite

[PATCH v5 22/24] c: Add target_version attribute support.

2025-05-29 Thread Alfie Richards
This commit introduces support for the target_version attribute in the c frontend, following the behavior defined in the Arm C Language Extension. Key changes include: - During pushdecl, the compiler now checks whether the current symbol is part of a multiversioned set. - New versions are add

[PATCH v5 20/24] aarch64: testsuite: Add diagnostic tests for Aarch64 FMV.

2025-05-29 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

Re: [PATCH v4 0/1] Add warnings of potentially-uninitialized padding bits

2025-05-29 Thread Christopher Bazley
Dear GCC Developers, Please could somebody review this patch? I previously received comments from Joseph and Jakub, which I believe I have addressed. Thanks, Chris On 21/05/2025 16:13, Christopher Bazley wrote: Commit 0547dbb725b reduced the number of cases in which union padding bits are z

[PATCH v5 21/24] aarch64: Remove FMV beta warning.

2025-05-29 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 v5 12/24] fmv: i386: Refactor FMV name mangling.

2025-05-29 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 v5 19/24] c++: Fix FMV return type ambiguation

2025-05-29 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

[PATCH v5 24/24] FMV: Redirect to specific target

2025-05-29 Thread Alfie Richards
Adds an optimisation in FMV to redirect to a specific target if possible. A call is redirected to a specific target if both: - the caller can always call the callee version - and, it is possible to rule out all higher priority versions of the callee fmv set. That is estabilished either by the ca

[PATCH v5 10/24] Add dispatcher_resolver_function and is_target_clone flags to cgraph_node.

2025-05-29 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

[PATCH v5 16/24] c/c++: Add target_[version/clones] to decl diagnostics formatting.

2025-05-29 Thread Alfie Richards
Adds the target_version and target_clones attributes to diagnostic messages for target_version semantics. This is because the target_version/target_clones attributes affect the identity of the decls, so need to be represented in diagnostics for them. After this change diagnostics look like: ```

[committed] libstdc++: Fix another 17_intro/names.cc failure on AIX

2025-05-29 Thread Jonathan Wakely
FAIL: 17_intro/names.cc -std=gnu++98 (test for excess errors) Also fix typo in experimental/names.cc where I did #undef for the wrong name in r16-901-gd1ced2a5ea6b09. libstdc++-v3/ChangeLog: * testsuite/17_intro/names.cc [_AIX] (a): Undefine. * testsuite/experimental/names.cc [_

[committed] libstdc++: Re-enable some XPASS tests for AIX

2025-05-29 Thread Jonathan Wakely
The deque shrink_to_fit.cc test always passes on AIX, I think it should not have been disabled. The 96088.cc tests pass for C++20 and later (I don't know why) so make them require C++20, as they fail otherwise. libstdc++-v3/ChangeLog: * testsuite/23_containers/deque/capacity/shrink_to_fi

[PATCH v5 23/24] c/aarch64: Add FMV diagnostic tests.

2025-05-29 Thread Alfie Richards
Adds some aarch64 C fmv diagnostic tests. This mostly tests C front end code, but has to be target specific at FMV is requires specifying target extensions. gcc/testsuite/ChangeLog: * gcc.target/aarch64/mv-and-mvc-error1.c: New test. * gcc.target/aarch64/mv-and-mvc-error2.c: New

[PATCH v5 09/24] Add assembler_name to cgraph_function_version_info.

2025-05-29 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 v5 14/24] fmv: Add reject_target_clone hook for filtering target_clone versions.

2025-05-29 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 v5 17/24] c++: Refactor FMV frontend conflict and merging logic and hooks.

2025-05-29 Thread Alfie Richards
This change refactors FMV handling in the frontend to allows greater reasoning about versions in shared code. This is needed for allowing target_clones and target_versions to be used together in a function set, as there is then two distinct concerns when encountering two declarations that previous

[PATCH v5 06/24] Refactor record_function_versions.

2025-05-29 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 v5 11/24] Add clone_identifier function.

2025-05-29 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 v5 18/24] fmv: Support mixing of target_clones and target_version.

2025-05-29 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 v5 15/24] fmv: Change target_version semantics to follow ACLE specification.

2025-05-29 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 v5 05/24] Update is_function_default_version to work with target_version.

2025-05-29 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 v5 13/24] riscv: Refactor riscv target parsing to take string_slice.

2025-05-29 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 v5 08/24] Add get_clone_versions and get_target_version functions.

2025-05-29 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

[PATCH v5 07/24] Change make_attribute to take string_slice.

2025-05-29 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 v5 03/24] Add string_slice class.

2025-05-29 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 v5 04/24] Remove unnecessary `record` argument from maybe_version_functions.

2025-05-29 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 v5 02/24] i386: Add x86 FMV symbol tests

2025-05-29 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 v5 00/24] FMV refactor, C FMV support and ACLE compliance.

2025-05-29 Thread Alfie Richards
Hi all, This is a minor update to V4. Firstly it updates the diagnostics for versioned function decls to include the target_version/target_clones attribute, and simplified the diagnostic logic changes in cpp/c frontends. Secondly, I merged this series with my C FMV support series and my FMV inli

[PATCH v5 01/24] ppc: Add PowerPC FMV symbol tests.

2025-05-29 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] c-lex: Handle NULL filenames from UNKNOWN_LOCATION [PR120273].

2025-05-29 Thread Iain Sandoe
To trigger this involves somewhat tortuous pathways through the c++ requires code. I did consider the alternative of putting in an assert and then checking every call-site, but that seemed to be a much larger change. tested on x86_64-darwin and powerpc64le-linux, OK for trunk? thanks Iain --- 8<

[PATCH] RISC-V: Add smcntrpmf extension.

2025-05-29 Thread Dongyan Chen
This patch support smcntrpmf extension[1]. To enable GCC to recognize and process smcntrpmf extension correctly at compile time. [1]https://github.com/riscvarchive/riscv-smcntrpmf gcc/ChangeLog: * config/riscv/riscv-ext.def: New extension defs. * config/riscv/riscv-ext.opt: Ditt

[PATCH v2 16/16] libstdc++: Define __wait_result_type for atomic waiting

2025-05-29 Thread Jonathan Wakely
libstdc++-v3/ChangeLog: * include/bits/atomic_timed_wait.h: Use __wait_result_type. * include/bits/atomic_wait.h (__wait_result_type): New struct. (__wait_args::_M_prep_for_wait_on): Rename to _M_setup_wait, use __wait_result_type. (__atomic_wait_address): A

  1   2   >