Re: [PATCH v2] bitint: Lower the partial limbs of extended _BitInts with m_limb_type

2025-09-08 Thread Yang Yujie
On Tue, Sep 09, 2025 at 02:18:54PM +0800, Yang Yujie wrote: > v1 -> v2: > > - Add a new test for LoongArch. Check if extensions are omitted > when loading large/huge parameters from the stack. Bootstrapped and tested on x86_64-linux-gnu and loongarch64-linux-gnu. Ok for trunk?

[PATCH v2] bitint: Lower the partial limbs of extended _BitInts with m_limb_type

2025-09-08 Thread Yang Yujie
Lower the partial limbs of extended _BitInts like the full limbs for most operations, so that explicit extensions can be inserted only where they are really needed. gcc/ChangeLog: * gimple-lower-bitint.cc (struct bitint_large_huge): Remove the abi_load_p parameter of limb_access.

[PATCH 1/1] RISC-V: Suppress cross CC sibcall optimization from vector

2025-09-08 Thread Tsukasa OI
From: Tsukasa OI In general, tail call optimization requires that the callee's saved registers are a superset of the caller's. The Standard Vector Calling Convention Variant (assembler: .variant_cc) requires that a function with this calling convention preserves vector registers v1-v7 and v24-v3

[committed] libstdc++: Fix docs for --enable-vtable-verify [PR120698]

2025-09-08 Thread Jonathan Wakely
libstdc++-v3/ChangeLog: PR libstdc++/120698 * doc/xml/manual/configure.xml: Do not claim that vtv is enabled by default. * doc/html/manual/configure.html: Regenerate. --- Pushed to trunk, backports to follow. libstdc++-v3/doc/html/manual/configure.html | 2 +- li

[PING^1][PATCH 2/2]rs6000: Fix type selection for vec_slo and vec_sll [PR118480]

2025-09-08 Thread jeevitha
Ping! please review. Thanks & Regards Jeevitha On 26/08/25 6:42 pm, jeevitha wrote: > > Hi All, > > The following patch has been bootstrapped and regtested on powerpc64le-linux. > > Previously, vec_slo/vec_sll always default to V4SI, inserting unwanted > VIEW_CONVERT_EXPR int casts. This caus

Re: [PATCH v2 1/7] mangle: Introduce C typeinfo mangling API

2025-09-08 Thread Andrew Pinski
On Mon, Sep 8, 2025 at 4:24 PM Kees Cook wrote: > > On Tue, Sep 09, 2025 at 12:13:19AM +0200, Martin Uecker wrote: > > Sorry, example should have been this: > > > > typedef int arr_t[]; > > typedef int arr3_t[3]; > > > > void f(arr3_t*); > > > > void g(void (*fp)(arr_t*)) { > > > > int a[3];

[PATCH] Fortran: make STAT/LSTAT/FSTAT intrinsics generic [PR82480]

2025-09-08 Thread Harald Anlauf
Dear all, this is the second (and hopefully final) patch to fix this PR for good. This makes the GNU intrinsics STAT/LSTAT/FSTAT almost generic, with few restrictions: - for the VALUES argument we will support only kinds 4 and 8. This allows to stay with the current runtime library functions

[PATCH v3 3/3] testsuite: LoongArch: Enable 16B atomic tests if the test machine supports LSX and SCQ

2025-09-08 Thread Xi Ruoyao
Enable those tests so we won't make too stupid mistakes in 16B atomic implementation anymore. All these test passed on a Loongson 3C6000/S except atomic-other-int128.c. With GDB patched to support sc.q (https://sourceware.org/pipermail/gdb-patches/2025-August/220034.html) this test also XPASS. g

Re: [PATCH v2 1/3] LoongArch: Fix the semantic of 16B CAS

2025-09-08 Thread Xi Ruoyao
On Fri, 2025-09-05 at 08:50 +0800, Lulu Cheng wrote: > > 在 2025/9/4 下午7:48, Lulu Cheng 写道: > > > > 在 2025/8/22 下午4:14, Xi Ruoyao 写道: > > > In a CAS operation, even if expected != *memory we still need to > > > do an > > > atomic load of *memory into output.  But I made a mistake in the > > > init

[PATCH] RISC-V: Implement Quad-precision Float extension

2025-09-08 Thread shihua
From: Liao Shihua This Patch implements the Quad-precision Float extension for RISC-V, based on Kito's work five years ago in https://github.com/riscvarchive/riscv-gcc/tree/q-ext Co-authored-by: Kito Chen gcc/ChangeLog: * config/riscv/iterators.md (fsd): Add TF mode to ANYF and ANYLS

[PATCH v3 1/3] LoongArch: Fix the "%t" modifier handling for (const_int 0)

2025-09-08 Thread Xi Ruoyao
This modifier is intended to output $r0 for (const_int 0), but the logic: GET_MODE (op) != TImode || (op != CONST0_RTX (TImode) && code != REG) will reject (const_int 0) because (const_int 0) actually does not have a mode and GET_MODE will return VOIDmode for it. Use reg_or_0_operand instead to

[PATCH v3 0/3] LoongArch: Fix ICE and semantic issue of 16B CAS

2025-09-08 Thread Xi Ruoyao
Bootstrapped and regtested on loongarch64-linux-gnu. Ok for trunk? Changes from v2 to v3: - Reorder the ICE fix before the semantic fix - Fix incorrect RTL for the fcc output Changes from v1 to v2: - Use { xfail } in { dg-final } instead of { dg-xfail-if }, because it's the thread simulation

RE: [PATCH v2] x86: Enable SSE4.1 ceil/floor/trunc for -Os

2025-09-08 Thread Liu, Hongtao
> -Original Message- > From: H.J. Lu > Sent: Tuesday, September 9, 2025 11:09 AM > To: gcc-patches@gcc.gnu.org > Cc: Liu, Hongtao ; ubiz...@gmail.com > Subject: [PATCH v2] x86: Enable SSE4.1 ceil/floor/trunc for -Os > > Enable SSE4.1 ceil/floor/trunc for -Os to replace a function call

Re: [PATCH v2 1/7] mangle: Introduce C typeinfo mangling API

2025-09-08 Thread Kees Cook
On Mon, Sep 08, 2025 at 04:36:57PM -0700, Andrew Pinski wrote: > On Mon, Sep 8, 2025 at 4:24 PM Kees Cook wrote: > > > > On Tue, Sep 09, 2025 at 12:13:19AM +0200, Martin Uecker wrote: > > > Sorry, example should have been this: > > > > > > typedef int arr_t[]; > > > typedef int arr3_t[3]; > > > >

Re: [PATCH] x86: Enable SSE4.1 ceil/floor/trunc for -Os

2025-09-08 Thread H.J. Lu
On Mon, Sep 8, 2025 at 7:14 PM Hongtao Liu wrote: > > On Tue, Sep 9, 2025 at 4:26 AM H.J. Lu wrote: > > > > Enable SSE4.1 ceil/floor/trunc for -Os to replace a function call with > > roundss or roundsd. > > > > gcc/ > > > > PR target/121861 > > * config/i386/i386.cc (ix86_optab_su

[PATCH v2] x86: Enable SSE4.1 ceil/floor/trunc for -Os

2025-09-08 Thread H.J. Lu
Enable SSE4.1 ceil/floor/trunc for -Os to replace a function call with roundss or roundsd by dropping !flag_trapping_math. gcc/ PR target/121861 * config/i386/i386.cc (ix86_optab_supported_p): Drop !flag_trapping_math check for floor_optab, ceil_optab and btrunc_op

[PATCH 0/1] RISC-V: Suppress cross CC sibcall optimization from vector

2025-09-08 Thread Tsukasa OI
Hi all, Note that the commit message of PATCH 1/1 describes pretty much the same as this cover letter but the cover letter explains its background, real (example) assembly code and LLVM status. So, refer the commit message only when necessary. While I'm working with a Rust compiler dev and experi

[PATCH v1 0/2] Refine the unnecessary cast for widen-mul

2025-09-08 Thread pan2 . li
From: Pan Li In some cases the widen-mul may generate unnecessary cast similar as below, this patch series would like to refine it. Then, some pattern match like SAT_MUL could be simplified based on it. 29 │ _1 = (__int128 unsigned) a_8(D); 30 │ _2 = (__int128 unsigned) b_9(D); 31

Re: [PATCH] x86: Enable SSE4.1 ceil/floor/trunc for -Os

2025-09-08 Thread Hongtao Liu
On Tue, Sep 9, 2025 at 4:26 AM H.J. Lu wrote: > > Enable SSE4.1 ceil/floor/trunc for -Os to replace a function call with > roundss or roundsd. > > gcc/ > > PR target/121861 > * config/i386/i386.cc (ix86_optab_supported_p): Return true for > SSE4.1 with SSE math for floor_op

[PATCH v1 1/2] Widening-Mul: Refine build_and_insert_cast when rhs is cast

2025-09-08 Thread pan2 . li
From: Pan Li The widening-mul will insert a cast for the widen-mul, the function build_and_insert_cast is design to take care of it. In some case the optimized gimple has some unnecessary cast, for example as below code. #define SAT_U_MUL_FMT_5(NT, WT) \ NT __attribute__((no

[PATCH v1 2/2] Match: Adjust the unsigned SAT_MUL pattern

2025-09-08 Thread pan2 . li
From: Pan Li The widen-mul removed the unnecessary cast, thus adjust the SAT_MUL of wide-mul to a simpler form. gcc/ChangeLog: * match.pd: Remove unnecessary cast of unsigned SAT_MUL for widen-mul. Signed-off-by: Pan Li --- gcc/match.pd | 4 ++-- 1 file changed, 2 insertions(

Re: [RFC v1] c: Deprecate more than one list of forward declarations of parameters

2025-09-08 Thread Alejandro Colomar
Hi Joseph, On Mon, Sep 08, 2025 at 09:21:20PM +, Joseph Myers wrote: > On Sat, 6 Sep 2025, Alejandro Colomar wrote: > > > While this syntax is not standard, there's a certain degree of consensus > > within the C Committee that, if this was ever standardized, there's a > > preference to have a

Re: [PATCH v2 1/7] mangle: Introduce C typeinfo mangling API

2025-09-08 Thread Andrew Pinski
On Mon, Sep 8, 2025 at 4:36 PM Andrew Pinski wrote: > > On Mon, Sep 8, 2025 at 4:24 PM Kees Cook wrote: > > > > On Tue, Sep 09, 2025 at 12:13:19AM +0200, Martin Uecker wrote: > > > Sorry, example should have been this: > > > > > > typedef int arr_t[]; > > > typedef int arr3_t[3]; > > > > > > void

Re: [PATCH][V2] Reimplement __gnu_cxx::__ops operators

2025-09-08 Thread Jonathan Wakely
On Mon, 8 Sept 2025 at 21:06, Jonathan Wakely wrote: > > On Mon, 8 Sept 2025 at 20:59, François Dumont wrote: > > > > This is V2 of this patch. Main diff with initial version is that I > > restored the copy of functors in C++98. > > > > I'm all ears for a new name for the _GLIBCXX_CP_FWDREF macro

Re: [PATCH v2 1/7] mangle: Introduce C typeinfo mangling API

2025-09-08 Thread Kees Cook
On Tue, Sep 09, 2025 at 12:13:19AM +0200, Martin Uecker wrote: > Sorry, example should have been this: > > typedef int arr_t[]; > typedef int arr3_t[3]; > > void f(arr3_t*); > > void g(void (*fp)(arr_t*)) { > > int a[3]; > (*fp)(&a); // this call would fail? > } > > int h()

[PATCH v3] testsuite: Add tests for PR c/107419 and PR c++/107393

2025-09-08 Thread H.J. Lu
Both C and C++ frontends should set a tentative TLS model in grokvardecl and update TLS mode with the default TLS access model after a TLS variable has been fully processed if the default TLS access model is stronger. PR c/107419 PR c++/107393 * c-c++-common/tls-attr-common

Re: [PATCH v1 0/1] c: Add support for array parameters in _Countof

2025-09-08 Thread Alejandro Colomar
Hi Joseph, On Mon, Sep 08, 2025 at 09:34:23PM +, Joseph Myers wrote: > On Mon, 8 Sep 2025, Alejandro Colomar wrote: > > > BTW, I'm wondering about the following: > > > > alx@debian:~/tmp$ cat fwd.c > > void j(void; int x); > > void k(void; void); > > void l(void; ...); > >

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

2025-09-08 Thread Kees Cook
On Mon, Sep 08, 2025 at 05:32:58PM +0200, Peter Zijlstra wrote: > On Fri, Sep 05, 2025 at 09:19:29AM -0700, Kees Cook wrote: > > On Fri, Sep 05, 2025 at 10:51:03AM +0200, Peter Zijlstra wrote: > > > On Thu, Sep 04, 2025 at 05:24:10PM -0700, Kees Cook wrote: > > > > +- The check-call instruction seq

[PATCH] Ignore tls_model attribute in TLS access optimization

2025-09-08 Thread H.J. Lu
Don't check tls_model attribute when optimizing TLS access since 1. -ftls-model=initial-exec also can specify tls_model without tls_model attribute. 2. Linker can optimize TLS access at link-time. 3. LTO should perform the similar optimization. Since C, C++, and Fortran front-ends now set the TLS

Re: [PATCH v2 1/7] mangle: Introduce C typeinfo mangling API

2025-09-08 Thread Martin Uecker
Am Dienstag, dem 09.09.2025 um 00:12 +0200 schrieb Martin Uecker: > Am Montag, dem 08.09.2025 um 14:51 -0700 schrieb Kees Cook: > > On Sun, Sep 07, 2025 at 11:25:19AM +0200, Martin Uecker wrote: > > > Am Donnerstag, dem 04.09.2025 um 17:24 -0700 schrieb Kees Cook: > > > > To support the KCFI type-i

Re: [PATCH v2 1/7] mangle: Introduce C typeinfo mangling API

2025-09-08 Thread Martin Uecker
Am Montag, dem 08.09.2025 um 14:51 -0700 schrieb Kees Cook: > On Sun, Sep 07, 2025 at 11:25:19AM +0200, Martin Uecker wrote: > > Am Donnerstag, dem 04.09.2025 um 17:24 -0700 schrieb Kees Cook: > > > To support the KCFI type-id which needs to convert unique function > > > prototypes into unique 32-b

Re: [PATCH] Fortran: make STAT/LSTAT/FSTAT intrinsics generic [PR82480]

2025-09-08 Thread Jerry D
On 9/8/25 12:59 PM, Harald Anlauf wrote: Dear all, this is the second (and hopefully final) patch to fix this PR for good. This makes the GNU intrinsics STAT/LSTAT/FSTAT almost generic, with few restrictions: - for the VALUES argument we will support only kinds 4 and 8.   This allows to stay w

Re: [PATCH 1/2 v2] c++: Implement P1494 and P3641 Partial program correctness [PR119060].

2025-09-08 Thread Richard Biener
On Mon, Sep 8, 2025 at 11:44 AM Iain Sandoe wrote: > > > > > On 8 Sep 2025, at 08:57, Richard Biener wrote: > > > > On Sun, Sep 7, 2025 at 9:43 PM Iain Sandoe wrote: > >> > >> Thanks for the helpful input from reviewers; > >> > >> This version has 4 changes from v1: > >> 1. removes some unrelate

Re: [RFC v1] c: Deprecate more than one list of forward declarations of parameters

2025-09-08 Thread Joseph Myers
On Sat, 6 Sep 2025, Alejandro Colomar wrote: > While this syntax is not standard, there's a certain degree of consensus > within the C Committee that, if this was ever standardized, there's a > preference to have a single list of forward declarations of parameters. I think that's exaggerating con

[Ada] Fix PR ada/121532

2025-09-08 Thread Eric Botcazou
This PR is about spurious failures of the ACATS-4 test cxai033, which uses tasking. This tentatively applies the same tweak as in other similar cases. Tested on x86-64/Linux, applied on the mainline. 2025-09-08 Eric Botcazou PR ada/121532 * ada/acats-4/tests/cxa/cxai033.a:

[PATCH v1] libstdc++: Implement std::layout_left_padded.

2025-09-08 Thread Luc Grosheintz
I decided to deviate once (described in detail in the commit message). Without this deviation writing tests is very clumsy and sometimes not possible, e.g. when mixing uint8_t and dynamic padding values to check mandates w.r.t. representability. Previously, we discussed other ways of fixing the iss

[PATCH] x86: Enable SSE4.1 ceil/floor/trunc for -Os

2025-09-08 Thread H.J. Lu
Enable SSE4.1 ceil/floor/trunc for -Os to replace a function call with roundss or roundsd. gcc/ PR target/121861 * config/i386/i386.cc (ix86_optab_supported_p): Return true for SSE4.1 with SSE math for floor_optab, ceil_optab and btrunc_optab. gcc/testsuite/

Re: [PATCH][V2] Reimplement __gnu_cxx::__ops operators

2025-09-08 Thread Jonathan Wakely
On Mon, 8 Sept 2025 at 20:59, François Dumont wrote: > > This is V2 of this patch. Main diff with initial version is that I > restored the copy of functors in C++98. > > I'm all ears for a new name for the _GLIBCXX_CP_FWDREF macros. Great, I was going to ask you about the status of this patch. I'

Re: [PATCH] D, Darwin: Check for __fork before trying to use it.

2025-09-08 Thread Iain Buclaw
Excerpts from Iain Sandoe's message of September 8, 2025 9:28 pm: > hi Iain > >> On 8 Sep 2025, at 20:24, Iain Buclaw wrote: >> >> Excerpts from Iain Buclaw's message of September 8, 2025 6:27 pm: >>> Excerpts from Iain Sandoe's message of September 6, 2025 9:27 pm: Tested on x86_64-darwin2

Re: [PATCH 1/2 v2] c++: Implement P1494 and P3641 Partial program correctness [PR119060].

2025-09-08 Thread Iain Sandoe
> On 8 Sep 2025, at 15:53, Richard Biener wrote: > > > >> Am 08.09.2025 um 16:28 schrieb Iain Sandoe : >> >>  >> On 8 Sep 2025, at 15:20, Iain Sandoe wrote: > On 8 Sep 2025, at 15:05, Jakub Jelinek wrote: On Mon, Sep 08, 2025 at 02:54:18PM +0100, Ia

Re: [PATCH] D, Darwin: Check for __fork before trying to use it.

2025-09-08 Thread Iain Sandoe
hi Iain > On 8 Sep 2025, at 20:24, Iain Buclaw wrote: > > Excerpts from Iain Buclaw's message of September 8, 2025 6:27 pm: >> Excerpts from Iain Sandoe's message of September 6, 2025 9:27 pm: >>> Tested on x86_64-darwin21 (has __fork) and x86_64-darwin10 (does not). >>> OK for trunk? >>> thanks

[PATCH V3 1/2] Match: Support SAT_TRUNC variant NARROW_CLIP

2025-09-08 Thread Edwin Lu
This patch tries to add support for a variant of SAT_TRUNC where negative numbers are clipped to 0 instead of NARROW_TYPE_MAX_VALUE. This form is seen in x264, aka UT clip (T a) { return a & (UT)(-1) ? (-a) >> 31 : a; } Where sizeof(UT) < sizeof(T) I'm unable to get the SAT_TRUNC pattern to ap

Re: [PATCH] libstdc++: Fix up [PR121827]

2025-09-08 Thread Jonathan Wakely
On Mon, 8 Sept 2025 at 09:25, Jakub Jelinek wrote: > > Hi! > > During the tests mentioned in > https://gcc.gnu.org/pipermail/gcc-patches/2025-August/692482.html > (but dunno why I haven't noticed it back in August but only when testing > https://gcc.gnu.org/pipermail/gcc-patches/2025-September/694

Re: [PATCH v2 2/3] libstdc++: Allow std::shared_ptr reference counts to be negative [PR71945]

2025-09-08 Thread Tomasz Kaminski
On Mon, Sep 8, 2025 at 2:56 PM Jonathan Wakely wrote: > This change doubles the effective range of the std::shared_ptr and > std::weak_ptr reference counts for most 64-bit targets. > > The counter type, _Atomic_word, is usually a signed 32-bit int (except > on Solaris v9 where it is a signed 64-b

Re: [PATCH 1/2 v2] c++: Implement P1494 and P3641 Partial program correctness [PR119060].

2025-09-08 Thread Richard Biener
On Sun, Sep 7, 2025 at 9:43 PM Iain Sandoe wrote: > > Thanks for the helpful input from reviewers; > > This version has 4 changes from v1: > 1. removes some unrelated changes. > 2. As per Jakub's observations, we now special-case >std::observable_checkpoint so that it is guaranteed to be lower

RE: PING: [PATCH] libbid: Set rounding mode to round-to-nearest for _Decimal128 arithmetic

2025-09-08 Thread Cornea, Marius
Hello, Ahmet will be back only on Oct 6. However, I do not fully understand this request. Where does this requirement come from: “_Decimal128 arithmetic requires the round-to-nearest rounding mode”? Is that the DFP rounding mode set in SW using DFP library functions, or the BFP (Binary Floatin

[PATCH V3 0/2] Add support for vectorizing x264 vnclipu idiom [PR120378]

2025-09-08 Thread Edwin Lu
Respin of https://gcc.gnu.org/pipermail/gcc-patches/2025-August/691426.html but separates the middle end vectorizer changes from the RISC-V target specific changes. The patch changes the riscv loop codegen from vsetvli a5,a2,e32,m1,ta,mu vle32.v v1,0(a1) sllia4,a5,2

[c-family] Fix PR ada/121544

2025-09-08 Thread Eric Botcazou
This is about -fdump-ada-spec not generating the definition of the structure for pointers to anonymous structure as structure elements. Tested on x86-64/Linux, applied on the mainline. 2025-09-08 Eric Botcazou PR ada/121544 * c-ada-spec.cc (dump_ada_node) : Dump the name of

Re: [PATCH v6] libstdc++: Implement Philox Engine (PR119794)

2025-09-08 Thread Jonathan Wakely
Some of the tests use { dg-do run } but don't actually do anything, they just refer to some typedefs. Those should be { dg-do compile } instead of run.

Re: [PATCH v6] libstdc++: Implement Philox Engine (PR119794)

2025-09-08 Thread Jonathan Wakely
On Mon, 8 Sept 2025 at 18:18, Jonathan Wakely wrote: > > All the new tests fail on 32-bit targets because they don't have > __uint128_t so the philox engines aren't defined. > > We should add this to them all: > > // { dg-require-cpp-feature-test __cpp_lib_philox_engine } And we don't need dg-req

Re: [PATCH v6] libstdc++: Implement Philox Engine (PR119794)

2025-09-08 Thread Jonathan Wakely
All the new tests fail on 32-bit targets because they don't have __uint128_t so the philox engines aren't defined. We should add this to them all: // { dg-require-cpp-feature-test __cpp_lib_philox_engine }

Re: [PATCH 1/2 v2] c++: Implement P1494 and P3641 Partial program correctness [PR119060].

2025-09-08 Thread Richard Biener
> Am 08.09.2025 um 17:53 schrieb Iain Sandoe : > >  > >>> On 8 Sep 2025, at 15:53, Richard Biener wrote: >>> >>> >>> Am 08.09.2025 um 16:28 schrieb Iain Sandoe : >>> >>>  >>> > On 8 Sep 2025, at 15:20, Iain Sandoe wrote: > > > >> On 8 Sep 2025, at 15:05, Ja

[PATCH v3] c++: Fix mangling of _Float16 template args [PR121801]

2025-09-08 Thread Matthias Kretz
* adjusted the test with 'float16' as pointed out * moved common real_to_target call before the branch * added assertions for multiple of 32 or exactly 16 bits * added a comment to the branch The long double mangling issue should get its own PR & patch. Tested on x86_64. However, I got a CI fa

Re: [PATCH] c++: Fix mangling of _Float16 template args [PR121801]

2025-09-08 Thread Andreas Schwab
On Sep 08 2025, Jason Merrill wrote: > How about MODE_PRECISION (TYPE_MODE (type))? That's wrong for XFmode on m68k. It has a mode precsion of 80 bits, but a size of 12 bytes (and the padding bits are in the middle). -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5

Re: [PATCH] c++: Fix mangling of _Float16 template args [PR121801]

2025-09-08 Thread Jakub Jelinek
On Mon, Sep 08, 2025 at 05:40:00PM +0200, Jason Merrill wrote: > > Also, the question is if we don't use the TYPE_SIZE_UNIT or TYPE_SIZE > > to determine how many hex digits to print, what else should be used. > > For decimal floating point, I think we need to keep doing what we used > > before, th

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

2025-09-08 Thread Peter Zijlstra
On Fri, Sep 05, 2025 at 09:19:29AM -0700, Kees Cook wrote: > On Fri, Sep 05, 2025 at 10:51:03AM +0200, Peter Zijlstra wrote: > > On Thu, Sep 04, 2025 at 05:24:10PM -0700, Kees Cook wrote: > > > +- The check-call instruction sequence must be treated a single unit: it > > > + cannot be rearranged or

Re: [PATCH v6] libstdc++: Implement Philox Engine (PR119794)

2025-09-08 Thread Jonathan Wakely
On Mon, 08 Sep 2025 at 15:55 +0100, Jonathan Wakely wrote: On Tue, 05 Aug 2025 at 09:21 +, 1nfocalypse wrote: Implements Philox Engine (P2075R6) and associated tests. Implements additional feedback from v5 from Patrick Palka. Also cut some trailing whitespace from the limb propagation fix i

Re: [PATCH v6] libstdc++: Implement Philox Engine (PR119794)

2025-09-08 Thread Jonathan Wakely
Since these are all minor style issues and changes to comments, I'm happy to make the changes myself before pushing the patch. But first, does anybody have any comments on my comments? :-) On Mon, 8 Sept 2025 at 15:57, Jonathan Wakely wrote: > > On Tue, 05 Aug 2025 at 09:21 +, 1nfocalypse w

Re: [PATCH] c++: Fix mangling of _Float16 template args [PR121801]

2025-09-08 Thread Jason Merrill
On 9/8/25 4:33 PM, Matthias Kretz wrote: On 8 September 2025 16:03:21 CEST, Jason Merrill wrote: On 9/8/25 8:11 AM, Matthias Kretz wrote: Andrew Pinski [Friday, 5 September 2025, 22:57:02 CEST]: It seems that Clang and GCC disagree on mangling 80-Bit long double: https://compiler-explorer.

Re: [PATCH] pr107421.f90: Pass -fPIE for non-x86 targets

2025-09-08 Thread Sam James
"H.J. Lu" writes: > On Mon, Sep 8, 2025 at 7:31 AM Sam James wrote: >> >> This didn't show up in my inbox for some reason, so sorry for awkward >> reply: >> >> Can you do this? { dg-additional-options "-fPIE" { target pie } } >> > > This test requires no direct access to external symbols from >

Re: [PATCH v6] libstdc++: Implement Philox Engine (PR119794)

2025-09-08 Thread Jonathan Wakely
On Tue, 05 Aug 2025 at 09:21 +, 1nfocalypse wrote: Implements Philox Engine (P2075R6) and associated tests. Implements additional feedback from v5 from Patrick Palka. Also cut some trailing whitespace from the limb propagation fix in v5. Apologies for the delay from v5 - I had to finish wri

Re: [PATCH] fortran: implement conditional expression for fortran 2023

2025-09-08 Thread Tobias Burnus
Yuao Ma wrote: And the latter does not handle EXPR_CONDITIONAL. Thanks for the tip! It turns out that not only does gfc_traverse_expr fail to handle conditional expressions, but check_restricted and gfc_check_init_expr don't either. I've added all the necessary fixes, and the test case is now in

Re: [PATCH 1/2 v2] c++: Implement P1494 and P3641 Partial program correctness [PR119060].

2025-09-08 Thread Richard Biener
> Am 08.09.2025 um 16:28 schrieb Iain Sandoe : > >  > >>> On 8 Sep 2025, at 15:20, Iain Sandoe wrote: >>> >>> >>> On 8 Sep 2025, at 15:05, Jakub Jelinek wrote: >>> >>> On Mon, Sep 08, 2025 at 02:54:18PM +0100, Iain Sandoe wrote: (for pre-conditions) they lower to a series of

Re: [PATCH] pr107421.f90: Pass -fPIE for non-x86 targets

2025-09-08 Thread H.J. Lu
On Mon, Sep 8, 2025 at 7:31 AM Sam James wrote: > > This didn't show up in my inbox for some reason, so sorry for awkward > reply: > > Can you do this? { dg-additional-options "-fPIE" { target pie } } > This test requires no direct access to external symbols from executable. On x86, -mno-direct-

Re: [PATCH 1/2 v2] c++: Implement P1494 and P3641 Partial program correctness [PR119060].

2025-09-08 Thread Iain Sandoe
> On 8 Sep 2025, at 15:01, Richard Biener wrote: > > On Mon, Sep 8, 2025 at 3:54 PM Iain Sandoe wrote: >> >> >> >>> On 8 Sep 2025, at 14:40, Richard Biener wrote: >>> >>> On Mon, Sep 8, 2025 at 3:16 PM Jakub Jelinek wrote: On Mon, Sep 08, 2025 at 03:05:58PM +0200, Richard Bie

Re: [WIP] C++ vs. -ftrivial-auto-var-init=

2025-09-08 Thread Qing Zhao
> On Sep 6, 2025, at 10:10, Jason Merrill wrote: > > On 9/4/25 10:42 PM, Qing Zhao wrote: >>> On Sep 4, 2025, at 16:15, Jakub Jelinek wrote: >>> >>> On Thu, Sep 04, 2025 at 07:47:17PM +, Qing Zhao wrote: > On Sep 4, 2025, at 11:01, Jakub Jelinek wrote: > > On Thu, Sep 04, 20

Re: [PATCH] c++: Fix mangling of _Float16 template args [PR121801]

2025-09-08 Thread Jakub Jelinek
On Mon, Sep 08, 2025 at 04:03:21PM +0200, Jason Merrill wrote: > On 9/8/25 8:11 AM, Matthias Kretz wrote: > > Andrew Pinski [Friday, 5 September 2025, 22:57:02 CEST]: > > > > It seems that Clang and GCC disagree on mangling 80-Bit long double: > > > > > > > > https://compiler-explorer.com/z/W1d64P

Re: [PATCH 1/2 v2] c++: Implement P1494 and P3641 Partial program correctness [PR119060].

2025-09-08 Thread Iain Sandoe
> On 8 Sep 2025, at 15:20, Iain Sandoe wrote: > > > >> On 8 Sep 2025, at 15:05, Jakub Jelinek wrote: >> >> On Mon, Sep 08, 2025 at 02:54:18PM +0100, Iain Sandoe wrote: >>> (for pre-conditions) they lower to a series of statements like >>> if (some check fails) >>> handle the contract vio

[committed] libstdc++: Make syncbuf _S_get_mutex definition extern.

2025-09-08 Thread Nathan Myers
This patch creates a global function __syncbuf_get_mutex, gated by _GLIBCXX_HAS_GTHREADS, replacing a static instantiated member _S_get_mutex used in syncbuf<> construction, and makes the global symbol visible. A static local table of 16 mutexes is shared among all specializations of syncbuf<>, cho

Re: [PATCH 1/2 v2] c++: Implement P1494 and P3641 Partial program correctness [PR119060].

2025-09-08 Thread Iain Sandoe
> On 8 Sep 2025, at 15:05, Jakub Jelinek wrote: > > On Mon, Sep 08, 2025 at 02:54:18PM +0100, Iain Sandoe wrote: >> (for pre-conditions) they lower to a series of statements like >> if (some check fails) >> handle the contract violation >> if (some other check fails) >> handle the contrac

[PATCH] libstdc++: optimize weak_ptr converting constructor/assignment

2025-09-08 Thread Tomasz Kamiński
From: Giuseppe D'Angelo Converting a weak_ptr to a weak_ptr requires calling lock() on the source object in the general case. Although the source weak_ptr does contain a raw pointer to Derived, we can't just get it and (up)cast it to Base, as that will dereference the pointer in case Base is a v

Re: [PATCH] RISC-V: Adjust tt-ascalon-d8 branch cost

2025-09-08 Thread Jeff Law
On 9/8/25 1:08 AM, Robin Dapp wrote: diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc index 07d40f459e3..bfd43fba101 100644 --- a/gcc/config/riscv/riscv.cc +++ b/gcc/config/riscv/riscv.cc @@ -659,7 +659,7 @@ static const struct riscv_tune_param tt_ascalon_d8_tune_info = {  

Re: [PATCH] c++: Fix mangling of _Float16 template args [PR121801]

2025-09-08 Thread Jason Merrill
On 9/8/25 8:11 AM, Matthias Kretz wrote: Andrew Pinski [Friday, 5 September 2025, 22:57:02 CEST]: It seems that Clang and GCC disagree on mangling 80-Bit long double: https://compiler-explorer.com/z/W1d64PjrP I like Clang's interpretation of https://itanium-cxx-abi.github.io/cxx-abi/ abi.html#

Re: [PATCH] testsuite: Another fixup for fixed-point/bitint-1.c test

2025-09-08 Thread Jakub Jelinek
On Mon, Sep 08, 2025 at 09:51:32PM +0800, Xi Ruoyao wrote: > Besides r16-3595, there's another bug in this test: with -std=c23 the > token _Sat isn't recognized as a keyword at all, thus an error massage > different from the expected will be outputted. > > Fix it by using -std=gnu23 instead. > >

Re: [PATCH 1/2 v2] c++: Implement P1494 and P3641 Partial program correctness [PR119060].

2025-09-08 Thread Iain Sandoe
> On 8 Sep 2025, at 14:40, Richard Biener wrote: > > On Mon, Sep 8, 2025 at 3:16 PM Jakub Jelinek wrote: >> >> On Mon, Sep 08, 2025 at 03:05:58PM +0200, Richard Biener wrote: >>> is reduced to __builtin_abort () (for C++). That's because it's >>> __builtin_unreachable () at the end. I am n

[PATCH] testsuite: Another fixup for fixed-point/bitint-1.c test

2025-09-08 Thread Xi Ruoyao
Besides r16-3595, there's another bug in this test: with -std=c23 the token _Sat isn't recognized as a keyword at all, thus an error massage different from the expected will be outputted. Fix it by using -std=gnu23 instead. gcc/testsuite: * gcc.dg/fixed-point/bitint-1.c (dg-options): Use

Re: [PATCH 1/2 v2] c++: Implement P1494 and P3641 Partial program correctness [PR119060].

2025-09-08 Thread Richard Biener
On Mon, Sep 8, 2025 at 3:16 PM Jakub Jelinek wrote: > > On Mon, Sep 08, 2025 at 03:05:58PM +0200, Richard Biener wrote: > > is reduced to __builtin_abort () (for C++). That's because it's > > __builtin_unreachable () at the end. I am not aware of any > > other "UB" than missed return that we tur

Re: [PATCH] tree-optimization/121844 - IVOPTs and asm goto in latch

2025-09-08 Thread Richard Biener
On Mon, 8 Sep 2025, Jakub Jelinek wrote: > On Mon, Sep 08, 2025 at 02:38:48PM +0200, Richard Biener wrote: > > When there's an asm goto in the latch of a loop we may not use > > IP_END IVs since instantiating those would (need to) split the > > latch edge which in turn invalidates IP_NORMAL positi

Re: [PATCH] RISC-V: Adjust tt-ascalon-d8 branch cost

2025-09-08 Thread Jeff Law
On 9/7/25 3:19 PM, Anton Blanchard wrote: If-conversion isn't being applied to this nbench code: #include #define INTERNAL_FPF_PRECISION 4 typedef uint16_t u16; void ShiftMantLeft1(u16 *carry, u16 *mantissa) { int i; int new_carry; u16 accum;

Re: [PATCH 3/3] libstdc++: Trap on std::shared_ptr reference count overflow [PR71945]

2025-09-08 Thread Tomasz Kaminski
On Mon, Sep 8, 2025 at 2:45 PM Jonathan Wakely wrote: > This adds checks when incrementing the shared count and weak count and > will trap if they would be > be incremented past its maximum. The maximum value is the value at which > incrementing it produces an invalid use_count(). So that is eith

[PATCH] pr107421.f90: Pass -fPIE for non-x86 targets

2025-09-08 Thread H.J. Lu
-mno-direct-extern-access is used to disable direct access to external symbol in executable for x86. Add -fPIE to disable direct access to external symbol for other targets. PR fortran/107421 PR testsuite/121848 * gfortran.dg/gomp/pr107421.f90: Pass -fPIE for non-x86 targe

Re: [PATCH 1/2 v2] c++: Implement P1494 and P3641 Partial program correctness [PR119060].

2025-09-08 Thread Michael Matz
Hello, On Mon, 8 Sep 2025, Ville Voutilainen wrote: > But I can (more slowly) dig up what the other developer tried to use for > the prints. It isn't printf, printf doesn't trigger the problem because > optimizers know what printf is. The print function was some > android-specific logging func

Re: [PATCH 1/2 v2] c++: Implement P1494 and P3641 Partial program correctness [PR119060].

2025-09-08 Thread Jakub Jelinek
On Mon, Sep 08, 2025 at 03:05:58PM +0200, Richard Biener wrote: > is reduced to __builtin_abort () (for C++). That's because it's > __builtin_unreachable () at the end. I am not aware of any > other "UB" than missed return that we turn into unreachable(), > even > > unsigned int foo (unsigned in

Re: [PATCH 3/3] libstdc++: Trap on std::shared_ptr reference count overflow [PR71945]

2025-09-08 Thread Jonathan Wakely
Oops, this was supposed to say [PATCH v2 3/3] in the subject line. On Mon, 8 Sept 2025 at 13:44, Jonathan Wakely wrote: > > This adds checks when incrementing the shared count and weak count and > will trap if they would be > be incremented past its maximum. The maximum value is the value at whic

[PATCH] libstdc++: Document C++20 atomic_ref implementation-defined behavior.

2025-09-08 Thread Tomasz Kamiński
Also introduce Implementation Specific Behavior section for C++20. libstdc++-v3/ChangeLog: * doc/html/index.html: Regenerated. * doc/html/manual/index.html: Regenerated. * doc/html/manual/intro.html: Regenerated. * doc/html/manual/status.html: Regenatered.

Re: [PATCH 1/2 v2] c++: Implement P1494 and P3641 Partial program correctness [PR119060].

2025-09-08 Thread Jakub Jelinek
On Mon, Sep 08, 2025 at 01:22:17PM +0100, Iain Sandoe wrote: > For the testcase attached to the patch. > > Do we consider that the addition to x is considered observable? I don't think so, it isn't any kind of barrier for moving statements around in either direction. I think a non-const/pure call

Re: [PATCH 1/2 v2] c++: Implement P1494 and P3641 Partial program correctness [PR119060].

2025-09-08 Thread Ville Voutilainen
On Mon, 8 Sept 2025 at 14:46, Richard Biener wrote: > > It's not just to cater to FUD. I have seen Clang remove a complete CFG > > edge that lead to a non-return from > > a non-void function. If observable_checkpoint works correctly, the > > debug prints my junior colleague added trying > > to see

[PATCH v2 2/3] libstdc++: Allow std::shared_ptr reference counts to be negative [PR71945]

2025-09-08 Thread Jonathan Wakely
This change doubles the effective range of the std::shared_ptr and std::weak_ptr reference counts for most 64-bit targets. The counter type, _Atomic_word, is usually a signed 32-bit int (except on Solaris v9 where it is a signed 64-bit long). The return type of std::shared_ptr::use_count() is long

[PATCH 3/3] libstdc++: Trap on std::shared_ptr reference count overflow [PR71945]

2025-09-08 Thread Jonathan Wakely
This adds checks when incrementing the shared count and weak count and will trap if they would be be incremented past its maximum. The maximum value is the value at which incrementing it produces an invalid use_count(). So that is either the maximum positive value of _Atomic_word, or for targets wh

[PATCH] tree-optimization/121830 - SLP cycle detection confused by nested cycle

2025-09-08 Thread Richard Biener
The SLP reduc-index computation is confused by having an outer reduction inner loop nested cycle fed by another non-reduction nested cycle. Instead of undoing the unfortunate mixing of outer reduction inner cycles with general nested cycles the following instead distinguishes them by not setting ST

Re: [PATCH v10 11/13] c: Add target_version attribute support.

2025-09-08 Thread Alfie Richards
The 09/02/2025 20:46, Joseph Myers wrote: > On Thu, 28 Aug 2025, alfie.richa...@arm.com wrote: > > > @@ -3373,6 +3406,56 @@ pushdecl (tree x) > > TREE_TYPE (b_use->decl) = b_use->u.type; > > } > > } > > + > > + /* Check if x is part of a FMV set with b_use. */ > > +

Re: [PATCH 1/2 v2] c++: Implement P1494 and P3641 Partial program correctness [PR119060].

2025-09-08 Thread Iain Sandoe
> On 8 Sep 2025, at 12:46, Richard Biener wrote: > > On Mon, Sep 8, 2025 at 1:04 PM Ville Voutilainen > wrote: >> >> On Mon, 8 Sept 2025 at 13:54, Richard Biener >> wrote: >>> That said, I see no point in std::observable_checkpoint to be represented >>> in the IL at all if all it is is to

[PATCH v2 0/2] RISC-V: Allow profiles input in '--with-arch' option.

2025-09-08 Thread Jiawei
This patch allows profiles input in '--with-arch'. With this change, profile names such as `rva20*` `rva22*`, `rvb23*` can be passed directly to `--with-arch` without triggering configure errors. This makes it easier to configure and build a toolchain targeting RISC-V profiles, since the input

Re: [PATCH 1/2 v2] c++: Implement P1494 and P3641 Partial program correctness [PR119060].

2025-09-08 Thread Richard Biener
On Mon, Sep 8, 2025 at 1:04 PM Ville Voutilainen wrote: > > On Mon, 8 Sept 2025 at 13:54, Richard Biener > wrote: > > That said, I see no point in std::observable_checkpoint to be represented > > in the IL at all if all it is is to cater to FUD around what compilers might > > think is a correct

[PATCH v2 1/2] RISC-V: Configure Profiles definitions in the definition file.

2025-09-08 Thread Jiawei
Moving RISC-V Profiles definations into 'riscv-profiles.def'. Add comments for 'riscv_profiles'. gcc/ChangeLog: * common/config/riscv/riscv-common.cc (struct riscv_profiles): Add comments. (RISCV_PROFILE): Removed. * config/riscv/riscv-profiles.def: New file. --- gcc/co

[PATCH] tree-optimization/121829 - bogus CFG with asm goto

2025-09-08 Thread Richard Biener
When the vectorizer removes a forwarder created earlier by split_edge it uses redirect_edge_pred for convenience and efficiency. That breaks down when the edge split is originating from an asm goto as that is a jump that needs adjustments from redirect_edge_and_branch. The following factores a si

[PATCH v2 2/2] RISC-V: Allow profiles input in '--with-arch' option.

2025-09-08 Thread Jiawei
Allows profiles input in '--with-arch'. Check profiles with 'riscv-profiles.def'. gcc/ChangeLog: * config.gcc: Accept RISC-V profiles in `--with-arch`. * config/riscv/arch-canonicalize: Add profile detection and skip canonicalization for profiles. --- gcc/config.gcc

[PATCH v4] c++: Fix mangling of _Float16 template args [PR121801]

2025-09-08 Thread Matthias Kretz
* renamed the test to abi/pr121801.C * changed the comment to include std::bfloat16_t and another space. - 8< --- Signed-off-by: Matthias Kretz gcc/testsuite/ChangeLog: * g++.dg/abi/pr121801.C: New test. gcc/cp/ChangeLog: * mangle.cc (write_real_c

Re: [PATCH] docs: Add documentation for TARGET_HAS_FMV_TARGET_ATTRIBUTE macro

2025-09-08 Thread Richard Biener
On Mon, Sep 8, 2025 at 11:41 AM wrote: > > From: Alfie Richards > > Hi all, > > I sent this previously after Richard S noted that this hook was lacking > comments but it seemingly got lost in the period where I broke my send-mail > config. > > This describes the hook as it will be after my FMV pa

Re: [PATCH v3] c++: Fix mangling of _Float16 template args [PR121801]

2025-09-08 Thread Jakub Jelinek
On Mon, Sep 08, 2025 at 12:23:49PM +0200, Matthias Kretz wrote: > + if (words == 0) > +{ > + /* _Float16 is the only supported type smaller than 32 bits. */ This comment is incorrect, although the assert is right. Both _Float16 and decltype (0.0bf16) (aka std::bfloat16_t) are supported t

  1   2   >