[PATCH] x86: Extend the remove_redundant_vector pass

2025-06-02 Thread H.J. Lu
Extend the remove_redundant_vector pass to handle vector broadcasts from constant and variable scalars. When broadcasting from constants and function arguments, we can place a single widest vector broadcast at entry of the nearest common dominator for basic blocks with all uses since constants and

[committed] libgomp: Fix up omp_target_memset-3.c test for C++ [PR120444]

2025-06-02 Thread Jakub Jelinek
Hi! The test PASSes for C, but FAILs for C++: .../libgomp.c-c++-common/omp_target_memset-3.c: In function 'void test_it(void*, int, size_t)': .../libgomp.c-c++-common/omp_target_memset-3.c:31:7: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith] .../libgomp.c-c++-common/omp_t

[PATCH] gcc: middle-end opt for trigonometric pi-based functions builtins

2025-06-02 Thread Yuao Ma
Hi Joseph, > I don't see tests for the various special cases from Annex F (for example, > "tanpi(n) returns +0, for positive even and negative odd integers n." and > "tanpi(n) returns -0, for positive odd and negative even integers n."). > In such cases the sign of zero would need to be checked sp

Re: [PATCH] phiprop: Add testcase for already fixed case [PR116824]

2025-06-02 Thread Richard Biener
> Am 03.06.2025 um 05:59 schrieb Andrew Pinski : > > This testcase was fixed by r16-906-g8da568c885dc90. Since > this is a C testcase, it would be useful to have a C testcase besides > a C++ one too. > > Tested for x86_64-linux-gnu. Ok Richard >PR tree-optimization/116824 > > gcc/tes

Re: [PATCH] switch-conversion: Mark CSWTCH as mergeable [PR120451]

2025-06-02 Thread Richard Biener
> Am 03.06.2025 um 04:51 schrieb Andrew Pinski : > > When we have a smallish CSWTCH, it could be placed in the rodata.cst16 > section so it can be merged with other constants across TUs. > > The fix is simple; just mark the decl as mergable (DECL_MERGEABLE). > DECL_MERGEABLE was added with r1

[PATCH] switch-conversion: Mark CSWTCH as mergeable [PR120451]

2025-06-02 Thread Andrew Pinski
When we have a smallish CSWTCH, it could be placed in the rodata.cst16 section so it can be merged with other constants across TUs. The fix is simple; just mark the decl as mergable (DECL_MERGEABLE). DECL_MERGEABLE was added with r14-1500-g4d935f52b0d5c0 specifically to improve these kind of decls

[PATCH] phiprop: Add testcase for already fixed case [PR116824]

2025-06-02 Thread Andrew Pinski
This testcase was fixed by r16-906-g8da568c885dc90. Since this is a C testcase, it would be useful to have a C testcase besides a C++ one too. Tested for x86_64-linux-gnu. PR tree-optimization/116824 gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/phiprop-2.c: New test. Signed-off-b

Re: [PATCH] RISC-V: Support CPUs in -march.

2025-06-02 Thread Kito Cheng
I am a little hesitant about whether to let -march implicitly set -mtune, because this is equivalent to making -march become another -mcpu with higher priority, and we cannot avoid discussing the priority of -march and -mtune again, and no matter what the priority is, it will introduce more complic

Re: [PATCH v2] RISC-V: Add svbare extension.

2025-06-02 Thread Jeff Law
On 6/2/25 7:34 PM, Kito Cheng wrote: LGTM, and will commit once CI happy, BTW, next time you could name the testcase into arch-.c e.g. arch-svbare.c, that could prevent potential filename conflict. :) Yea, I nearly made a similar suggestion. Not sure why we're using numeric suffixes here. T

Re: [PATCH] RISC-V: Add svbare extension.

2025-06-02 Thread Dongyan Chen
I add a ChangeLog and update testname in https://gcc.gnu.org/pipermail/gcc-patches/2025-June/685401.html Thanks Dongyan Chen 在 2025/6/3 3:34, Jeff Law 写道: On 5/29/25 7:27 AM, Dongyan Chen wrote: This patch support svbare extension, which is an extension in RVA23 profile. To enable GCC to

Re: [PATCH v2] RISC-V: Add svbare extension.

2025-06-02 Thread Dongyan Chen
Okay, thanks, I get that. Dongyan Chen 在 2025/6/3 9:34, Kito Cheng 写道: LGTM, and will commit once CI happy, BTW, next time you could name the testcase into arch-.c e.g. arch-svbare.c, that could prevent potential filename conflict. :)

Re: [PATCH] c++: Fix template class lookup [PR120495, PR115605].

2025-06-02 Thread Jason Merrill
On 6/2/25 6:28 PM, Iain Sandoe wrote: Tested on x86_64-darwin and powerpc64le so far, how does this look? thanks Iain --- 8< --- Using lookup_template_class () directly on the coroutine_handle identifier fails in the reported test because the using TYPE_DECL is found. This is because lookup i

Re: [PATCH v2] c++, coroutines: CWG2563 promise lifetime extension [PR115908].

2025-06-02 Thread Jason Merrill
On 6/2/25 5:27 PM, Iain Sandoe wrote: On 2 Jun 2025, at 21:17, Jason Merrill wrote: On 6/1/25 3:30 AM, Iain Sandoe wrote: Updated. I realised we no longer need to refer to initial_await_resume_called in the ramp at all, v2 removes the setting of the variable from there and puts it into the

Re: [PATCH v2] RISC-V: Add svbare extension.

2025-06-02 Thread Kito Cheng
LGTM, and will commit once CI happy, BTW, next time you could name the testcase into arch-.c e.g. arch-svbare.c, that could prevent potential filename conflict. :) On Tue, Jun 3, 2025 at 9:22 AM Dongyan Chen wrote: > > This patch support svbare extension, which is an extension in RVA23 profile. >

[PATCH v2] RISC-V: Add svbare extension.

2025-06-02 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/ChangeLog: * config/riscv/riscv-ext.def: New extension defs. * config/riscv/riscv-ext.opt: Ditto. * doc/risc

[PATCH] c++: Fix template class lookup [PR120495, PR115605].

2025-06-02 Thread Iain Sandoe
Tested on x86_64-darwin and powerpc64le so far, how does this look? thanks Iain --- 8< --- Using lookup_template_class () directly on the coroutine_handle identifier fails in the reported test because the using TYPE_DECL is found. This is because lookup is called with default parameters that me

Re: [PATCH] Always add REG_CALL_DECL note for CALL

2025-06-02 Thread H.J. Lu
On Tue, Jun 3, 2025 at 6:06 AM H.J. Lu wrote: > > On Mon, Jun 2, 2025 at 4:45 PM Richard Sandiford > wrote: > > > > "H.J. Lu" writes: > > > On Mon, Jun 2, 2025 at 4:07 PM Richard Sandiford > > > wrote: > > >> > > >> "H.J. Lu" writes: > > >> > Since not all CALL instructions in RTL passes have

Re: [PATCH] gcc: middle-end opt for trigonometric pi-based functions builtins

2025-06-02 Thread Tobias Burnus
Joseph Myers wrote: On Sun, 1 Jun 2025, Yuao Ma wrote: For MPFR versions older than 4.2.0, we've included our own folding functions. I think the normal practice in GCC would be to avoid the optimizations when the MPFR support is absent, instead of working around the absence with possibly less a

[PATCH] Always add REG_CALL_DECL note for CALL

2025-06-02 Thread H.J. Lu
On Mon, Jun 2, 2025 at 4:45 PM Richard Sandiford wrote: > > "H.J. Lu" writes: > > On Mon, Jun 2, 2025 at 4:07 PM Richard Sandiford > > wrote: > >> > >> "H.J. Lu" writes: > >> > Since not all CALL instructions in RTL passes have a REG_CALL_DECL note, > >> > update get_call_fndecl to also check f

Re: [PATCH v2] c++, coroutines: CWG2563 promise lifetime extension [PR115908].

2025-06-02 Thread Iain Sandoe
> On 2 Jun 2025, at 21:17, Jason Merrill wrote: > > On 6/1/25 3:30 AM, Iain Sandoe wrote: >> Updated. I realised we no longer need to refer to >> initial_await_resume_called in the ramp at all, v2 removes the setting >> of the variable from there and puts it into the start of the actor. >> Tes

[PATCH] c/c++: Handle '#pragma GCC target optimize' early [PR48026]

2025-06-02 Thread Andrew Pinski
From: Gwenole Beauchesne Handle '#pragma GCC optimize' earlier as the __OPTIMIZE__ macro may need to be defined as well for certain usages. Add additional tests for the '#pragma GCC target' case with auto-vectorization enabled and multiple combinations of namespaces and/or class member functions.

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

2025-06-02 Thread Dimitar Dimitrov
On Thu, May 29, 2025 at 05:59:44PM +0100, Richard Sandiford wrote: > Sorry for the slow reply. > > Dimitar Dimitrov writes: > > On Fri, May 16, 2025 at 06:14:30PM +0100, Richard Sandiford wrote: > >> Dimitar Dimitrov writes: ... > >> It might still be worth trying to use simplify_subreg_regno an

Re: [PATCH] RISC-V: Support CPUs in -march.

2025-06-02 Thread Palmer Dabbelt
On Mon, 02 Jun 2025 12:35:45 PDT (-0700), Robin Dapp wrote: I don't quite follow this part. IIUC the rules before this patch were -march=ISA: Generate code that requires the given ISA, without changing the tuning model. -mcpu=CPU: Generate code for the given CPU, targeting all the

[PATCH] libstdc++: Use new __is_destructible built-in in

2025-06-02 Thread Jonathan Wakely
libstdc++-v3/ChangeLog: * include/std/type_traits (is_destructible, is_destructible_v): Define using new built-in. (is_nothrow_destructible, is_nothrow_destructible_v): Likewise. (is_trivially_destructible, is_trivially_destructible_v): Likewise. --- Thanks

Re: [PATCH v2] c++, coroutines: CWG2563 promise lifetime extension [PR115908].

2025-06-02 Thread Jason Merrill
On 6/1/25 3:30 AM, Iain Sandoe wrote: Updated. I realised we no longer need to refer to initial_await_resume_called in the ramp at all, v2 removes the setting of the variable from there and puts it into the start of the actor. Tested on x86_64-darwin and powerp64le-linux. Confirmed that the sani

[PATCH] libstdc++: Fix errors in atomic timed waiting functions

2025-06-02 Thread Jonathan Wakely
These function templates are apparently never used or instantiated, because they don't compile. This fixes them, but they're still unused. I plan to make use of them in a later commit. libstdc++-v3/ChangeLog: * include/bits/atomic_timed_wait.h (__atomic_wait_address_until_v): Do n

Re: DEFAULT_PCC_STRUCT_RETURN on NetBSD vs Linux

2025-06-02 Thread John Paul Adrian Glaubitz
On Mon, 2025-06-02 at 17:34 +0200, Andreas Schwab wrote: > On Jun 01 2025, John Paul Adrian Glaubitz wrote: > > > I was talking about the comments, not the code since NetBSD and Linux > > disagree on what the SVR4 ABI claims. > > In which way? Both NetBSD and Linux return structs differently, ye

[committed] cobol: Honor HAVE_CLOCK_GETTIME and HAVE_GETTIMEOFDAY. [PR119975]

2025-06-02 Thread Robert Dubner
These changes cause genapi.cc to use whichever of clock_gettime() or gettimeofday() are available. This prevents compilation errors on systems where clock_gettime() is not available. gcc/cobol/ChangeLog: PR cobol/119975 * genapi.cc (parser_intrinsic_call_0

Re: [Patch] libgomp.texi (omp_interop_*): Add note about 5.2-to-6.0 incompatibility

2025-06-02 Thread Sandra Loosemore
On 6/2/25 12:15, Tobias Burnus wrote: Not really new - but as the topic came up elsewhere (OpenMP issue 4455), I had a second thought about this and I think it make sense to add a note. GCC uses the OpenMP 6.0 version. The problem is that 'int'/'int*' became 'omp_interop_rc_t ret_code' and 'omp

Re: [PATCH] c: Enable -Wjump-misses-init in -Wextra and -Wc++-compat [PR87038]

2025-06-02 Thread Segher Boessenkool
Hi! On Mon, Jun 02, 2025 at 08:37:19PM +0200, Martin Uecker wrote: > Am Montag, dem 02.06.2025 um 13:19 -0500 schrieb Segher Boessenkool: > > On Mon, Jun 02, 2025 at 05:50:08PM +0200, Martin Uecker wrote: > > > According to the discussion in the bugzilla there seems to be > > > some consensus to a

Re: DEFAULT_PCC_STRUCT_RETURN on NetBSD vs Linux

2025-06-02 Thread John Paul Adrian Glaubitz
On Mon, 2025-06-02 at 21:41 +0200, Andreas Schwab wrote: > On Jun 02 2025, John Paul Adrian Glaubitz wrote: > > > To me both statements seem to contradict each other. > > How? They comment two different things. But it's DEFAULT_PCC_STRUCT_RETURN in both cases, no? Adrian -- .''`. John Paul

Re: [Fortran, Patch, PR120483, v1] Fix wrong type of saved allocatable strings.

2025-06-02 Thread Thomas Koenig
Hi Andre, attached patch fixes a missing substring ref on a saved allocatable string. The issue seems to be, that the variable is declared to be a character pointer and not a character array. When using the latter (why not), it works as expected and does not produce any regressions. Regtests o

[pushed] c++: more __is_destructible fixes [PR107600]

2025-06-02 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- PR c++/107600 gcc/cp/ChangeLog: * method.cc (destructible_expr): Fix refs and arrays of unknown bound. gcc/testsuite/ChangeLog: * g++.dg/ext/is_destructible2.C: Add more cases. --- gcc/cp/method.cc

Re: DEFAULT_PCC_STRUCT_RETURN on NetBSD vs Linux

2025-06-02 Thread Andreas Schwab
On Jun 02 2025, John Paul Adrian Glaubitz wrote: > To me both statements seem to contradict each other. How? They comment two different things. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely di

Re: [PATCH] RISC-V: Add Shlcofideleg extension.

2025-06-02 Thread Jeff Law
On 5/27/25 1:32 AM, Jiawei wrote: This patch add the RISC-V Shlcofideleg extension. It supports delegating LCOFI interrupts(the count-overflow interrupts) to VS-mode.[1] [1] https://riscv.github.io/riscv-isa-manual/snapshot/privileged gcc/ChangeLog: * config/riscv/riscv-ext.def: New

Re: [PATCH] RISC-V: Support CPUs in -march.

2025-06-02 Thread Robin Dapp
I don't quite follow this part. IIUC the rules before this patch were -march=ISA: Generate code that requires the given ISA, without changing the tuning model. -mcpu=CPU: Generate code for the given CPU, targeting all the extensions that CPU supports and using the best known tu

Re: [PATCH] c: Enable -Wjump-misses-init in -Wextra and -Wc++-compat [PR87038]

2025-06-02 Thread Joseph Myers
On Mon, 2 Jun 2025, Martin Uecker wrote: > Am Montag, dem 02.06.2025 um 18:45 + schrieb Joseph Myers: > > On Mon, 2 Jun 2025, Martin Uecker wrote: > > > > > According to the discussion in the bugzilla there seems to be > > > some consensus to activate the warning for -Wextra (I am also > > >

Re: [PATCH] RISC-V: Add svbare extension.

2025-06-02 Thread Jeff Law
On 5/29/25 7:27 AM, Dongyan Chen wrote: 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. Needs a ChangeLog entry and the testname needs to be updated now that arch-59 is taken. Wit

Re: [PATCH] RISC-V: Add smcntrpmf extension.

2025-06-02 Thread Jeff Law
On 5/29/25 5:44 AM, Dongyan Chen wrote: 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 def

Re: [PATCH] c: Enable -Wjump-misses-init in -Wextra and -Wc++-compat [PR87038]

2025-06-02 Thread Martin Uecker
Am Montag, dem 02.06.2025 um 18:45 + schrieb Joseph Myers: > On Mon, 2 Jun 2025, Martin Uecker wrote: > > > According to the discussion in the bugzilla there seems to be > > some consensus to activate the warning for -Wextra (I am also > > looking into implementing the suggested improvements t

Re: [PATCH] Move get_call_rtx_from to final.c

2025-06-02 Thread Jeff Law
On 6/1/25 1:12 AM, H.J. Lu wrote: Move get_call_rtx_from to final.c and call call_from_call_insn. PR other/120493 * final.cc (call_from_call_insn): Change the argument type to const rtx_call_insn *. (get_call_rtx_from): New. * rtl.h (is_a_helper ::test): New. (get_call_rtx_from): Moved to the

Re: [PATCH] RISC-V: Support CPUs in -march.

2025-06-02 Thread Palmer Dabbelt
On Sun, 01 Jun 2025 22:18:21 PDT (-0700), Robin Dapp wrote: This rule clearly applies to directly related options like -ffoo and -fno-foo, but it’s less obvious for unrelated pairs like -ffoo and -fbar especially when there is traditionally strong specifics. In many cases, the principle of "

[pushed] c++: constinit diagnostic regression [PR120506]

2025-06-02 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- In r16-57 I thought it was unnecessary to mention incomplete initialization after another diagnostic, but actually it's useful elaboration. PR c++/120506 gcc/cp/ChangeLog: * constexpr.cc (cxx_eval_outermost_constant_expr):

Re: [Fortran, Patch, PR120483, v1] Fix wrong type of saved allocatable strings.

2025-06-02 Thread Andre Vehreschild
Hi Thomas, thanks for the ok. Unfortunately does the patch regress in gomp (test case gomp/pr104382 when I am not mistaken ; the one with the lone 'save' statement). This was reported by the regression testing host at first for arm, but also occurs on x86_64. Since when are proposed patches ch

Re: [PATCH] c: fix ICE with enum completed with packed attribute after forward decl [PR116892]

2025-06-02 Thread Joseph Myers
On Mon, 2 Jun 2025, Martin Uecker wrote: > I *believe* TYPE_PACKED should be propagated to existing main > variants. > > > Bootstrapped and regression tested for x86_64. > > Martin > > > c: fix ICE with enum completed with packed attribute after forward decl > [PR116892] > > Aft

Re: [PATCH] c: Enable -Wjump-misses-init in -Wextra and -Wc++-compat [PR87038]

2025-06-02 Thread Joseph Myers
On Mon, 2 Jun 2025, Martin Uecker wrote: > According to the discussion in the bugzilla there seems to be > some consensus to activate the warning for -Wextra (I am also > looking into implementing the suggested improvements that may > make it suitable fo r-Wall). When making this change, I also

Re: [PING * 3][PATCH v3] Add new warning Wmissing-designated-initializers [PR39589]

2025-06-02 Thread Joseph Myers
On Sun, 1 Jun 2025, Peter Frost wrote: > Ping https://gcc.gnu.org/pipermail/gcc-patches/2025-January/672568.html This needs various coding style fixes. Lines should be broken before binary operators such as && or || rather than after, and there should be a space before '(' in function and macr

Re: [PATCH] c: Enable -Wjump-misses-init in -Wextra and -Wc++-compat [PR87038]

2025-06-02 Thread Martin Uecker
Am Montag, dem 02.06.2025 um 13:19 -0500 schrieb Segher Boessenkool: > Hi! > > On Mon, Jun 02, 2025 at 05:50:08PM +0200, Martin Uecker wrote: > > According to the discussion in the bugzilla there seems to be > > some consensus to activate the warning for -Wextra (I am also > > looking into impleme

[committed] libstdc++: Remove spaces before function parameter list

2025-06-02 Thread Jonathan Wakely
We don't use this GCC coding convention in libstdc++. libstdc++-v3/ChangeLog: * include/bits/basic_string.h (basic_string::size): Remove space before parameter list. (basic_string::capacity): Likewise. * include/bits/stl_deque.h (deque::size): Likewise. * i

[Patch] libgomp.texi (omp_interop_*): Add note about 5.2-to-6.0 incompatibility

2025-06-02 Thread Tobias Burnus
Not really new - but as the topic came up elsewhere (OpenMP issue 4455), I had a second thought about this and I think it make sense to add a note. GCC uses the OpenMP 6.0 version. The problem is that 'int'/'int*' became 'omp_interop_rc_t ret_code' and 'omp_interop_rc_t *ret_code'. For C++, pas

Re: [PATCH] c: Move checking assertions from recursion when forming composite types to avoid ICE.

2025-06-02 Thread Joseph Myers
On Sun, 1 Jun 2025, Martin Uecker wrote: > This patch now moves the checking assertion out of the recursion, > which seems better anyhow. I could not do the check unconditionally > for all types. because we sometimes call composite_type for with > mismatching qualifiers. Calling composite_type wi

Re: [PATCH] c: Enable -Wjump-misses-init in -Wextra and -Wc++-compat [PR87038]

2025-06-02 Thread Segher Boessenkool
Hi! On Mon, Jun 02, 2025 at 05:50:08PM +0200, Martin Uecker wrote: > According to the discussion in the bugzilla there seems to be > some consensus to activate the warning for -Wextra (I am also > looking into implementing the suggested improvements that may > make it suitable fo r-Wall). When m

[PATCH] libstdc++: Replace some implicit conversions in std::vector

2025-06-02 Thread Jonathan Wakely
This replaces two implicit conversions from ptrdiff_t to size_t with explicit conversions that include unreachable hints for the ptrdiff_t value not being negative. libstdc++-v3/ChangeLog: * include/bits/stl_vector.h (~_Vector_base): Add unreachable hint for negative capacity and

Re: DEFAULT_PCC_STRUCT_RETURN on NetBSD vs Linux

2025-06-02 Thread John Paul Adrian Glaubitz
On Mon, 2025-06-02 at 19:44 +0200, Andreas Schwab wrote: > On Jun 02 2025, John Paul Adrian Glaubitz wrote: > > > Both NetBSD and Linux return structs differently, yet the comments in the > > source code claim their way is according to the m68k SVR4 specification. > > Where does it claim that? l

Re: DEFAULT_PCC_STRUCT_RETURN on NetBSD vs Linux

2025-06-02 Thread Andreas Schwab
On Jun 02 2025, John Paul Adrian Glaubitz wrote: > Both NetBSD and Linux return structs differently, yet the comments in the > source code claim their way is according to the m68k SVR4 specification. Where does it claim that? -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 E

Re: [PATCH] gcc: middle-end opt for trigonometric pi-based functions builtins

2025-06-02 Thread Joseph Myers
On Sun, 1 Jun 2025, Yuao Ma wrote: > For MPFR versions older than 4.2.0, we've included our own folding functions. I think the normal practice in GCC would be to avoid the optimizations when the MPFR support is absent, instead of working around the absence with possibly less accurate implementa

Re: [PATCH] c++,coroutines: Lookup coroutine_handle template [PR120495].

2025-06-02 Thread Iain Sandoe
> On 2 Jun 2025, at 17:10, Andrew Pinski wrote: > > On Mon, Jun 2, 2025 at 8:17 AM Jason Merrill wrote: >> >> On 6/2/25 5:13 AM, Iain Sandoe wrote: >>> Tested on x86_64-darwin, OK for trunk? >>> thanks >>> Iain >>> >>> --- 8< --- >>> >>> Using lookup_template_class () directly on the corou

[PATCH] libstdc++: Use explicit cast to unsigned in std::rotr and std::rotl

2025-06-02 Thread Jonathan Wakely
This suppresses some -Wsign-conversion warnings from Clang when compiling with -Wsystem-headers. libstdc++-v3/ChangeLog: * include/std/bit (__rotl, __rotr): Use static_cast for conversion from int to unsigned. --- Tested x86_64-linux. libstdc++-v3/include/std/bit | 4 ++-- 1 fi

[PATCH] libstdc++: Remove redundant macro checks in std.cc.in

2025-06-02 Thread Jonathan Wakely
__cpp_lib_any and __cpp_lib_chrono are defined unconditionally in C++20 and __cpp_lib_three_way_comparison and __cpp_lib_concepts depend on front-end features which are definitely supported by GCC trunk. libstdc++-v3/ChangeLog: * src/c++23/std.cc.in: Remove redundant checks for feature te

[PATCH] libstdc++: Fix incorrect comments on atomic timed waits

2025-06-02 Thread Jonathan Wakely
The __detail::__wait_until function has a comment that should have been removed when r16-1000-g225622398a9631 changed the return type from a std::pair to a struct with three members. __atomic_wait_address_until_v returns __res.first which should have been changed when __res was no longer a std::pa

Re: RISC-V frm mode switching and late_combine2

2025-06-02 Thread Vineet Gupta
Hi Richard, On 6/2/25 01:27, Richard Sandiford wrote: > Vineet Gupta writes: >> +CC gcc-patches >> >> On 5/30/25 14:04, Vineet Gupta wrote: >>> Hi Jeff, Richard >>> >>> As part of RISC-V FRM mode switching improvements, I'm running into a >>> behavior >>> in late_combine2 where it is eliminating

Re: [PATCH 02/14] aarch64: Add support for unpacked SVE FP conversions

2025-06-02 Thread Alfie Richards
On 02/06/2025 11:06, Spencer Abson wrote: This patch introduces expanders for FP<-FP conversions that levarage partial vector modes. We also extend the INT<-FP and FP<-INT conversions using the same approach. The ACLE enables vectorized conversions like the following: fcvt z0.h, p7/m, z1.s Mo

Re: [PATCH] Add newlib to gitignore

2025-06-02 Thread Arijit Kumar Das
> Umm, I don't think so. I've been building crosses with gcc for decades. > It should not be necessary, though it may sometimes be convenient. > > If you feel there's a strong need, then you're going to have to make a > better case than what you've done above. Specifically you'd need to > start wi

Re: DEFAULT_PCC_STRUCT_RETURN on NetBSD vs Linux

2025-06-02 Thread Andreas Schwab
On Jun 01 2025, John Paul Adrian Glaubitz wrote: > I was talking about the comments, not the code since NetBSD and Linux > disagree on what the SVR4 ABI claims. In which way? -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And n

[PATCH v1 1/4] RISC-V: Combine vec_duplicate + vidv.vv to vdiv.vx on GR2VR cost

2025-06-02 Thread pan2 . li
From: Pan Li This patch would like to combine the vec_duplicate + vdiv.vv to the vdiv.vx. From example as below code. The related pattern will depend on the cost of vec_duplicate from GR2VR. Then the late-combine will take action if the cost of GR2VR is zero, and reject the combination if the

Re: [PATCH] c++, coroutines: Lookup coroutine_handle template [PR120495].

2025-06-02 Thread Andrew Pinski
On Mon, Jun 2, 2025 at 8:17 AM Jason Merrill wrote: > > On 6/2/25 5:13 AM, Iain Sandoe wrote: > > Tested on x86_64-darwin, OK for trunk? > > thanks > > Iain > > > > --- 8< --- > > > > Using lookup_template_class () directly on the coroutine_handle identifier > > fails in the reported test because

[PATCH] c: Enable -Wjump-misses-init in -Wextra and -Wc++-compat [PR87038]

2025-06-02 Thread Martin Uecker
According to the discussion in the bugzilla there seems to be some consensus to activate the warning for -Wextra (I am also looking into implementing the suggested improvements that may make it suitable fo r-Wall). When making this change, I also noticed that it was not working for -Wc++-compat

Re: [PATCH] c++, coroutines: Some cleanups in build_actor_fn.

2025-06-02 Thread Jason Merrill
On 6/2/25 11:43 AM, Iain Sandoe wrote: On 2 Jun 2025, at 16:33, Iain Sandoe wrote: Hi Jason On 2 Jun 2025, at 16:20, Jason Merrill wrote: On 5/31/25 3:19 PM, Iain Sandoe wrote: Some small cleanups found while working on other changes, tested on x86_64-darwin, OK for trunk? thanks Iain -

[PATCH] c: fix ICE with enum completed with packed attribute after forward decl [PR116892]

2025-06-02 Thread Martin Uecker
I *believe* TYPE_PACKED should be propagated to existing main variants. Bootstrapped and regression tested for x86_64. Martin c: fix ICE with enum completed with packed attribute after forward decl [PR116892] After forward declaration of an enum and when completing it with the

[PATCH] emit-rtl: Tweak validate_subreg ordered_p condition [PR120447]

2025-06-02 Thread Richard Sandiford
In the comment trail for PR119966, I'd said that the validate_subreg condition: /* The outer size must be ordered wrt the register size, otherwise we wouldn't know at compile time how many registers the outer mode occupies. */ if (!ordered_p (osize, regsize)) return false; "is

Re: [PATCH] c++, coroutines: Some cleanups in build_actor_fn.

2025-06-02 Thread Iain Sandoe
> On 2 Jun 2025, at 16:33, Iain Sandoe wrote: > > Hi Jason > >> On 2 Jun 2025, at 16:20, Jason Merrill wrote: >> >> On 5/31/25 3:19 PM, Iain Sandoe wrote: >>> Some small cleanups found while working on other changes, tested >>> on x86_64-darwin, OK for trunk? >>> thanks >>> Iain >>> --- 8<

Re: [PATCH] c++, coroutines: Some cleanups in build_actor_fn.

2025-06-02 Thread Iain Sandoe
Hi Jason > On 2 Jun 2025, at 16:20, Jason Merrill wrote: > > On 5/31/25 3:19 PM, Iain Sandoe wrote: >> Some small cleanups found while working on other changes, tested >> on x86_64-darwin, OK for trunk? >> thanks >> Iain >> --- 8< --- >> We were incorrectly guarding all the frame cleanups on the

[pushed 1/2] c++: __has_trivial_destructor regression

2025-06-02 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- We don't want the new call to get_dtor to cause function instantiation. PR c++/107600 gcc/cp/ChangeLog: * semantics.cc (trait_expr_value) [CPTK_HAS_TRIVIAL_DESTRUCTOR]: Add cp_unevaluated. gcc/testsuite/ChangeLog:

[pushed 2/2] c++: __is_destructible fixes [PR107600]

2025-06-02 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- destructible_expr was wrongly assuming that TO is a class type. When is_xible_helper was added in r8-742 it returned early for abstract class types, which is correct for __is_constructible, but not __is_assignable or (now) __is_destructible

Re: [PATCH] config: Update obsolete macro in pkg.m4

2025-06-02 Thread Simon Marchi
On 5/30/25 5:38 PM, Pietro Monteiro wrote: > The autoconf macro PKG_CHECK_MODULES defined in config/pkg.m4 is used in > binutils/gdb, but not in GCC. That macro uses the obsolete AC_TRY_LINK[1]. > Update the code to use AC_LINK_IFELSE as documented by autoconf. > > Regenerating all autotool files

Re: [PATCH] c++, coroutines: Some cleanups in build_actor_fn.

2025-06-02 Thread Jason Merrill
On 5/31/25 3:19 PM, Iain Sandoe wrote: Some small cleanups found while working on other changes, tested on x86_64-darwin, OK for trunk? thanks Iain --- 8< --- We were incorrectly guarding all the frame cleanups on the basis of frame_needs_free (which is always set for the present code-gen since

Re: [PATCH] c++: Emit an error for attempted constexpr co_await [PR118903].

2025-06-02 Thread Jason Merrill
On 5/30/25 3:50 PM, Iain Sandoe wrote: Tested on x86_64-darwin (but does need the addition of the coroutine keywords to dump_expr), OK for trunk? Thanks, Iain OK. --- 8< --- We checked that the coroutine expressions were not suitable for constexpr, but did not emit and error when needed.

Re: [PATCH] c++: Add co_await, co_yield and co_return to dump_expr.

2025-06-02 Thread Jason Merrill
On 5/30/25 3:48 PM, Iain Sandoe wrote: Tested on x86_64-darwin, OK for trunk? thanks Iain OK. --- 8< --- These were omitted there as an oversight, most of the error handling for the coroutines code is specific rather than using generic %qE etc. gcc/cp/ChangeLog: * error.cc (dump_ex

Re: [PATCH] c++,coroutines: Lookup coroutine_handle template [PR120495].

2025-06-02 Thread Jason Merrill
On 6/2/25 5:13 AM, Iain Sandoe wrote: Tested on x86_64-darwin, OK for trunk? thanks Iain --- 8< --- Using lookup_template_class () directly on the coroutine_handle identifier fails in the reported test because the using TYPE_DECL is found. Hmm, this seems like a longstanding (since the implem

Re: [Patch] libgomp: Add OpenMP's omp_target_memset/omp_target_memset_async [PR120444]

2025-06-02 Thread Andrew Stubbs
On 02/06/2025 15:40, Tobias Burnus wrote: Hi Andrew, Andrew Stubbs wrote: The hsa_memory_copy API is known to be slow, so for smaller data sizes it's probably better to have one hsa_memory_copy replace the whole memset than use three API calls, even with setting up some host-side memory to co

Re: [PING] [PATCH] vect: Improve vectorization for small-trip-count loops using subvectors

2025-06-02 Thread Jeff Law
On 6/2/25 2:23 AM, Pengfei Li wrote: Hi all, I would like to bring attention back to this patch: https://inbox.sourceware.org/gcc-patches/20250508164950.5646-1-pengfei@arm.com/ The patch improves auto-vectorization for loops with known small trip counts by introducing a new target ho

Re: [PATCH] Add newlib to gitignore

2025-06-02 Thread Jeff Law
On 6/2/25 3:01 AM, Arijit Kumar Das wrote: Hi, When compiling GCC for targets like nvptx-none that require newlib, we need to put newlib-cygwin/newlib in the root directory of the source tree (either a copy or a symlink), which is then built by GCC when targeting offload devices like the a

[PATCH v1 2/4] RISC-V: Add test for vec_duplicate + vdiv.vv combine case 0 with GR2VR cost 0, 2 and 15

2025-06-02 Thread pan2 . li
From: Pan Li Add asm dump check test for vec_duplicate + vdiv.vv combine to vdiv.vx, with the GR2VR cost is 0, 2 and 15. The below test suites are passed for this patch. * The rv64gcv fully regression test. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i16.c: Add a

[PATCH v1 3/4] RISC-V: Add test for vec_duplicate + vdiv.vv combine case 1 with GR2VR cost 0, 1 and 2

2025-06-02 Thread pan2 . li
From: Pan Li Add asm dump check test for vec_duplicate + vdiv.vv combine to vdiv.vx, with the GR2VR cost is 0, 1 and 2. The below test suites are passed for this patch. * The rv64gcv fully regression test. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/vx_vf/vx-4-i16.c: Add as

[PATCH v1 4/4] RISC-V: RISC-V: Reconcile the existing test for vdiv.vx combine

2025-06-02 Thread pan2 . li
From: Pan Li Some existing vdiv related test need some adjust for the asm check. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/binop/vdiv-rv32gcv-nofm.c: Adjust the asm check for vdiv. * gcc.target/riscv/rvv/autovec/binop/vdiv-rv32gcv.c: Ditto. * gcc.ta

[PATCH v1 0/4] RISC-V: Combine vec_duplicate + vdiv.vv to vdiv.vx on GR2VR cost

2025-06-02 Thread pan2 . li
From: Pan Li This patch would like to introduce the combine of vec_dup + vdiv.vv into vdiv.vx on the cost value of GR2VR. The late-combine will take place if the cost of GR2VR is zero, or reject the combine if non-zero like 1, 15 in test. There will be two cases for the combine: Case 0: | .

RE: [PATCH 1/2]middle-end: Apply loop->unroll directly in vectorizer

2025-06-02 Thread Tamar Christina
> -Original Message- > From: Richard Biener > Sent: Monday, May 26, 2025 2:56 PM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; nd > Subject: RE: [PATCH 1/2]middle-end: Apply loop->unroll directly in vectorizer > > On Mon, 19 May 2025, Tamar Christina wrote: > > > > >/* Compl

Re: [PATCH] Also check function symbol for function declaration

2025-06-02 Thread H.J. Lu
On Mon, Jun 2, 2025 at 4:45 PM Richard Sandiford wrote: > > "H.J. Lu" writes: > > On Mon, Jun 2, 2025 at 4:07 PM Richard Sandiford > > wrote: > >> > >> "H.J. Lu" writes: > >> > Since not all CALL instructions in RTL passes have a REG_CALL_DECL note, > >> > update get_call_fndecl to also check f

Re: [PATCH] Also check function symbol for function declaration

2025-06-02 Thread Richard Sandiford
"H.J. Lu" writes: > On Mon, Jun 2, 2025 at 4:07 PM Richard Sandiford > wrote: >> >> "H.J. Lu" writes: >> > Since not all CALL instructions in RTL passes have a REG_CALL_DECL note, >> > update get_call_fndecl to also check function symbol for function >> > declaration so that it can be used on CA

Re: [PATCH v2] libstdc++: Pass small trivial types by value in polymorphic wrappers

2025-06-02 Thread Jonathan Wakely
On Thu, 29 May 2025 at 07:49, Tomasz Kamiński wrote: > > This patch adjust the passing of parameters for the move_only_function, > copyable_function and function_ref. For types that are declared as being > passed > by value in signature template argument, they are passed by value to the > invoke

Re: [PATCH] libstdc++: Fix formatting of 3-digits months, day, weekday and hour [PR120481]

2025-06-02 Thread Tomasz Kaminski
On Mon, Jun 2, 2025 at 1:21 PM Tomasz Kamiński wrote: > This patch fixes the handle multiple digits values for the month, day, > weekday > and hour, when used with the %m, %d, %e, %m, %u, %w, %H, and %D, %F > specifiers. > The values are now printed unmodified. This patch also fixes printing > n

[PATCH] libstdc++: Fix formatting of 3-digits months, day, weekday and hour [PR120481]

2025-06-02 Thread Tomasz Kamiński
This patch fixes the handle multiple digits values for the month, day, weekday and hour, when used with the %m, %d, %e, %m, %u, %w, %H, and %D, %F specifiers. The values are now printed unmodified. This patch also fixes printing negative year with %F, where the values was not padded to four digits

Re: [PATCH] libstdc++: Implement C++26 std::polymorphic [PR119152]

2025-06-02 Thread Jonathan Wakely
On Tue, 27 May 2025 at 13:36, Tomasz Kamiński wrote: > > From: Jonathan Wakely > > This patch implements C++26 std::polymorphic as specified in P3019 with > amendment to move assignment from LWG 4251. > > The implementation always allocate stored object on the heap. The manager > function (_M_man

[PATCH 10/14] aarch64: Relaxed SEL combiner patterns for unpacked SVE FP binary arithmetic

2025-06-02 Thread Spencer Abson
Extend the binary op/UNSPEC_SEL combiner patterns from SVE_FULL_F/ SVE_FULL_F_B16B16 to SVE_F/SVE_F_B16B16, where the strictness value is SVE_RELAXED_GP. gcc/ChangeLog: * config/aarch64/aarch64-sve.md (*cond__2_relaxed): Extend from SVE_FULL_F_B16B16 to SVE_F_B16B16. (*con

[PATCH 14/14] aarch64: Add support for unpacked SVE FP conditional ternary arithmetic

2025-06-02 Thread Spencer Abson
This patch extends the expander for fma, fnma, fms, and fnms to support partial SVE FP modes. We add the missing BF16 tests, which we can now trigger for having implemented the conditional expander. We also add tests for the 'merging with multiplicand' case, which this expander canonicalizes (alb

[PATCH] c++,coroutines: Lookup coroutine_handle template [PR120495].

2025-06-02 Thread Iain Sandoe
Tested on x86_64-darwin, OK for trunk? thanks Iain --- 8< --- Using lookup_template_class () directly on the coroutine_handle identifier fails in the reported test because the using TYPE_DECL is found. Fix this by looking up the std::coroutine_handle template specifically and then instantiating

[PATCH 12/14] aarch64: Add support for unpacked SVE FP ternary arithmetic

2025-06-02 Thread Spencer Abson
This patch extends the expander for unconditional fma, fnma, fms, and fnms, so that it supports partial SVE FP modes. gcc/ChangeLog: * config/aarch64/aarch64-sve.md (4): Extend from SVE_FULL_F_B16B16 to SVE_F_B16B16. Use sve_fp_pred instead of aarch64_ptrue_reg. (

[PATCH 00/14] aarch64: Add support for unpacked SVE FP operations

2025-06-02 Thread Spencer Abson
This series incrementally adds support for operations on unpacked vectors of floating-point values. By "unpacked", we're referring to the in-register layout of partial SVE vector modes. For example, the elements of a VNx4HF are stored as: ... | X | HF | X | HF | X | HF | X | HF | Where 'X' deno

[PATCH 13/14] aarch64: Relaxed SEL combiner patterns for unpacked SVE FP ternary arithmetic

2025-06-02 Thread Spencer Abson
Extend the ternary op/UNSPEC_SEL combiner patterns from SVE_FULL_F/ SVE_FULL_F_BF to SVE_F/SVE_F_BF, where the strictness value is SVE_RELAXED_GP. We can only reliably test the 'merging with the third input' (addend) and 'independent value' patterns at this stage as the canocalisation that reorder

[PATCH 01/14] aarch64: Extend iterator support for partial SVE FP modes

2025-06-02 Thread Spencer Abson
Define new iterators for partial floating-point modes, and cover these in some existing mode_attrs. This patch serves as a starting point for a series that extends support for unpacked floating-point operations. To differentiate between BFloat mode iterators that need to test TARGET_SSVE_B16B16,

  1   2   >