[PATCH v3 15/17] LoongArch: Fix signed 32-bit overflow for loongarch32 target

2025-11-20 Thread mengqinggang
From: Jiajie Chen When rhs equals to 0x7fff, adding 1 to rhs overflows SI, generating invalid const_int. gcc/ChangeLog: * config/loongarch/loongarch.cc (loongarch_emit_int_compare): Call trunc_int_mode to ensure valid rhs. gcc/testsuite/ChangeLog: * gcc.target/loon

[PATCH v3 17/17] LoongArch: Testcases modifications for LA32

2025-11-20 Thread mengqinggang
Add gcc.target/loongarch/la64 directory. gcc/testsuite/ChangeLog: * g++.target/loongarch/bytepick.C: Skip on LA32. * g++.target/loongarch/got-load.C: Likewise. * g++.target/loongarch/pr106828.C: Likewise. * g++.target/loongarch/vect-ashr-lshr.C: Add loongarch_asx c

[PATCH v3 08/17] LoongArch: Fix addsi3 pattern for LA32

2025-11-20 Thread mengqinggang
From: Jiajie Chen The current addsi3 define_expand requires loongarch64 to work, but the existing way of specifying the requirement forbids whole addsi3 generation for loongarch32. Move target bitness check to expand preparation statments to allow it to fallback to *addsi3 define_insn. gcc/Chang

[PATCH v3 14/17] LoongArch: Fix uint64_t a & 0xfffffffffff on LA32

2025-11-20 Thread mengqinggang
"uint64_t a & 0xfff" expands to two and:SI on LA32 with -O0: (insn 8 7 9 (set (subreg:SI (reg:DI 82 [ a_2 ]) 0) (and:SI (reg:SI 83) (const_int -1 [0x]))) "t.c":3:5 -1 (nil)) (insn 10 9 11 (set (subreg:SI (reg:DI 82 [ a_2 ]) 4) (and:SI (re

[PATCH v3 11/17] LoongArch: Set long double width to 128 in LA32

2025-11-20 Thread mengqinggang
From: Jiajie Chen According to latest loongarch procedure call standard, sizeof(long double) == 128 in ilp32 data model regardless of target bitness. gcc/ChangeLog: * config/loongarch/loongarch.cc: Use TFmode for long double regardless of target bitness. * config/loongar

[PATCH v3 05/17] LoongArch: Disable features not supported by LA32

2025-11-20 Thread mengqinggang
gcc/ChangeLog: * config/loongarch/loongarch-opts.cc: Disable vector, extreme code model and explicit relocs on LA32. * config/loongarch/loongarch.cc (loongarch_explicit_relocs_p): Disable explicit relocs on LA32. (loongarch_bitint_type_info): Disable BitInt

[PATCH v3 16/17] LoongArch: XALLOCAVEC allocate to large space on stack

2025-11-20 Thread mengqinggang
Compare (length > la_max_inline_memcpy_size) and (length <= align * LARCH_MAX_MOVE_OPS_STRAIGHT) is signed. But loongarch_block_move_straight() -> XALLOCAVEC() -> alloca() allocate space as unsigned value. It may result in segment fault if length less than 0. gcc/ChangeLog: * config/loon

[PATCH v3 07/17] LoongArch: Macro modifications for LA32

2025-11-20 Thread mengqinggang
gcc/ChangeLog: * config/loongarch/loongarch-opts.cc (loongarch_target_option_override): Delete opts->x_flag_pcc_struct_return. * config/loongarch/loongarch.h (MAX_FIXED_MODE_SIZE): Set to 64 on LA32. (DEFAULT_PCC_STRUCT_RETURN): New. If the size of struct <= 2 * GRL

[PATCH v3 13/17] LoongArch: Use DFmode to save or restore float registers on ilp32d ABI

2025-11-20 Thread mengqinggang
gcc/ChangeLog: * config/loongarch/loongarch.cc (loongarch_for_each_saved_reg): Set mode depend on ABI. --- gcc/config/loongarch/loongarch.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/loongarch/loongarch.cc b/gcc/config/loongarch/loongarch.cc i

[PATCH v3 10/17] LoongArch: Fix redundant SI sign_extend in atomic_compare_and_swap

2025-11-20 Thread mengqinggang
gen_atomic_compare_and_swapqi may generate: (set (reg:SI 327) (sign_extend:SI (reg:SI 326))) Sign extend compare if its mode is not word_mode. Change sign extend compare condtition to avoid this problem. gcc/ChangeLog: * config/loongarch/sync.md: Change sign extend condition. --- gcc/co

[PATCH v3 00/17] Add support for LoongArch32 target

2025-11-20 Thread mengqinggang
These series patches introduce LoongArch32(LA32) ilp32d abi and LoongArch32 Reduced(LA32R) ilp32s abi. The ilp32 abi is similar to lp64 abi[1], with some differences in details. Most testcases have passed when using qemu-user. A LA32 linux system based on qemu is here[2]. The binutils and glibc

[PATCH v3 09/17] LoongArch: Fix 64-bit move for LA32

2025-11-20 Thread mengqinggang
loongarch_move_integer does not support splitting 64-bit integer into two 32-bit ones. Thus, define_split is removed from movdi_32bit. Bring back 64-bit move splitting for loongarch32. The code was removed in commit 16fc26d (`LoongArch: Support split symbol.`) for unknown reason. gcc/ChangeLog:

[PATCH v3 06/17] LoongArch: Add support for libgcc on LA32

2025-11-20 Thread mengqinggang
LA32 does not support extreme code mode, change to medium code model on LA32. libgcc/ChangeLog: * configure: Regenerate. * configure.ac: Use different tmake_file for LA32 and LA64. * config/loongarch/t-crtstuff-la32: New file for LA32. --- libgcc/config/loongarch/t-crtstu

[PATCH v3 12/17] LoongArch: Allow lo_sum to be used with DF in LoongArch32 with 64-bit FPU

2025-11-20 Thread mengqinggang
From: Jiajie Chen For ilp32d ABI, word_size is 64 for MODE_FLOAT class mode, word_size is 32 for MODE_INT class mode. gcc/ChangeLog: * config/loongarch/loongarch.cc (loongarch_valid_lo_sum_p): Change word_size to 64 for float mode. --- gcc/config/loongarch/loongarch.cc | 8

[PATCH v3 03/17] LoongArch: Disable some constraints, predicates and instrcions on LA32

2025-11-20 Thread mengqinggang
gcc/ChangeLog: * config/loongarch/constraints.md: Disable "k" on LA32. * config/loongarch/larchintrin.h (__movgr2fcsr): Disable on soft float. (__cacop_w): New. (__lddir_w): New. (__ldpte_w): New. (__crc_w_w_w): Disable on LA32. (__crc_w_d_w)

[PATCH v3 04/17] LoongArch: Add support for call30 and TLS descriptors on LA32

2025-11-20 Thread mengqinggang
gcc/ChangeLog: * config/loongarch/loongarch.cc (loongarch_call_tls_get_addr): Use call30 to call __tls_get_addr. * config/loongarch/loongarch.md: Add call30. * config/loongarch/predicates.md: Return true for const_call_insn_operand on LA32. --- gcc/config

[PATCH v3 02/17] LoongArch: Machine description modifications for LA32

2025-11-20 Thread mengqinggang
gcc/ChangeLog: * config/loongarch/loongarch.md (*and3): Delete. (*and3_extend): New. (zero_extend2_la32r): New. (extend2_la32r): New. (extendqihi2_la32r): Add TARGET_32BIT_S condition. * config/loongarch/sync.md (atomic_): Change to define_expand.

[PATCH v3 01/17] LoongArch: Introduce LoongArch32 target

2025-11-20 Thread mengqinggang
Introduce LoongArch32 (LA32) ilp32d abi and LoongArch32 Reduced (LA32R) ilp32s abi. Add march la32v1.0 and la32rv1.0. Add mtune loongarch32 as a general tune. contrib/ChangeLog: * config-list.mk: Add loongarch32-linux-gnu*. gcc/ChangeLog: * config.gcc: Add target triple loongar

Re: [PATCH v2 1/2] libstdc++: Optimize functor storage for transform views iterators.

2025-11-20 Thread Tomasz Kaminski
On Fri, Nov 21, 2025 at 5:22 AM Patrick Palka wrote: > On Thu, 20 Nov 2025, Tomasz Kamiński wrote: > > > The iterators for transform views (views::transform, > views::zip_transform, > > and views::adjacent_transform) now store a __detail::__func_handle > instead > > of a pointer to the view objec

Re: [PATCH] gimplify: Fix ICE in collect_fallthrough_labels [PR122773]

2025-11-20 Thread Richard Biener
> Am 21.11.2025 um 07:33 schrieb Jakub Jelinek : > > Hi! > > In r16-4212 I had to tweak two spots in the gimplifier to ignore > gotos jumping to labels with the new VACUOUS_INIT_LABEL_P flag > (set by C++ FE when implementing goto/case interceptors with > extra .DEFERRED_INIT calls, so that j

Re: [PATCH] ira: sort allocno_hard_regs by regset

2025-11-20 Thread Richard Biener
> Am 21.11.2025 um 07:31 schrieb Alexandre Oliva : > >  > Using hashes of data structures for tie breaking makes sorting > dependent on type sizes, padding, and endianness, i.e., unstable > across different hosts. > > ira-color.cc's allocno_hard_regs_compare does that, and it causes > differe

Re:[pushed] [PATCH v2] LoongArch: Add more numbers supported for {x}vldi

2025-11-20 Thread Lulu Cheng
Pushed to r16-5464. Thanks! 在 2025/11/17 下午3:28, Deng Jianbo 写道: When the most significant bit of the 13 bit immediate value in LoongArch {x}vldi isntruction is set 1, it can generate different numbers based on the algorithm. This patch adds to support these numbers to be generated by {x}vldi

Re: [pushed][PATCH] LoongArch: Fix operands[2] predicate of lsx_vreplvei_mirror.

2025-11-20 Thread Lulu Cheng
Pushed to r16-5463. 在 2025/11/14 上午11:09, zhaozhou 写道: UNSPEC_LSX_VREPLVEI_MIRROR describes the mirroring operation that copies the lower 64 bits of a 128-bit register to the upper 64 bits. So in any mode, the value range of op2 can only be 0 or 1 for the vreplvei.d insn. gcc/ChangeLog:

[PATCH] gimplify: Fix ICE in collect_fallthrough_labels [PR122773]

2025-11-20 Thread Jakub Jelinek
Hi! In r16-4212 I had to tweak two spots in the gimplifier to ignore gotos jumping to labels with the new VACUOUS_INIT_LABEL_P flag (set by C++ FE when implementing goto/case interceptors with extra .DEFERRED_INIT calls, so that jumps over vacuous initialization are handled properly with the C++26

[PATCH] ira: sort allocno_hard_regs by regset

2025-11-20 Thread Alexandre Oliva
Using hashes of data structures for tie breaking makes sorting dependent on type sizes, padding, and endianness, i.e., unstable across different hosts. ira-color.cc's allocno_hard_regs_compare does that, and it causes different register allocations to be chosen for the same target depending on t

[PATCH] i386: Remove cond_{ashl,lshr,ashr}v{64,16,32}qi expanders [PR122598]

2025-11-20 Thread Jakub Jelinek
Hi! As mentioned in the PR, the COND_SH{L,R} internal fns are expanded without fallback, their expansion must succeed, and furthermore they don't differentiate between scalar and vector shift counts, so again both have to be supported. That is the case of the {ashl,lshr,ashr}v*[hsd]i patterns whi

[PATCH] c++: Fix up build_data_member_initialization [PR121445]

2025-11-20 Thread Jakub Jelinek
Hi! The following testcase ICEs, because the constexpr ctor in C++14 or later doesn't contain any member initializers and so the massage_constexpr_body -> build_constexpr_constructor_member_initializers -> build_data_member_initialization member initialization discovery looks at the ctor body inst

Re: [PATCH v2 2/2] libstdc++: Make C++20s operator wrappers operator() static.

2025-11-20 Thread Patrick Palka
On Thu, 20 Nov 2025, Tomasz Kamiński wrote: > The operator() for function objects introduced in C++20 (e.g., std::identity, > std::compare_three_way, std::ranges::equal) is now defined as static. > Although static operator() is a C++23 feature, it is supported in C++20 by > both GCC and clang (sin

Re: [PATCH v2 1/2] libstdc++: Optimize functor storage for transform views iterators.

2025-11-20 Thread Patrick Palka
On Thu, 20 Nov 2025, Tomasz Kamiński wrote: > The iterators for transform views (views::transform, views::zip_transform, > and views::adjacent_transform) now store a __detail::__func_handle instead > of a pointer to the view object (_M_parent). > > The behavior of the __func_handle specialization

Re: [PATCH] phiprop: Avoid proping loads into loops [PR116835]

2025-11-20 Thread Andrew Pinski
On Thu, Nov 20, 2025 at 8:00 PM Andrew Pinski wrote: > > On Tue, Apr 1, 2025 at 12:54 AM Richard Biener > wrote: > > > > On Tue, Apr 1, 2025 at 6:10 AM Andrew Pinski > > wrote: > > > > > > phiprop can sometimes prop loads back into loops > > > and in some cases cause wrong code when the load >

Re: [PATCH] phiprop: Avoid proping loads into loops [PR116835]

2025-11-20 Thread Andrew Pinski
On Tue, Apr 1, 2025 at 12:54 AM Richard Biener wrote: > > On Tue, Apr 1, 2025 at 6:10 AM Andrew Pinski wrote: > > > > phiprop can sometimes prop loads back into loops > > and in some cases cause wrong code when the load > > was from a weak symbol as now it becomes an unconditional > > load before

Re: [PATCH v8 5/7] aarch64: Add AArch64 Kernel Control Flow Integrity implementation

2025-11-20 Thread Andrew Pinski
On Thu, Nov 20, 2025 at 4:30 PM Kees Cook wrote: > > On Thu, Nov 20, 2025 at 02:57:49PM -0800, Andrew Pinski wrote: > > On Thu, Nov 20, 2025 at 2:29 PM Kees Cook wrote: > > > > > > Implement AArch64-specific KCFI backend. > > > > > > - Trap debugging through ESR (Exception Syndrome Register) enco

Re: [PATCH v8 5/7] aarch64: Add AArch64 Kernel Control Flow Integrity implementation

2025-11-20 Thread Andrew Pinski
On Thu, Nov 20, 2025 at 4:30 PM Kees Cook wrote: > > On Thu, Nov 20, 2025 at 02:57:49PM -0800, Andrew Pinski wrote: > > On Thu, Nov 20, 2025 at 2:29 PM Kees Cook wrote: > > > > > > Implement AArch64-specific KCFI backend. > > > > > > - Trap debugging through ESR (Exception Syndrome Register) enco

RE: [PATCH v1] RISC-V: Fix missed zero extend for unsigned scalar SAT_TRUNC [PR122692]

2025-11-20 Thread Li, Pan2
Thanks Jeff. > Thanks. Given it's a correctness thing, I'll push it shortly. I'll > also check if it's an issue in gcc-15 for a potential backport. The gcc-15 needs the fix I bet, feel free to ping me if it is OK for backport. Pan -Original Message- From: Jeff Law Sent: Thursday, N

Re: [PATCH v8 5/7] aarch64: Add AArch64 Kernel Control Flow Integrity implementation

2025-11-20 Thread Kees Cook
On Thu, Nov 20, 2025 at 02:57:49PM -0800, Andrew Pinski wrote: > On Thu, Nov 20, 2025 at 2:29 PM Kees Cook wrote: > > > > Implement AArch64-specific KCFI backend. > > > > - Trap debugging through ESR (Exception Syndrome Register) encoding > > in BRK instruction immediate values. > > > > - Scratc

Re: [PATCH v8 5/7] aarch64: Add AArch64 Kernel Control Flow Integrity implementation

2025-11-20 Thread Kees Cook
On Thu, Nov 20, 2025 at 03:10:41PM -0800, Andrew Pinski wrote: > On Thu, Nov 20, 2025 at 2:57 PM Andrew Pinski > wrote: > > Also I am still trying to figure out and understand the interaction > > between x16 and x17 in some cases. > > Because I thought indirect calls/jumps will be using x16/x17 fo

Re: [PATCH] Add -fcombine-op-with-volatile-memory-load

2025-11-20 Thread H.J. Lu
On Thu, Nov 20, 2025 at 8:08 AM Jeff Law wrote: > > > > On 11/16/25 4:36 PM, H.J. Lu wrote: > > On Mon, Nov 17, 2025 at 12:38 AM Jeff Law wrote: > >> > >> > >> > >> On 10/27/25 3:53 PM, H.J. Lu wrote: > >> > >>> > As HJ indicated, I wouldn't expect significant fallout on load/store > ar

Re: [PATCH v8 5/7] aarch64: Add AArch64 Kernel Control Flow Integrity implementation

2025-11-20 Thread Andrew Pinski
On Thu, Nov 20, 2025 at 2:57 PM Andrew Pinski wrote: > > On Thu, Nov 20, 2025 at 2:29 PM Kees Cook wrote: > > > > Implement AArch64-specific KCFI backend. > > > > - Trap debugging through ESR (Exception Syndrome Register) encoding > > in BRK instruction immediate values. > > > > - Scratch regis

Re: [PATCH v8 5/7] aarch64: Add AArch64 Kernel Control Flow Integrity implementation

2025-11-20 Thread Andrew Pinski
On Thu, Nov 20, 2025 at 2:29 PM Kees Cook wrote: > > Implement AArch64-specific KCFI backend. > > - Trap debugging through ESR (Exception Syndrome Register) encoding > in BRK instruction immediate values. > > - Scratch register allocation using w16/w17 (x16/x17) following > AArch64 procedure c

[PATCH] c++: make __reference_*_from_temporary honor access [PR120529]

2025-11-20 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- This PR reports that our __reference_*_from_temporary ignore access control. The reason is that we only check if implicit_conversion works, but not if the conversion can actually be performed, via convert_like. PR c++/

Re: [PATCH v5 1/1] c: Add _Maxof and _Minof operators

2025-11-20 Thread Alejandro Colomar
Hi Joseph, On Thu, Nov 20, 2025 at 09:47:31PM +, Joseph Myers wrote: > On Wed, 19 Nov 2025, Alejandro Colomar wrote: > > > + type_name = c_parser_type_name (parser, true); > > + // Can return NULL? Why? > > I don't think that's mysterious, it's simply the error return value. But is it an

Re: [PATCH v2 02/10] libstdc++: Implement submdspan_canonicalize_slices. [PR110352]

2025-11-20 Thread Tomasz Kaminski
On Thu, Nov 20, 2025 at 11:00 PM Tomasz Kaminski wrote: > > > On Thu, Nov 20, 2025 at 8:03 PM Luc Grosheintz > wrote: > >> >> >> On 11/20/25 15:26, Tomasz Kaminski wrote: >> > On Tue, Nov 18, 2025 at 3:32 PM Luc Grosheintz < >> [email protected]> >> > wrote: >> > >> >> Implements submdspa

[PATCH v8 7/7] riscv: Add RISC-V Kernel Control Flow Integrity implementation

2025-11-20 Thread Kees Cook
Implement RISC-V-specific KCFI backend. Nothing is conceptually rv64 specific, but using an alternative set of instructions for rv32 would be needed, and at present the only user of KCFI on riscv is the rv64 build of the Linux kernel. - Scratch register allocation using t1/t2 (x6/x7) following RIS

[PATCH v8 5/7] aarch64: Add AArch64 Kernel Control Flow Integrity implementation

2025-11-20 Thread Kees Cook
Implement AArch64-specific KCFI backend. - Trap debugging through ESR (Exception Syndrome Register) encoding in BRK instruction immediate values. - Scratch register allocation using w16/w17 (x16/x17) following AArch64 procedure call standard for intra-procedure-call registers, which already

[PATCH v8 6/7] arm: Add ARM 32-bit Kernel Control Flow Integrity implementation

2025-11-20 Thread Kees Cook
Implement ARM 32-bit KCFI backend: - Use eor instructions for 32-bit immediate loading. - Trap debugging through UDF instruction immediate encoding following AArch64 BRK pattern for encoding registers with useful contents. - Scratch register allocation uses ip by default since it is most com

[PATCH v8 3/7] kcfi: Add regression test suite

2025-11-20 Thread Kees Cook
Add test suite for KCFI (Kernel Control Flow Integrity) ABI, covering core functionality, optimization and code generation, addressing, architecture-specific KCFI sequence emission, and integration with patchable function entry. The arch-specific patterns themselves are added with the subsequent a

[PATCH v8 4/7] x86: Add x86_64 Kernel Control Flow Integrity implementation

2025-11-20 Thread Kees Cook
Implement x86_64-specific KCFI backend: - Implies -mindirect-branch-register since KCFI needs call target in a register for typeid hash loading. - Function preamble generation with type IDs positioned at -(4+prefix_nops) offset from function entry point. - Function-aligned KCFI preambles usi

[PATCH v8 2/7] kcfi: Add core Kernel Control Flow Integrity infrastructure

2025-11-20 Thread Kees Cook
Implements the Linux Kernel Control Flow Integrity ABI, which provides a function prototype based forward edge control flow integrity protection by instrumenting every indirect call to check for a hash value before the target function address. If the hash at the call site and the hash at the target

[PATCH v8 1/7] typeinfo: Introduce KCFI typeinfo mangling API

2025-11-20 Thread Kees Cook
To support the KCFI typeid and future type-based allocators, which need to convert unique types into unique 32-bit values, add a mangling system based on the Itanium C++ mangling ABI, adapted for C types. Introduce __builtin_typeinfo_hash for the hash, and __builtin_typeinfo_name for testing and de

[PATCH v8 0/7] Introduce Kernel Control Flow Integrity ABI [PR107048]

2025-11-20 Thread Kees Cook
Hi, This series implements[1][2] the Linux Kernel Control Flow Integrity ABI, which provides a function prototype based forward edge control flow integrity protection by instrumenting every indirect call to check for a hash value before the target function address. If the hash at the call site and

Re: [PATCH v2 02/10] libstdc++: Implement submdspan_canonicalize_slices. [PR110352]

2025-11-20 Thread Tomasz Kaminski
OK, for properly calling submdspan_mapping only via ADL, i.e. following sentence: > For the purpose of this section, the meaning of submdspan_mapping is established as if by performing argument-dependent lookup only ([basic.lookup.argdep]). This means that if someone does: template void submdspan_m

Re: [PATCH v2 02/10] libstdc++: Implement submdspan_canonicalize_slices. [PR110352]

2025-11-20 Thread Tomasz Kaminski
On Thu, Nov 20, 2025 at 8:03 PM Luc Grosheintz wrote: > > > On 11/20/25 15:26, Tomasz Kaminski wrote: > > On Tue, Nov 18, 2025 at 3:32 PM Luc Grosheintz > > > wrote: > > > >> Implements submdspan_canonicalize_slices as described in P3663 and adds > >> it to the std module. > >> > >> PR

Re: [PATCH][_GLIBCXX_DEBUG] Fix std::erase_if implementation for std::vector

2025-11-20 Thread Jonathan Wakely
On Thu, 20 Nov 2025, 20:36 François Dumont, wrote: > > On 11/19/25 14:51, Jonathan Wakely wrote: > > On Tue, 18 Nov 2025 at 21:38, François Dumont > wrote: > >> Ok, here is the new patch, only fixing thestd::erase_if behavior for > >> the _GLIBCXX_DEBUG. > > Is that right? I thought this change i

Re: [PATCH][_GLIBCXX_DEBUG] Fix std::erase_if implementation for std::vector

2025-11-20 Thread Jonathan Wakely
On Thu, 20 Nov 2025, 20:36 François Dumont, wrote: > > On 11/19/25 14:51, Jonathan Wakely wrote: > > On Tue, 18 Nov 2025 at 21:38, François Dumont > wrote: > >> Ok, here is the new patch, only fixing thestd::erase_if behavior for > >> the _GLIBCXX_DEBUG. > > Is that right? I thought this change i

Re: [PATCH v5 1/1] c: Add _Maxof and _Minof operators

2025-11-20 Thread Joseph Myers
On Wed, 19 Nov 2025, Alejandro Colomar wrote: > + type_name = c_parser_type_name (parser, true); > + // Can return NULL? Why? I don't think that's mysterious, it's simply the error return value. > +void > +bitint (void) > +{ > + _Static_assert (_Maxof (_BitInt (5)) == 15); > + _Static_asser

Re: [PATCH 5/7] c++: Add detailed diagnostics for __is_layout_compatible

2025-11-20 Thread Nathaniel Shead
On Thu, Nov 20, 2025 at 10:28:13PM +0530, Jason Merrill wrote: > On 11/20/25 4:02 PM, Nathaniel Shead wrote: > > On Wed, Nov 19, 2025 at 12:08:58PM +0530, Jason Merrill wrote: > > > On 10/26/25 7:33 AM, Nathaniel Shead wrote: > > > > OK for trunk? > > > > > > > > -- >8 -- > > > > > > > > This reo

Ping Re: [PATCH v5] Evaluate the object size by the size of the pointee type when the type is a structure with flexible array member which is annotated with counted_by.

2025-11-20 Thread Qing Zhao
Hi, Jakub, Could you please review the middle-end part of the change of this patch? (The C FE part has been approved by Joseph already. And the middle-end part has been reviewed by Sid.) Thanks a lot. Qing > On Oct 31, 2025, at 09:45, Qing Zhao wrote: > > Hi, > > this is the 5th version

Re: [PATCH v2 04/10] libstdc++: Implement submdspan and submdspan_mapping for layout_left. [PR110352]

2025-11-20 Thread Tomasz Kaminski
On Tue, Nov 18, 2025 at 3:37 PM Luc Grosheintz wrote: > Implements `submdspan` and `submdspan_mapping` for layout_left as > described in P3663 (Future proofing mdspan). > > When computing the offset of the submdspan, one must check that the > lower bound of the slice range isn't out-of-range. The

[COMMITTED 5/4] PR tree-optimization/121345 - Improve PHI analyzer performance

2025-11-20 Thread Andrew MacLeod
This is the delayed final patch for this PR that I mentioned would be coming. This reduces the performance loss of that patch set to something more acceptable. The general format ifor the single PHI "groups" is     ssa_1 = ssa_2 OP const.     ssa_2 = PHI with some sort of backedge leading t

Re: [PATCH][_GLIBCXX_DEBUG] Fix std::erase_if implementation for std::vector

2025-11-20 Thread François Dumont
On 11/19/25 14:51, Jonathan Wakely wrote: On Tue, 18 Nov 2025 at 21:38, François Dumont wrote: Ok, here is the new patch, only fixing thestd::erase_if behavior for the _GLIBCXX_DEBUG. Is that right? I thought this change is to benefit direct uses of __gnu_debug::vector notstd::vector with _GLI

Re: How to distinguish an anonymous structure TYPE when it is the top-level type or not

2025-11-20 Thread Qing Zhao
> On Nov 20, 2025, at 12:40, Joseph Myers wrote: > > On Wed, 19 Nov 2025, Qing Zhao wrote: > >> Hi, >> >> For the following two cases: >> >> A. Anonymous structure type is a top-level type: >> >> struct { >> int a; >> char c[] __attribute__ ((counted_by (a))); >> }; >> >> B. Anonymous

Re: [PATCH] aarch64: Cache the PCS value for a function

2025-11-20 Thread Andrew Pinski
On Tue, Nov 18, 2025 at 9:03 AM Alfie Richards wrote: > > Hi All, > > This fixes the compile time regression noted by Andrew Pinski. > > The compilation speed regression was caused by my patch requirig querying > fndecl_abi signifficantly more than previously. This fixes this by caching > the pcs

Re: [PATCH v2 02/10] libstdc++: Implement submdspan_canonicalize_slices. [PR110352]

2025-11-20 Thread Luc Grosheintz
On 11/20/25 15:26, Tomasz Kaminski wrote: On Tue, Nov 18, 2025 at 3:32 PM Luc Grosheintz wrote: Implements submdspan_canonicalize_slices as described in P3663 and adds it to the std module. PR libstdc++/110352 libstdc++-v3/ChangeLog: * include/std/mdspan (submdspan_cano

Re: [PATCH 4/4] libstdc++: Remove cv-qualifiers from type of std::optional's contained value

2025-11-20 Thread Jonathan Wakely
On Thu, 20 Nov 2025 at 18:51, Tomasz Kaminski wrote: > > > > On Thu, Nov 20, 2025 at 6:03 PM Jonathan Wakely wrote: >> >> I think this was the only part of the recently-approved LWG 4015 changes >> which affect our implementation, because we already store the value as a >> union member, and alrea

Re: [PATCH] Aarch64 : Fix pasto in documentation

2025-11-20 Thread Andrew Pinski
On Thu, Nov 20, 2025 at 10:48 AM Eric Botcazou wrote: > > Tested with "make doc", OK for mainline and 15 branch? yes please. > > > 2025-11-20 Eric Botcazou > > * doc/invoke.texi (Optimize Options) <-fmalloc-dce>: Remove > trailing space. > (AArch64 Options) <-march>: F

Re: [PATCH] Aarch64 : Fix pasto in documentation

2025-11-20 Thread Andrew Pinski
On Thu, Nov 20, 2025 at 10:51 AM Andrew Pinski wrote: > > On Thu, Nov 20, 2025 at 10:48 AM Eric Botcazou wrote: > > > > Tested with "make doc", OK for mainline and 15 branch? > > yes please. ok, and yes to 15 branch too. > > > > > > > 2025-11-20 Eric Botcazou > > > > * doc/invoke.texi

Re: [PATCH 4/4] libstdc++: Remove cv-qualifiers from type of std::optional's contained value

2025-11-20 Thread Tomasz Kaminski
On Thu, Nov 20, 2025 at 6:03 PM Jonathan Wakely wrote: > I think this was the only part of the recently-approved LWG 4015 changes > which affect our implementation, because we already store the value as a > union member, and already have accessors for that value which are not > prone to the ADL p

[PATCH] Aarch64 : Fix pasto in documentation

2025-11-20 Thread Eric Botcazou
Tested with "make doc", OK for mainline and 15 branch? 2025-11-20 Eric Botcazou * doc/invoke.texi (Optimize Options) <-fmalloc-dce>: Remove trailing space. (AArch64 Options) <-march>: Fix pasto. -- Eric Botcazoudiff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi i

Re: [PATCH 1/4] libstdc++: Implement LWG 4406 for std::optional and std::expected

2025-11-20 Thread Tomasz Kaminski
For title say "LWG 4406 and LWG 3424", and update description paragraph, to clarify which issue paragraph applies to which. There is also suggestions to remove "else" in expected, otherwise the patch LGTM. On Thu, Nov 20, 2025 at 6:02 PM Jonathan Wakely wrote: > This adjusts the return statemen

Re: [PATCH v3] libstdc++: Hashing support for chrono value classes [PR110357]

2025-11-20 Thread Tomasz Kaminski
On Thu, Nov 20, 2025 at 7:36 PM Tomasz Kaminski wrote: > > > On Thu, Nov 20, 2025 at 6:37 PM Jonathan Wakely > wrote: > >> On Thu, 20 Nov 2025 at 14:28 +0100, Tomasz Kamiński wrote: >> >This patch implements P2592R3 Hashing support for std::chrono value >> classes. >> > >> >To avoid the know iss

Re: [PATCH] libstdc++: implement P3044R2 - sub-string_view from string

2025-11-20 Thread Jonathan Wakely
On Fri, 21 Nov 2025 at 01:50 +0800, Yuao Ma wrote: Hi all, This patch implements P3044R2 by adding a subview function for string and string_view. The implementation delegates directly to substr. Tested on x86_64-linux. Also, could you please help review my other patch regarding P3223R2 at https:

Re: [PATCH v3] libstdc++: Hashing support for chrono value classes [PR110357]

2025-11-20 Thread Tomasz Kaminski
On Thu, Nov 20, 2025 at 6:37 PM Jonathan Wakely wrote: > On Thu, 20 Nov 2025 at 14:28 +0100, Tomasz Kamiński wrote: > >This patch implements P2592R3 Hashing support for std::chrono value > classes. > > > >To avoid the know issues with current hashing of integer types (see > PR104945), > >we use c

Re: [PATCH v2 1/2] libstdc++: Optimize functor storage for transform views iterators.

2025-11-20 Thread Tomasz Kaminski
On Thu, Nov 20, 2025 at 6:16 PM Jonathan Wakely wrote: > On Thu, 20 Nov 2025 at 11:39 +0100, Tomasz Kamiński wrote: > >The iterators for transform views (views::transform, views::zip_transform, > >and views::adjacent_transform) now store a __detail::__func_handle instead > >of a pointer to the vi

Re: [PATCH v3] libstdc++: Hashing support for chrono value classes [PR110357]

2025-11-20 Thread Tomasz Kaminski
On Thu, Nov 20, 2025 at 6:37 PM Jonathan Wakely wrote: > On Thu, 20 Nov 2025 at 14:28 +0100, Tomasz Kamiński wrote: > >This patch implements P2592R3 Hashing support for std::chrono value > classes. > > > >To avoid the know issues with current hashing of integer types (see > PR104945), > >we use c

[PATCH v2 0/9] aarch64: Add fp8 sme 2.1 features per ACLE 2024Q4

2025-11-20 Thread Claudio Bantaloukas
This patch series completes support for SME2 and SME2p1 intrinsics relative to modal 8bit floating point types. - The first patch in the series introduces tests for using luti intrinsics with mf8 that was already working since their introduction, now that their use is documented in ACLE. - T

Re: [PATCH] libstdc++: Implement P3223R2 Making std::istream::ignore less surprising

2025-11-20 Thread Jonathan Wakely
On Sat, 15 Nov 2025 at 19:48, Jonathan Wakely wrote: > > On Sat, 15 Nov 2025 at 16:09, Yuao Ma wrote: > > > > On Thu, Nov 13, 2025 at 11:40 PM Jonathan Wakely wrote: > > > > And I'm a bit confused here. Why does adding `_Tp = _CharT` prevent > > > > the overload from appearing for wstream? I'm n

Re: [PATCH] libstdc++: implement P3044R2 - sub-string_view from string

2025-11-20 Thread Jonathan Wakely
On Fri, 21 Nov 2025 at 01:50 +0800, Yuao Ma wrote: Hi all, This patch implements P3044R2 by adding a subview function for string and string_view. The implementation delegates directly to substr. Tested on x86_64-linux. Also, could you please help review my other patch regarding P3223R2 at https:

Re: [PATCH v2] fold-mem-offsets: Convert from DF to RTL-SSA

2025-11-20 Thread Jeff Law
On 11/20/25 10:58 AM, Konstantinos Eleftheriou wrote: A new version is on the list (https://gcc.gnu.org/pipermail/gcc- patches/2025-November/701395.html ). It turns out that I hadn't applied some changes before testing, s

Re: [PATCH v2] fold-mem-offsets: Convert from DF to RTL-SSA

2025-11-20 Thread Konstantinos Eleftheriou
A new version is on the list ( https://gcc.gnu.org/pipermail/gcc-patches/2025-November/701395.html). It turns out that I hadn't applied some changes before testing, so this was OK on RISC-V too. The new version re-enables it on all targets. Konstantinos. On Fri, Nov 14, 2025 at 7:55 PM Jeff Law

[PATCH v3] fold-mem-offsets: Convert from DF to RTL-SSA

2025-11-20 Thread Konstantinos Eleftheriou
This patch converts the fold-mem-offsets pass from DF to RTL-SSA. Along with this conversion, the way the pass collects information was completely reworked. Instead of visiting each instruction multiple times, this is now down only once. Most significant changes are: * The pass operates mainly on

[PATCH] libstdc++: implement P3044R2 - sub-string_view from string

2025-11-20 Thread Yuao Ma
Hi all, This patch implements P3044R2 by adding a subview function for string and string_view. The implementation delegates directly to substr. Tested on x86_64-linux. Also, could you please help review my other patch regarding P3223R2 at https://gcc.gnu.org/pipermail/libstdc++/2025-November/06436

Re: [PATCH 4/4] openmp: Bump Version from 4.5 to 5.2

2025-11-20 Thread Sandra Loosemore
On 11/19/25 19:00, Gio T wrote: This patch alters the documentation to reflect the version change, deprecations, and current implementation status of OpenMP. Built/tested x86_64-pc-linux-gnu. I observed a buglet: diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi index 3a7d1

Re: How to distinguish an anonymous structure TYPE when it is the top-level type or not

2025-11-20 Thread Joseph Myers
On Wed, 19 Nov 2025, Qing Zhao wrote: > Hi, > > For the following two cases: > > A. Anonymous structure type is a top-level type: > > struct { > int a; > char c[] __attribute__ ((counted_by (a))); > }; > > B. Anonymous structure type is the type for an unnamed field of another > structu

Re: [PATCH v3] libstdc++: Hashing support for chrono value classes [PR110357]

2025-11-20 Thread Jonathan Wakely
On Thu, 20 Nov 2025 at 14:28 +0100, Tomasz Kamiński wrote: This patch implements P2592R3 Hashing support for std::chrono value classes. To avoid the know issues with current hashing of integer types (see PR104945), we use chrono::__int_hash function that hash the bytes of representation, instead

Re: [PATCH v2 1/2] libstdc++: Optimize functor storage for transform views iterators.

2025-11-20 Thread Jonathan Wakely
On Thu, 20 Nov 2025 at 11:39 +0100, Tomasz Kamiński wrote: The iterators for transform views (views::transform, views::zip_transform, and views::adjacent_transform) now store a __detail::__func_handle instead of a pointer to the view object (_M_parent). The behavior of the __func_handle speciali

[PATCH] gcc: Set native_system_header_dir on aarch64-mingw

2025-11-20 Thread FX Coudert
Provide a sensible default value for native_system_header_dir, namely /mingw/include, on aarch64-mingw. This is in line with the expectations for mingw file locations, and is already set on both x86- and x86_64-mingw. gcc/ChangeLog: * config.gcc (aarch64-*-mingw*): Set native_system_header

[PATCH 4/4] libstdc++: Remove cv-qualifiers from type of std::optional's contained value

2025-11-20 Thread Jonathan Wakely
I think this was the only part of the recently-approved LWG 4015 changes which affect our implementation, because we already store the value as a union member, and already have accessors for that value which are not prone to the ADL problems solved by changes like replacing *rhs with rhs.operator*(

[PATCH 2/4] libstdc++: Implement LWG 4366 for std::expected comparisons

2025-11-20 Thread Jonathan Wakely
This modifies the equality comparisons for std::expected so that they do not use explicit conversions to bool, to match the constraints which are specified in terms of "convertible to" which implies implicitly convertible. As a result of those changes, we cannot use logical expressions with && or |

[PATCH 3/4] libstdc++: Implement LWG 4370 for std::optional comparisons

2025-11-20 Thread Jonathan Wakely
This modifies the relational comparisons for std::optional so that they do not use logical expressions with && or || that involve the comparisons on the contained values, because x && (*y == *z) might do the wrong thing if *y == *z does not return bool. libstdc++-v3/ChangeLog: * include/s

[PATCH 1/4] libstdc++: Implement LWG 4406 for std::optional and std::expected

2025-11-20 Thread Jonathan Wakely
This adjusts the return statements of optional::value_or and expected::value_or to not perform explicit conversions, so that the actual conversion performed matches the requirements expressed in the Mandates: elements. Also adjust the return types to remove cv-qualifiers (LWG 3424). libstdc++-v3/

Re: [PATCH 5/7] c++: Add detailed diagnostics for __is_layout_compatible

2025-11-20 Thread Jason Merrill
On 11/20/25 4:02 PM, Nathaniel Shead wrote: On Wed, Nov 19, 2025 at 12:08:58PM +0530, Jason Merrill wrote: On 10/26/25 7:33 AM, Nathaniel Shead wrote: OK for trunk? -- >8 -- This reorders some checks in layout_compatible_type_p to promote more useful diagnostics as well and try to avoid dupli

Re: [PATCH v2 4/7] c++: Add detailed diagnostics for __builtin_has_unique_object_representations

2025-11-20 Thread Jason Merrill
On 11/20/25 3:59 PM, Nathaniel Shead wrote: On Wed, Nov 19, 2025 at 11:45:59AM +0530, Jason Merrill wrote: On 10/26/25 7:33 AM, Nathaniel Shead wrote: I experimented with doing the explanations recursively (so e.g. when explaining that a field doesn't have unique object representations, go on t

[COMMITTED] MAINTAINERS: Add myself in forge integration maintainers

2025-11-20 Thread Claudio Bantaloukas
ChangeLog: * MAINTAINERS: Add myself in forge integration maintainers --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 4f2989b2b14..ae451ae1818 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -270,6 +270,7 @@ gdbhooks.py David

Re: [PATCH v3 2/5] asf: Add cost function for store/load reordering

2025-11-20 Thread Jeff Law
On 11/20/25 9:37 AM, Richard Biener wrote: Am 20.11.2025 um 16:53 schrieb Jeff Law :  On 11/19/25 9:42 AM, Andi Kleen wrote: I know I was pushing for it to be enabled more widely as it's painfully hard to forward from a narrow store to a wider load. But based on earlier discussions I'v

Re: [PATCH v3 2/5] asf: Add cost function for store/load reordering

2025-11-20 Thread Richard Biener
> Am 20.11.2025 um 16:53 schrieb Jeff Law : > >  > > On 11/19/25 9:42 AM, Andi Kleen wrote: >>> I know I was pushing for it to be enabled more widely as it's painfully hard >>> to forward from a narrow store to a wider load. But based on earlier >>> discussions I've backed off that position.

[committed v2 01/10] libstdc++: Prepare mdspan-related code for submdspan.

2025-11-20 Thread Tomasz Kamiński
From: Luc Grosheintz The changes needed for submdspan are: * In submdspan related code the user-defined integer-like types need to be copy- and move-constructable. * The traits for writing tests that work with both left- and right, possibly padded, layouts will also be useful for su

Re: [PATCH v3] RISC-V: Implement RISC-V profile macro support

2025-11-20 Thread Christoph Müllner
Hi Zhongyao, Jeff, and Kito, In the discussion of this feature in the RISC-V C API PR [1], Craig brought up a compatibility issue: "Developer writes code for RVA23U64 today. In the future the code is compiled with RVA30U64 that is superset of RVA23U64. __riscv_rva23u64 macro is not defined because

Re: [PATCH v2 00/10] libstdc++: submdspan

2025-11-20 Thread Tomasz Kaminski
Hi, Thank you for the patches. On patch 3 I have suggested a different approach for determining what kind of mapping we want, padded or not padded, and stopped the review there. I think I will also test the test tomorrow, and maybe see if I have other comments for patches outside of this partch.

Re: [PATCH] ch: Improve copy header when the first bbs goto __builtin_unreachable [PR122734]

2025-11-20 Thread Andrew Pinski
On Wed, Nov 19, 2025 at 6:15 PM Andrew Pinski wrote: > > On Wed, Nov 19, 2025 at 1:38 PM Andrew Pinski > wrote: > > > > With the addition of some `if (a) __builtin_unreachable();` in libstdc++, > > the loop ch might not be copying the full header and only copy the bb > > which contains the condit

[PATCH] ch: Support all noreturn calls [PR122734]

2025-11-20 Thread Andrew Pinski
Thinking about unreachable vs all noreturn calls, ch should support all noreturn calls similarly. This allows the testcase be optimized to memset as expected. This should also improve code generation of GCC code itself. Since there are a lot of `if(a)assert_failed();` calls. Also we don't want to t

  1   2   >