Re: [PATCH] c++: Add testcases for the defarg part of P1766R1 [PR121552]

2025-08-15 Thread Nathaniel Shead
On Fri, Aug 15, 2025 at 12:38:01PM +0200, Jakub Jelinek wrote: > Hi! > > The following patch adds some testcases for the default argument (function > and template) part of the paper, making sure we diagnose multiple defargs > in the same TU and when visible in modules and DTRT when some aren't vis

[PATCH v2] c++: Implement P2115R0 linkage changes for unnamed unscoped enums [PR120503]

2025-08-15 Thread Nathaniel Shead
On Sun, Aug 10, 2025 at 03:33:26PM -0700, Jason Merrill wrote: > On 8/8/25 9:46 AM, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > Alternatively, if preferred I also experimented with a patch that > > cached the property as a TYPE_LANG_FLAG for

Re: [PATCH v2] libstdc++: Implement LWG4222 'expected' constructor from a single value missing a constraint

2025-08-15 Thread Patrick Palka
On Thu, 14 Aug 2025, Yihan Wang wrote: > libstdc++-v3/ChangeLog: > > * include/std/expected: Add missing constraint as per LWG 4222. > * testsuite/20_util/expected/lwg4222.cc: New test. > > Signed-off-by: Yihan Wang > --- > libstdc++-v3/include/std/expected | 1 + > ..

Re: [PATCH] c++: Deducing member array type from string literal [PR121518]

2025-08-15 Thread Jason Merrill
On 8/15/25 11:49 AM, Patrick Palka wrote: Hi, thanks for the patch! On Fri, 15 Aug 2025, seha-bot wrote: From: Nedim Šehić Regtested on x86_64-pc-linux-gnu. This patch fixes deduction for member array types from parenthesized initializers which use braces and string literals. PR c

[committed] cobol: Eliminate a run-time structure type that is no longer used.

2025-08-15 Thread Robert Dubner
>From 87f354ca75361faa2f40b826d632fbc49a082553 Mon Sep 17 00:00:00 2001 From: Robert Dubner Date: Thu, 14 Aug 2025 09:49:46 -0400 Subject: [PATCH] cobol: Eliminate a run-time structure type that is no longer used. gcc/cobol/ChangeLog: * genapi.h (parser_call_exception_end): Remove obsol

[committed] real: Eliminate access to uninitialized memory.

2025-08-15 Thread Robert Dubner
>From 810340f9fed56dc2a0e7e1db3f19b383f6e4cb95 Mon Sep 17 00:00:00 2001 From: Robert Dubner mailto:rdub...@symas.com Date: Thu, 31 Jul 2025 07:45:26 -0400 Subject: [PATCH] real: Eliminate access to uninitialized memory. When compiling this program with gcobol: identification division.

Re: [PATCH] c++: Implement __builtin_structured_binding_size trait

2025-08-15 Thread Jason Merrill
On 8/15/25 9:45 AM, Jakub Jelinek wrote: On Fri, Aug 15, 2025 at 12:08:42PM -0400, Jason Merrill wrote: + if (TRAIT_EXPR_KIND (t) == CPTK_STRUCTURED_BINDING_SIZE + && type1 != error_mark_node + && !processing_template_decl) + /* __builtin_structured_binding_size

Re: [PATCH] c++: Deducing member array type from string literal [PR121518]

2025-08-15 Thread Patrick Palka
Hi, thanks for the patch! On Fri, 15 Aug 2025, seha-bot wrote: > From: Nedim Šehić > > Regtested on x86_64-pc-linux-gnu. > > This patch fixes deduction for member array types from parenthesized > initializers which use braces and string literals. > > PR c++/121518 > > gcc/cp/ChangeLo

[RISC-V][PR target/121213] Avoid unnecessary constant load in amoswap

2025-08-15 Thread Austin Law
PR 121213 shows an unnecessary "li target,0" in an atomic exchange loop on RISC-V. The source operand for an amoswap instruction should allow (const_int 0) in addition to GPRs. So the operand's predicate is changed to "reg_or_0_operand". The corresponding constraint is also changed to allow a r

[COMMITTED] RISC-V: fix __builtin_round clobbering FP exceptions flags [PR121534]

2025-08-15 Thread Vineet Gupta
__builtin_round() fails to save/restore FP exception flags around the FP compare insn which can potentially clobber the same. Worth noting that the fflags restore bracketing is slightly different than the glibc implementation. Both FLT and FCVT can potentially clobber fflags. gcc generates below w

Re: [PATCH v2] RISC-V: fix __builtin_round clobbering FP exceptions flags [PR121534]

2025-08-15 Thread Jeff Law
On 8/15/25 10:34 AM, Vineet Gupta wrote: On 8/15/25 06:13, Jeff Law wrote: On 8/14/25 6:32 PM, Vineet Gupta wrote: Changes since v1: - Fix scan pattern for math-nearbyint-1.c - Per Andrew's suggestion gate flag save/restore on -ftrapping-math Still failing CI: https://github.com/e

Re: [PATCH] c++: Add testcases for the defarg part of P1766R1 [PR121552]

2025-08-15 Thread Jakub Jelinek
On Fri, Aug 15, 2025 at 11:37:02AM -0400, Jason Merrill wrote: > > + int f7 (int = 42); // { dg-message "previous specification > > in 'int f7\\\(int\\\)' here" } > > + int f7 (int = 42); // { dg-error "default argument given > > for parameter 1 of 'int f7\\\(int\\\)

Re: [PATCH v9 0/4] extend "counted_by" attribute to pointer fields of structures + fix PR120929

2025-08-15 Thread Qing Zhao
This set of patches has been committed today: https://gcc.gnu.org/pipermail/gcc-cvs/2025-August/432733.html https://gcc.gnu.org/pipermail/gcc-cvs/2025-August/432734.html https://gcc.gnu.org/pipermail/gcc-cvs/2025-August/432735.html https://gcc.gnu.org/pipermail/gcc-cvs/2025-August/432736.html Qin

Re: [PATCH] c++: Implement __builtin_structured_binding_size trait

2025-08-15 Thread Jakub Jelinek
On Fri, Aug 15, 2025 at 12:08:42PM -0400, Jason Merrill wrote: > > + if (TRAIT_EXPR_KIND (t) == CPTK_STRUCTURED_BINDING_SIZE > > + && type1 != error_mark_node > > + && !processing_template_decl) > > + /* __builtin_structured_binding_size handled separately > > +to make it

Re: [PATCH v2] RISC-V: fix __builtin_round clobbering FP exceptions flags [PR121534]

2025-08-15 Thread Vineet Gupta
On 8/15/25 06:13, Jeff Law wrote: > On 8/14/25 6:32 PM, Vineet Gupta wrote: >> Changes since v1: >>- Fix scan pattern for math-nearbyint-1.c >>- Per Andrew's suggestion gate flag save/restore on -ftrapping-math > Still failing CI: > >> https://github.com/ewlu/gcc-precommit-ci/issues/3776#is

Re: [Ping] [PATCH v2 0/3] AArch64: Support C/C++ operations on svbool_t

2025-08-15 Thread Tejas Belagod
Ping On 31/07/2025 13:36, Tejas Belagod wrote: This is a follow-up to a series posted earlier this year: https://gcc.gnu.org/pipermail/gcc-patches/2025-March/677053.html Sorry to have dropped the ball on this. I've separated out the index operator into a separate patch which I post subsequentl

Re: [PATCH] c++: Implement __builtin_structured_binding_size trait

2025-08-15 Thread Jason Merrill
On 8/15/25 8:40 AM, Jakub Jelinek wrote: Hi! clang++ apparently added a SFINAE-friendly __builtin_structured_binding_size trait to return the structured binding size (or error if not in SFINAE contexts if a type doesn't have a structured binding size). The expansion statement patch already anti

Re: [PATCH] c++, v4: Warn on #undef/#define of remaining cpp.predefined macros [PR120778]

2025-08-15 Thread Jason Merrill
On 8/15/25 8:52 AM, Jakub Jelinek wrote: On Fri, Aug 15, 2025 at 05:13:52PM +0200, Jakub Jelinek wrote: On Fri, Aug 15, 2025 at 10:46:04AM -0400, Jason Merrill wrote: This name is confusing wrt warn_builtin_macro_redefined; since it seems to be used internally to suppress the warning, maybe cal

[PATCH v9] Provide new option -fdiagnostics-show-context=N for -Warray-bounds, -Wstringop-* warnings [PR109071, PR85788, PR88771, PR106762, PR108770, PR115274, PR117179]

2025-08-15 Thread Qing Zhao
Hi, This is the 9th version of the patch for fixing PR109071. Major changes compared to v8: (address all Richard's comments) https://gcc.gnu.org/pipermail/gcc-patches/2025-July/691198.html 1. Add a -fdiagnostics-show-context alias to -fdiagnostics-show-context=1. -fno-diagnostics-show-contex

[PATCH] c++, v4: Warn on #undef/#define of remaining cpp.predefined macros [PR120778]

2025-08-15 Thread Jakub Jelinek
On Fri, Aug 15, 2025 at 05:13:52PM +0200, Jakub Jelinek wrote: > On Fri, Aug 15, 2025 at 10:46:04AM -0400, Jason Merrill wrote: > > This name is confusing wrt warn_builtin_macro_redefined; since it seems to > > be used internally to suppress the warning, maybe call it > > suppress_builtin_macro_war

[PATCH] c++: Implement __builtin_structured_binding_size trait

2025-08-15 Thread Jakub Jelinek
Hi! clang++ apparently added a SFINAE-friendly __builtin_structured_binding_size trait to return the structured binding size (or error if not in SFINAE contexts if a type doesn't have a structured binding size). The expansion statement patch already anticipated this through adding complain argume

Re: [PATCH] fixincludes: skip stdio_stdarg_h on modern darwin

2025-08-15 Thread FX Coudert
> Yes OK, > great - the more we can remove the better. Applied on top the attached patch, okay’ed by Iain in private exchanges, as it turns out that my earlier fix broke bootstrap with MacOSX12.3 SDK. Pushed as e905d7ee2bd428a9a31a993053a8da926733fb61, after testing on x86_64-darwin24, x86_64

Re: [PATCH] c++: Add testcases for the defarg part of P1766R1 [PR121552]

2025-08-15 Thread Jason Merrill
On 8/15/25 3:38 AM, Jakub Jelinek wrote: Hi! The following patch adds some testcases for the default argument (function and template) part of the paper, making sure we diagnose multiple defargs in the same TU and when visible in modules and DTRT when some aren't visible and some are visible and

Re: [PATCH] AArch64: Add isinf expander [PR 66462]

2025-08-15 Thread Kyrylo Tkachov
> On 13 Aug 2025, at 17:34, Richard Sandiford wrote: > > Wilco Dijkstra writes: >> Add an expander for isinf using integer arithmetic. This is >> typically faster and avoids generating spurious exceptions on >> signaling NaNs. >> >> int isinf1 (float x) { return __builtin_isinf (x); } >> >

Re: [PATCH] c++, v3: Warn on #undef/#define of remaining cpp.predefined macros [PR120778]

2025-08-15 Thread Jakub Jelinek
On Fri, Aug 15, 2025 at 10:46:04AM -0400, Jason Merrill wrote: > This name is confusing wrt warn_builtin_macro_redefined; since it seems to > be used internally to suppress the warning, maybe call it > suppress_builtin_macro_warning? Or allow_... if you don't want to reverse > the sense? Ok, will

Re: [PATCH] c++, v3: Warn on #undef/#define of remaining cpp.predefined macros [PR120778]

2025-08-15 Thread Jason Merrill
On 8/15/25 1:35 AM, Jakub Jelinek wrote: On Thu, Aug 14, 2025 at 01:32:18PM -0400, Jason Merrill wrote: Could we suppress warnings for all builtin_define instead of specifically for these names? Ok, done for cpp_define/_cpp_define_builtin/cpp_undef now, so neither the rs6000-c.cc patch nor cha

Re: [PATCH] c++: Fix default argument parsing in non-comma variadic methods [PR121539]

2025-08-15 Thread Jason Merrill
On 8/14/25 1:21 PM, Jakub Jelinek wrote: Hi! While the non-comma variadic functions/methods were deprecated in C++26, they are still valid and they are valid without deprecation in C++98 to C++23. We parse default arguments followed by ...) outside of classes or for out of class definitions of m

Re: [PATCH] c++: Implement C++20 P1766R1 - Mitigating minor modules maladies [PR121552]

2025-08-15 Thread Jason Merrill
On 8/14/25 1:27 PM, Jakub Jelinek wrote: Hi! The following patch attempts to implement the C++20 P1766R1 - Mitigating minor modules maladies paper. clang++ a few years ago introduced for the diagnostics required in the paper -Wnon-c-typedef-for-linkage pedwarn and the following patch does that t

Re: [PATCH v3] RISC-V: MIPS prefetch extensions for MIPS RV64 P8700 and can be enabled with xmipscbop.

2025-08-15 Thread Umesh Kalappa
Thank you @Jeff Law and noted the suggestions and will follow the same . ~U On Fri, Aug 15, 2025 at 7:07 PM Jeff Law wrote: > > > On 8/15/25 3:00 AM, Umesh Kalappa wrote: > > Addressed the comments and tested "runtest --tool gcc > --target_board='riscv-sim/-march=rv64gc_zba_zbb_zbc_zbs/-mabi=

Re: [PATCH v3] RISC-V: MIPS prefetch extensions for MIPS RV64 P8700 and can be enabled with xmipscbop.

2025-08-15 Thread Jeff Law
On 8/15/25 3:00 AM, Umesh Kalappa wrote: Addressed the comments and tested "runtest --tool gcc --target_board='riscv-sim/-march=rv64gc_zba_zbb_zbc_zbs/-mabi=lp64/-mcmodel=medlow' riscv.exp" and 32 bit too lint warnings can be ignored for riscv-ext.opt. gcc/ChangeLog: * config/risc

[pushed] testsuite: Add a test for [PR119156]

2025-08-15 Thread Richard Sandiford
PR119156 was fixed by g:f702b593e7268ab161053bafd097f1b09933b783. This patch adds a test for it. Tested on aarch64-linux-gnu & pushed as (hopefully) obvious. Richard gcc/testsuite/ PR target/119156 * gcc.target/aarch64/sve/pr119156_1.c: New test. --- gcc/testsuite/gcc.target/aa

Re: [PATCH v2] RISC-V: fix __builtin_round clobbering FP exceptions flags [PR121534]

2025-08-15 Thread Jeff Law
On 8/14/25 6:32 PM, Vineet Gupta wrote: Changes since v1: - Fix scan pattern for math-nearbyint-1.c - Per Andrew's suggestion gate flag save/restore on -ftrapping-math Still failing CI: https://github.com/ewlu/gcc-precommit-ci/issues/3776#issuecomment-3190438630

Re: [PATCH] RISC-V: Allow errors to be suppressed when parsing architectures

2025-08-15 Thread Richard Sandiford
Kito Cheng writes: > Yeah, I am OK with this change, although riscv_subset_t may be able to > do further clean up/refactor, but I don't want to block you guys since > this is not super rush to do that. Thanks! Now pushed. The precommit CI seems to be struggling at the moment, so please let me k

Re: [PATCH v4 1/2] RISC-V: Fix can_find_related_mode_p for VLS type

2025-08-15 Thread Jeff Law
On 8/15/25 12:33 AM, Kito Cheng wrote: can_find_related_mode_p didn't handle VLS type correctly, and the root cause is TARGET_MIN_VLEN is in bits, but what we want is in bytes. Changes since v2: - Use else_void rather than require for opt_machine_mode. Still failing CI: https://github.com/

Re: [PATCH v9 13/13] FMV: Redirect to specific target

2025-08-15 Thread Richard Sandiford
LGTM, but a minor suggestion below: writes: > @@ -423,61 +423,100 @@ expand_target_clones (struct cgraph_node *node, bool > definition) >return true; > } > > -/* When NODE is a target clone, consider all callees and redirect > - to a clone with equal target attributes. That prevents mu

Re: [PATCH v2] x86: Add target("80387") function attribute

2025-08-15 Thread H.J. Lu
On Fri, Aug 15, 2025 at 12:44 AM Hongtao Liu wrote: > > On Fri, Aug 15, 2025 at 10:07 AM H.J. Lu wrote: > > > > Add target("80387") attribute to enable and disable x87 instructions in a > > function. > > > > gcc/ > > > > PR target/121541 > > * config/i386/i386-options.cc > >

Re: [PATCH v9 04/13] fmv: Add check_target_clone hook for filtering target_clone versions.

2025-08-15 Thread Richard Sandiford
writes: > From: Alfie Richards > > This patch introduces the TARGET_CHECK_TARGET_CLONE_VERSION hook > which is used to determine if a target_clones version string parses. > > The hook has a flag to enable emitting diagnostics. > > This is as specified in the Arm C Language Extension. The purpose

Re: [PATCH][13 BACKPORT] AArch64: Fix invalid immediate offsets in SVE gather/scatter [PR121449]

2025-08-15 Thread Richard Sandiford
Pengfei Li writes: > Hi, > > This patch backports the fix of r16-3083 to gcc-13. > > Compared to the trunk version, this is slightly different because those RTL > patterns in gcc-13 do not yet use the compact syntax for multiple > alternatives. > But this patch is functionally identical to the tr

Re: [PATCH v2] AArch64: Fix invalid immediate offsets in SVE gather/scatter [PR121449]

2025-08-15 Thread Richard Sandiford
Pengfei Li writes: >> I’d also ask for a slightly more descriptive sentence like “Use vg >> constraint for alternative so-and-so”. >> Ok to push whatever reword you come up with. > > This has been committed to trunk as r16-3083 for about one week. I wonder if I > could consider backporting it now

[PATCH] c++: Add testcases for the defarg part of P1766R1 [PR121552]

2025-08-15 Thread Jakub Jelinek
Hi! The following patch adds some testcases for the default argument (function and template) part of the paper, making sure we diagnose multiple defargs in the same TU and when visible in modules and DTRT when some aren't visible and some are visible and they are equal. Not testing when they are

Re: [PATCH] libstdc++: Fix-self element self-assigments when insertint an empty range [PR121313]

2025-08-15 Thread Jonathan Wakely
Maybe we should add a non-overlapping assertion to that algo (and similar ones). For random access iterators we can check the full precondition, otherwise just check that the iterator for the output range isn't equal to the bound of the input range. On Thu, 14 Aug 2025, 14:30 Tomasz Kamiński, wro

Re: [PATCH] libstdc++: Fix-self element self-assigments when insertint an empty range [PR121313]

2025-08-15 Thread Jonathan Wakely
On Thu, 14 Aug 2025, 15:31 Patrick Palka, wrote: > On Thu, 14 Aug 2025, Tomasz Kamiński wrote: > > Typo in subject line, "inserting" > > > For __n == 0, the elements where self move-assigned by > > std::move_backward(__ins, __old_finish - __n, __old_finish). > > s/where/were? > > LGTM besides tha

[PATCH][13 BACKPORT] AArch64: Fix invalid immediate offsets in SVE gather/scatter [PR121449]

2025-08-15 Thread Pengfei Li
Hi, This patch backports the fix of r16-3083 to gcc-13. Compared to the trunk version, this is slightly different because those RTL patterns in gcc-13 do not yet use the compact syntax for multiple alternatives. But this patch is functionally identical to the trunk fix. Bootstrapped and regteste

Re: [PATCH v2] AArch64: Fix invalid immediate offsets in SVE gather/scatter [PR121449]

2025-08-15 Thread Pengfei Li
Hi Reviewers, > I’d also ask for a slightly more descriptive sentence like “Use vg > constraint for alternative so-and-so”. > Ok to push whatever reword you come up with. This has been committed to trunk as r16-3083 for about one week. I wonder if I could consider backporting it now. The change

[PATCH v3] RISC-V: MIPS prefetch extensions for MIPS RV64 P8700 and can be enabled with xmipscbop.

2025-08-15 Thread Umesh Kalappa
Addressed the comments and tested "runtest --tool gcc --target_board='riscv-sim/-march=rv64gc_zba_zbb_zbc_zbs/-mabi=lp64/-mcmodel=medlow' riscv.exp" and 32 bit too lint warnings can be ignored for riscv-ext.opt. gcc/ChangeLog: * config/riscv/riscv-ext-mips.def (DEFINE_RISCV_EXT):

Re: [PATCH 4/7 v3] RISC-V: Add support for the XAndesvbfhcvt ISA extension.

2025-08-15 Thread KuanLin Chen
Hi Kito, I found there is new intrinsic format support 'vl' in XAndesvbfhcvt. I used the old format in this patch. I'll fix it in next version. Thanks for your help. Kito Cheng 於 2025年8月12日 週二 下午6:00寫道: > > I would say no to this one since it seems apparently not right due to > its lack of corre

[PATCH] c++, v3: Warn on #undef/#define of remaining cpp.predefined macros [PR120778]

2025-08-15 Thread Jakub Jelinek
On Thu, Aug 14, 2025 at 01:32:18PM -0400, Jason Merrill wrote: > Could we suppress warnings for all builtin_define instead of specifically > for these names? Ok, done for cpp_define/_cpp_define_builtin/cpp_undef now, so neither the rs6000-c.cc patch nor changes in i386-c.cc are needed. On Thu, Au

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

2025-08-15 Thread Umesh Kalappa
Thank you @Jeff Law for your time and updated the patch and reposted the changes. Good Day, ~U On Fri, Aug 15, 2025 at 8:11 AM Jeff Law wrote: > > > On 7/16/25 10:54 PM, Umesh Kalappa wrote: > > Fixed the regress that caused "pr118241.c" failure and tested "runtest > --tool gcc > --target_boa

[PATCH v3] RISC-V: MIPS prefetch extensions for MIPS RV64 P8700 and can be enabled with xmipscbop.

2025-08-15 Thread Umesh Kalappa
Addressed the comments and tested "runtest --tool gcc --target_board='riscv-sim/-march=rv64gc_zba_zbb_zbc_zbs/-mabi=lp64/-mcmodel=medlow' riscv.exp" and 32 bit too lint warnings can be ignored for riscv-ext.opt. gcc/ChangeLog: * config/riscv/riscv-ext-mips.def (DEFINE_RISCV_EXT):

Re: [PATCH v2] x86: Add target("80387") function attribute

2025-08-15 Thread Hongtao Liu
On Fri, Aug 15, 2025 at 10:07 AM H.J. Lu wrote: > > Add target("80387") attribute to enable and disable x87 instructions in a > function. > > gcc/ > > PR target/121541 > * config/i386/i386-options.cc > (ix86_valid_target_attribute_inner_p): Add target("80387") > att

[PATCHv8] libstdc++: Add generate_canonical impl (P0952, LWG2524) [PR119739]

2025-08-15 Thread Nathan Myers
Changes in v8: * Apply LWG 2524 resolution to C++11..C++23 implementations, too. * In those, eliminate std::log called twice per entry, and do all setup calculations at compile time. * "if constexpr" the C++26 version to call the slightly-faster older version when conditions permit: actually