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

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] 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

[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

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 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: | .

[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 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 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

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

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

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

2025-06-02 Thread Andre Vehreschild
Hi all, 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 ok on

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

2025-06-02 Thread H.J. Lu
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 CALL instructions like > > > >

Re: RISC-V frm mode switching and late_combine2

2025-06-02 Thread Richard Sandiford
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 FRM save/restores when it is >> desired to >> keep them. >> >>

Re: [PING^2][PATCH v3] match.pd: Fold (x + y) >> 1 into IFN_AVG_FLOOR (x, y) for vectors

2025-06-02 Thread Pengfei Li
PING^2 From: Pengfei Li Sent: 22 May 2025 9:51 To: gcc-patches@gcc.gnu.org Cc: rguent...@suse.de; jeffreya...@gmail.com; pins...@gmail.com Subject: [PING][PATCH v3] match.pd: Fold (x + y) >> 1 into IFN_AVG_FLOOR (x, y) for vectors Hi, Just a gentle ping

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

2025-06-02 Thread Pengfei Li
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 hook for subvector selection. I fully unders

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 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

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

2025-06-02 Thread Spencer Abson
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 Modelling the source vector as VNx4SF: ... |

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

2025-06-02 Thread Spencer Abson
This patch extends the expander for conditional smax, smin, add, sub, mul, min, max, and div to support partial SVE FP modes. The natural mask supplied to the unpacked operation leaves the undefined elements in each container unpredicated. This expansion modifies this mask to explicitly disable t

[PATCH 09/14] aarch64: Add support for unpacked SVE FDIV

2025-06-02 Thread Spencer Abson
This patch extends the unpredicated FP division expander to support partial FP modes. It extends the existing patterns used to implement UNSPEC_COND_FDIV and it's approximation as needed. gcc/ChangeLog: * config/aarch64/aarch64-sve.md: (@aarch64_sve_): Extend from SVE_FULL_F to S

[PATCH 04/14] aarch64: Add support for unpacked SVE FP comparisons

2025-06-02 Thread Spencer Abson
This patch extends our vec_cmp expander to support partial FP modes. We use an unnatural predicate mode to govern unpacked FP operations under flag_trapping_math, so the expansion must handle cases where the comparison's target and governing predicates have different modes. While such predicates

[PATCH 03/14] aarch64: Relaxed SEL combiner patterns for unpacked SVE FP conversions

2025-06-02 Thread Spencer Abson
Add UNSPEC_SEL combiner patterns for unpacked FP conversions, where the strictness value is SVE_RELAXED_GP. gcc/ChangeLog: * config/aarch64/aarch64-sve.md (*cond__nontrunc_relaxed): New FCVT/SEL combiner pattern. (*cond__trunc_relaxed): New FCVTZ{S,U}/SEL c

[PATCH 08/14] aarch64: Add support for unpacked SVE FP binary arithmetic

2025-06-02 Thread Spencer Abson
This patch extends the expanders for unpredicated smax, smin, add, sub, mul, min, and max, so that they support partial SVE FP modes. The relevant insn/split patterns have also been updated. gcc/ChangeLog: * config/aarch64/aarch64-sve.md (3): Extend from SVE_FULL_F to SVE_F, and

[PATCH 07/14] aarch64: Relaxed SEL combiner patterns for unpacked SVE FP unary operations

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

[PATCH 05/14] aarch64: Compare/and splits for unpacked SVE FP comparisons

2025-06-02 Thread Spencer Abson
This patch extends the compare/and splitting patterns for FP comparisons from SVE_FULL_F to SVE_F. gcc/ChangeLog: * config/aarch64/aarch64-sve.md (*fcm_and_combine): Extend to SVE_F. gcc/testsuite/ChangeLog: * gcc.target/aarch64/sve/unpacked_fcm_1.c: Allow other tests

Re: [PATCH] or1k: Fix struct return test

2025-06-02 Thread Stafford Horne
On Sun, Jun 01, 2025 at 09:17:45PM -0600, Jeff Law wrote: > > > On 5/31/25 12:03 AM, Stafford Horne wrote: > > In or1k structs are returned from functions using the memory address > > passed in r3. In the current version of GCC the struct stores changed > > from r11 (the return value) to r3 the

[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,

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

2025-06-02 Thread Spencer Abson
This patch extends the expander for unpredicated round, nearbyint, floor, ceil, rint, and trunc, so that it can handle partial SVE FP modes. We move fabs and fneg to a separate expander, since they are not trapping instructions. gcc/ChangeLog: * config/aarch64/aarch64-sve.md (2): Replace

[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 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 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. (

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

2025-06-02 Thread Richard Sandiford
"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 CALL instructions like > > (call_insn 39 38 61 7 (set (reg:SI 0 ax) > (call (mem:QI (symb

Re: [PATCH] Add newlib to gitignore

2025-06-02 Thread Arijit Kumar Das
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 above. Changes made in newlib shouldn't affect GCC,

[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 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: 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

[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

[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++: 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

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

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: 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] 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: [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++,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] 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] 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

[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] 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:

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<

[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

[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

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 -

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

[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: [EXT] Re: [PATCH v3] rs6000: Adding missed ISA 3.0 atomic memory operation instructions.

2025-06-02 Thread Surya Kumari Jangala
On 30/05/25 1:37 am, Peter Bergner wrote: > On 5/29/25 5:35 AM, Segher Boessenkool wrote: >> >>> +#define _AMO_LD_INCREMENT(NAME, TYPE, OPCODE, FC) \ >>> +static __inline__ TYPE >>> \ >>> +NAME (TYPE *_PTR)

Re: [PATCH v5 3/8] libstdc++: Add tests for layout_left.

2025-06-02 Thread Luc Grosheintz
On 5/30/25 18:42, Luc Grosheintz wrote: Implements a suite of tests for the currently implemented parts of layout_left. The individual tests are templated over the layout type, to allow reuse as more layouts are added. libstdc++-v3/ChangeLog: * testsuite/23_containers/mdspan/layouts/

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

[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] 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

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

[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

[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

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

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: [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

[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] 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

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: [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] 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: 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 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] 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

[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] 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

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

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

[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: [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] 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 "

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 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

[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.

[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: 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: [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

[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: [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] 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: 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] 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

[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: 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

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

  1   2   >