Re: [RFC PATCH 2/7] mangle: Introduce C typeinfo mangling API

2025-08-21 Thread Andrew Pinski
On Thu, Aug 21, 2025 at 9:16 AM Kees Cook wrote: > > On Thu, Aug 21, 2025 at 12:59:06AM -0700, Andrew Pinski wrote: > > On Thu, Aug 21, 2025 at 12:41 AM Kees Cook wrote: > > > > > To support the KCFI type-id which needs to convert unique function > > > prototypes into unique 32-bit values, add a

Re: [RFC PATCH 2/7] mangle: Introduce C typeinfo mangling API

2025-08-21 Thread Kees Cook
On Thu, Aug 21, 2025 at 12:59:06AM -0700, Andrew Pinski wrote: > On Thu, Aug 21, 2025 at 12:41 AM Kees Cook wrote: > > > To support the KCFI type-id which needs to convert unique function > > prototypes into unique 32-bit values, add a subset of the Itanium C++ > > mangling ABI for C typeinfo of

Re: [PATCH 2/2]AArch64: extend cost model to cost outer loop vect where the inner loop is invariant [PR121290]

2025-08-21 Thread Richard Sandiford
Tamar Christina writes: > Consider the example: > > void > f (int *restrict x, int *restrict y, int *restrict z, int n) > { > for (int i = 0; i < 4; ++i) > { > int res = 0; > for (int j = 0; j < 100; ++j) > res += y[j] * z[i]; > x[i] = res; > } > } > > we curren

[PATCH v2] match.pd: Fold pattern of round semantics.

2025-08-21 Thread Zhou Zhao
This patch is a respond of the patch posted at https://gcc.gnu.org/pipermail/gcc-patches/2025-January/673051.html as some suggestion by Richard Biener, I have adopted these suggestions and regenerated the patch. In the 538.imagick_r benchmark of Spec2017, I find these pattern from MagickRound func

RE: [PATCH 1/5]middle-end: Add scaffolding to support narrowing IFNs

2025-08-21 Thread Richard Biener
On Thu, 21 Aug 2025, Tamar Christina wrote: > > -Original Message- > > From: Richard Biener > > Sent: Thursday, August 21, 2025 11:51 AM > > To: Tamar Christina > > Cc: gcc-patches@gcc.gnu.org; rdsandif...@googlemail.com; nd > > Subject: RE: [PATCH 1/5]middle-end: Add scaffolding to sup

[PATCH 1/2]rs6000: Disable vector constant splitters on POWER9/10 [PR118480]

2025-08-21 Thread jeevitha
Hi All, The following patch has been bootstrapped and regtested on powerpc64le-linux. Disable easy_vector_constant_msb and easy_vector_constant_add_self splitters on POWER10. On POWER9, bypass these splitters when xxspltib can directly generate 8-bit signed constants, for avoiding redundant va

Re: [PR119702][PATCH] rs6000: Use vector add when left shifting by 1

2025-08-21 Thread Avinash Jayakar
On Thu, 2025-08-14 at 11:27 +0530, Avinash Jayakar wrote: > PR119702 Ping 1. Request review of this patch. Thanks and regards, Avinash

Re: [PATCH] RISC-V: testsuite: Fix DejaGnu support for riscv_zvfh

2025-08-21 Thread Robin Dapp
OK. -- Regards Robin

RE: [PATCH 1/5]middle-end: Add scaffolding to support narrowing IFNs

2025-08-21 Thread Richard Biener
On Wed, 20 Aug 2025, Tamar Christina wrote: > > -Original Message- > > From: Richard Biener > > Sent: Wednesday, August 20, 2025 1:48 PM > > To: Tamar Christina > > Cc: gcc-patches@gcc.gnu.org; rdsandif...@googlemail.com; nd > > Subject: Re: [PATCH 1/5]middle-end: Add scaffolding to sup

RE: [PATCH 2/5]middle-end: Add detection for add halfing and narrowing instruction

2025-08-21 Thread Richard Biener
On Wed, 20 Aug 2025, Tamar Christina wrote: > > -Original Message- > > From: Richard Biener > > Sent: Wednesday, August 20, 2025 1:48 PM > > To: Tamar Christina > > Cc: gcc-patches@gcc.gnu.org; nd ; rguent...@suse.de > > Subject: Re: [PATCH 2/5]middle-end: Add detection for add halfing a

RE: [PATCH 1/5]middle-end: Add scaffolding to support narrowing IFNs

2025-08-21 Thread Tamar Christina
> -Original Message- > From: Richard Biener > Sent: Thursday, August 21, 2025 1:17 PM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; rdsandif...@googlemail.com; nd > Subject: RE: [PATCH 1/5]middle-end: Add scaffolding to support narrowing IFNs > > On Thu, 21 Aug 2025, Tamar Christ

Re: [PATCH] Mark , constexpr

2025-08-21 Thread Jonathan Wakely
On Thu, 21 Aug 2025 at 12:46, Tomasz Kaminski wrote: > > > > On Mon, Aug 11, 2025 at 3:22 PM Thor Preimesberger > wrote: >> >> libstdc++: Mark , constexpr. >> >> This patch makes partial progress towards P3372 by marking >> std::{deque, priority_queue, queue} and relevant internal helpers to be

Re: [PATCH] match.pd: Fold (C << x) == x -> 0

2025-08-21 Thread Richard Biener
On Thu, 21 Aug 2025, dhr...@nvidia.com wrote: > From: Dhruv Chawla > > Bootstrapped and regtested on aarch64-linux-gnu. > > Signed-off-by: Dhruv Chawla > > gcc/ChangeLog: > > * match.pd: New pattern. > > gcc/testsuite/ChangeLog: > > * gcc.dg/match-constant-shift-1.c: New test.

Re: [RFC PATCH 3/7] kcfi: Add core Kernel Control Flow Integrity infrastructure

2025-08-21 Thread Richard Biener
On Thu, 21 Aug 2025, Peter Zijlstra wrote: > On Thu, Aug 21, 2025 at 01:16:56AM -0700, Andrew Pinski wrote: > > > > +/* Compute KCFI type ID for a function declaration or function type > > > (internal) */ > > > +static uint32_t > > > +compute_kcfi_type_id (tree fntype_or_fndecl) > > > +{ > > > +

[PATCH] match.pd: Fold (C << x) == x -> 0

2025-08-21 Thread dhruvc
From: Dhruv Chawla Bootstrapped and regtested on aarch64-linux-gnu. Signed-off-by: Dhruv Chawla gcc/ChangeLog: * match.pd: New pattern. gcc/testsuite/ChangeLog: * gcc.dg/match-constant-shift-1.c: New test. * gcc.dg/match-constant-shift-1.c: Likewise. --- gcc/match.p

[PATCH] tree-optimization/111494 - reduction vectorization with signed UB

2025-08-21 Thread Richard Biener
The following makes sure to pun arithmetic that's used in vectorized reduction to unsigned when overflow invokes undefined behavior. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. I will rely on this with improving SLP reduction chain handling for signed integer chains where reassoc

RE: [PATCH 2/5]middle-end: Add detection for add halfing and narrowing instruction

2025-08-21 Thread Tamar Christina
> -Original Message- > From: Richard Biener > Sent: Thursday, August 21, 2025 11:55 AM > To: Tamar Christina > Cc: Richard Biener ; gcc-patches@gcc.gnu.org; nd > > Subject: RE: [PATCH 2/5]middle-end: Add detection for add halfing and > narrowing > instruction > > On Wed, 20 Aug 2025, T

RE: [PATCH 2/5]middle-end: Add detection for add halfing and narrowing instruction

2025-08-21 Thread Richard Biener
On Thu, 21 Aug 2025, Tamar Christina wrote: > > -Original Message- > > From: Richard Biener > > Sent: Thursday, August 21, 2025 11:55 AM > > To: Tamar Christina > > Cc: Richard Biener ; gcc-patches@gcc.gnu.org; nd > > > > Subject: RE: [PATCH 2/5]middle-end: Add detection for add halfing

RE: [PATCH 1/5]middle-end: Add scaffolding to support narrowing IFNs

2025-08-21 Thread Tamar Christina
> -Original Message- > From: Richard Biener > Sent: Thursday, August 21, 2025 11:51 AM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; rdsandif...@googlemail.com; nd > Subject: RE: [PATCH 1/5]middle-end: Add scaffolding to support narrowing IFNs > > On Wed, 20 Aug 2025, Tamar Chris

Re: [PATCH] MAINTAINERS: Update my email address and stand down as AArch64 maintainer

2025-08-21 Thread Ramana Radhakrishnan
On Thu, Aug 21, 2025 at 3:18 PM Richard Earnshaw (lists) wrote: > > On 21/08/2025 07:54, Richard Sandiford wrote: > > Today is my last working day at Arm, so this patch switches my > > MAINTAINERS entries to my personal email address. (It turns out > > that I never updated some of the later entri

Re: [PATCH] MAINTAINERS: Update my email address and stand down as AArch64 maintainer

2025-08-21 Thread Jeff Law
On 8/21/25 3:47 AM, Richard Earnshaw (lists) wrote: On 21/08/2025 07:54, Richard Sandiford wrote: Today is my last working day at Arm, so this patch switches my MAINTAINERS entries to my personal email address. (It turns out that I never updated some of the later entries...oops) In order to

RE: [PATCH v2 1/2] Match: Add form 3 for unsigned SAT_MUL

2025-08-21 Thread Li, Pan2
Thanks Richard, will commit the series if no comments for the second test only patch in next 24 hours. Pan -Original Message- From: Richard Biener Sent: Tuesday, August 19, 2025 2:56 PM To: Li, Pan2 Cc: gcc-patches@gcc.gnu.org; juzhe.zh...@rivai.ai; kito.ch...@gmail.com; jeffreya...@

Re: [PATCH] RISC-V: Expand const_vector with 2 elts per pattern.

2025-08-21 Thread Robin Dapp
This is the one git was complaining about on your end? b4 gets it for me via b4 shazam https://inbox.sourceware.org/gcc-patches/dbtiy6uch8xb.3522x0caqi...@gmail.com/ it's a little mangled: the "Hi," is in there, and there's two different line-breaking lengths. So maybe something's odd wi

Re: [RFC PATCH 3/7] kcfi: Add core Kernel Control Flow Integrity infrastructure

2025-08-21 Thread Peter Zijlstra
On Thu, Aug 21, 2025 at 01:01:37PM +0200, Richard Biener wrote: > On Thu, 21 Aug 2025, Peter Zijlstra wrote: > > > On Thu, Aug 21, 2025 at 01:16:56AM -0700, Andrew Pinski wrote: > > > > > > +/* Compute KCFI type ID for a function declaration or function type > > > > (internal) */ > > > > +static

[PATCH] rtl-ssa: Add missing live-out uses [PR121619]

2025-08-21 Thread Richard Sandiford
This PR is another bug in the rtl-ssa code to manage live-out uses. It seems that this didn't get much coverage until recently. In the testcase, late-combine first removed a register-to-register move by substituting into all uses, some of which were in other EBBs. This was done after checking make

Re: [PATCH] rtl-ssa: Add missing live-out uses [PR121619]

2025-08-21 Thread Richard Biener
> Am 21.08.2025 um 16:56 schrieb Richard Sandiford : > > This PR is another bug in the rtl-ssa code to manage live-out uses. > It seems that this didn't get much coverage until recently. > > In the testcase, late-combine first removed a register-to-register > move by substituting into all use

Re: [PATCH] rtl-ssa: Add missing live-out uses [PR121619]

2025-08-21 Thread Richard Sandiford
Richard Biener writes: >> Am 21.08.2025 um 16:56 schrieb Richard Sandiford : >> >> This PR is another bug in the rtl-ssa code to manage live-out uses. >> It seems that this didn't get much coverage until recently. >> >> In the testcase, late-combine first removed a register-to-register >> move

Re: [Fortran/121627]: Fix NULL pointer issue

2025-08-21 Thread Jerry D
On 8/21/25 12:32 PM, Steve Kargl wrote: fortran/121627 found an issue with a NULL pointer dereference when the name of the main program conflicts with a symbol in iso_fortran_env. The following patch fixes the issue. While here I've expanded the error message to hopefully explain the issue. 2

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

2025-08-21 Thread Jeff Law
On 8/21/25 11:42 AM, Robin Dapp wrote: This patch would like to introduce the combine of vec_dup + vmacc.vv into vmacc.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, 2, 15 in test. LGTM, thanks. I was j

Re: [PATCH v9 06/13] c/c++: Add target_[version/clones] to decl diagnostics formatting.

2025-08-21 Thread Alfie Richards
On 19/08/2025 19:06, Jason Merrill wrote: On 8/19/25 4:49 AM, Alfie Richards wrote: Adds the target_version and target_clones attributes to diagnostic messages for target_version semantics. This is because the target_version/target_clones attributes affect the identity of the decls, so need

Re: [PATCH v8 1/6] c-family: add btf_type_tag and btf_decl_tag attributes

2025-08-21 Thread Joseph Myers
On Thu, 21 Aug 2025, David Faust wrote: > Hi Joseph, > > On 8/20/25 15:49, Joseph Myers wrote: > > On Tue, 12 Aug 2025, David Faust wrote: > > > >> + if (TREE_CODE (*node) == FUNCTION_TYPE || TREE_CODE (*node) == > >> METHOD_TYPE) > >> +{ > >> + /* Treat btf_type_tag applied to a func

Re: [Fortran/121627]: Fix NULL pointer issue

2025-08-21 Thread Steve Kargl
On Thu, Aug 21, 2025 at 01:42:47PM -0700, Jerry D wrote: > On 8/21/25 12:32 PM, Steve Kargl wrote: > > fortran/121627 found an issue with a NULL pointer dereference > > when the name of the main program conflicts with a symbol in > > iso_fortran_env. The following patch fixes the issue. While > >

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

2025-08-21 Thread Robin Dapp
This patch would like to introduce the combine of vec_dup + vmacc.vv into vmacc.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, 2, 15 in test. LGTM, thanks. -- Regards Robin

Re: [PATCH] RISC-V: testsuite: Fix DejaGnu support for riscv_zvfh

2025-08-21 Thread Jeff Law
On 8/20/25 7:36 AM, Paul-Antoine Arras wrote: Call check_effective_target_riscv_zvfh_ok rather than check_effective_target_riscv_zvfh in vx_vf_*run-1-f16.c run tests and ensure that they are actually run. Also fix remove_options_for_riscv_zvfh. gcc/testsuite/ChangeLog: * gcc.target/r

[pushed] c++: constexpr clobber of const [PR121068]

2025-08-21 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- Since r16-3022, 20_util/variant/102912.cc was failing in C++20 and above due to wrong errors about destruction modifying a const object; destruction is OK. PR c++/121068 gcc/cp/ChangeLog: * constexpr.cc (cxx_eval_store_exp

Re: [RFC PATCH 3/7] kcfi: Add core Kernel Control Flow Integrity infrastructure

2025-08-21 Thread Qing Zhao
> On Aug 21, 2025, at 10:25, Peter Zijlstra wrote: > > On Thu, Aug 21, 2025 at 01:01:37PM +0200, Richard Biener wrote: >> On Thu, 21 Aug 2025, Peter Zijlstra wrote: >> >>> On Thu, Aug 21, 2025 at 01:16:56AM -0700, Andrew Pinski wrote: >>> > +/* Compute KCFI type ID for a function declarat

Re: [PATCH] c: Add folding of nullptr_t in some cases [PR121478]

2025-08-21 Thread Joseph Myers
On Thu, 21 Aug 2025, Andrew Pinski wrote: > The middle-end does not fully understand NULLPTR_TYPE. So it > gets confused a lot of the time when dealing with it. > This adds the folding that is similarly done in the C++ front-end already. > In some cases it should produce slightly better code as th

Re: [PATCH] strlen: Don't do the malloc+memset->calloc optimization in some cases [PR83022]

2025-08-21 Thread Andrew Pinski
On Tue, Jul 22, 2025 at 7:16 PM Andrew Pinski wrote: > > On Fri, Apr 18, 2025 at 5:08 PM Andrew Pinski > wrote: > > > > This fixes a long standing (since GCC 5) issue where the > > malloc+memset->calloc > > optimization would happen even if the memset was not always executed. > > This is a vari

[committed 3/3] pru: libgcc: Add software implementation for multiplication

2025-08-21 Thread Dimitar Dimitrov
For cores without a hardware multiplier, set respective optabs with library functions which use software implementation of multiplication. The implementation was copied from the RL78 backend. gcc/ChangeLog: * config/pru/pru.cc (pru_init_libfuncs): Set softmpy libgcc functions for

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

2025-08-21 Thread Kees Cook
On Thu, Aug 21, 2025 at 11:29:35AM +0200, Peter Zijlstra wrote: > On Thu, Aug 21, 2025 at 12:26:37AM -0700, Kees Cook wrote: > > Implement x86_64-specific KCFI backend: > > > > - Function preamble generation with type IDs positioned at -(4+prefix_nops) > > offset from function entry point. > >

[committed 2/3] pru: Define multilib for different core variants

2025-08-21 Thread Dimitar Dimitrov
Enable multilib builds for contemporary PRU core versions (AM335x and later), and older versions present in AM18xx. gcc/ChangeLog: * config.gcc: Include pru/t-multilib. * config/pru/pru.h (MULTILIB_DEFAULTS): Define. * config/pru/t-multilib: New file. Signed-off-by: Dimit

[committed 1/3] pru: Add options to disable MUL/FILL/ZERO instructions

2025-08-21 Thread Dimitar Dimitrov
Older PRU core versions (e.g. in AM1808 SoC) do not support XIN, XOUT, FILL, ZERO instructions. Add GCC command line options to optionally disable generation of those instructions, so that code can be executed on such older PRU cores. gcc/ChangeLog: * common/config/pru/pru-common.cc (TAR

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

2025-08-21 Thread Kees Cook
On Thu, Aug 21, 2025 at 11:46:17AM -0700, Kees Cook wrote: > On Thu, Aug 21, 2025 at 11:29:35AM +0200, Peter Zijlstra wrote: > > On Thu, Aug 21, 2025 at 12:26:37AM -0700, Kees Cook wrote: > > > Build and run tested on x86_64 Linux kernel with various CPU errata > > > handling alternatives and FineI

Re: [PATCH v4] Factor out thread model detection with new `GCC_AC_THREAD_MODEL` macro

2025-08-21 Thread John Ericson
On Thu, Jul 31, 2025, at 6:08 PM, Joseph Myers wrote: > OK in the absence of build machinery maintainer objections within the next > week. Checking in on a few of these (this will be one of a few emails). I believe it is has been a few weeks of no objections now? John

[committed 0/3] pru: Add support for cores present in AM1808 SoC

2025-08-21 Thread Dimitar Dimitrov
The AM1808 SoC from Texas Instruments contains an older version of the PRU core, which is missing the XIN, XOUT and LOOP instructions. Thus it does not support the pseudo-instructions FILL and ZERO, and also hardware multiplication. This patch series adds flags to optionally disable those missing

Re: [PATCH v4] Move NO_PIE_CFLAGS logic from gcc to libgcc

2025-08-21 Thread John Ericson
On Thu, Jul 31, 2025, at 6:03 PM, Joseph Myers wrote: > OK in the absence of libgcc or build machinery maintainer objections > within the next week. Checking in on a few of these (this will be one of a few emails). I believe it is has been a few weeks of no objections now? John

Re: [PATCH v3 2/2] libgcc: Dont use TARGET_SYSTEM_ROOT from gcc

2025-08-21 Thread John Ericson
On Wed, Jul 30, 2025, at 5:52 PM, Joseph Myers wrote: > OK in the absence of AIX maintainer objections within the next week. Checking in on a few of these (this will be one of a few emails). I believe it is has been a few weeks of no objections now? John

Re: [RFC PATCH 2/7] mangle: Introduce C typeinfo mangling API

2025-08-21 Thread Qing Zhao
> On Aug 21, 2025, at 12:16, Kees Cook wrote: > > >>> + else if (TREE_CODE (fntype_or_fndecl) == FUNCTION_DECL) >>> +{ >>> + tree fndecl = fntype_or_fndecl; >>> + tree base_fntype = TREE_TYPE (fndecl); >>> + >>> + /* For FUNCTION_DECL, build a synthetic function type using

Re: [RFC PATCH 3/7] kcfi: Add core Kernel Control Flow Integrity infrastructure

2025-08-21 Thread Kees Cook
On Thu, Aug 21, 2025 at 01:01:37PM +0200, Richard Biener wrote: > On Thu, 21 Aug 2025, Peter Zijlstra wrote: > > > On Thu, Aug 21, 2025 at 01:16:56AM -0700, Andrew Pinski wrote: > > > > > > +/* Compute KCFI type ID for a function declaration or function type > > > > (internal) */ > > > > +static

Re: [PATCH v8 1/6] c-family: add btf_type_tag and btf_decl_tag attributes

2025-08-21 Thread David Faust
Hi Joseph, On 8/20/25 15:49, Joseph Myers wrote: > On Tue, 12 Aug 2025, David Faust wrote: > >> + if (TREE_CODE (*node) == FUNCTION_TYPE || TREE_CODE (*node) == >> METHOD_TYPE) >> +{ >> + /* Treat btf_type_tag applied to a function type as applying to the >> + return type instead.

Re: [PATCH] MAINTAINERS: Update my email address and stand down as AArch64 maintainer

2025-08-21 Thread Claudiu Zissulescu Ianculescu
Hi Richard, On Thu, Aug 21, 2025 at 9:55 AM Richard Sandiford wrote: > > Today is my last working day at Arm, so this patch switches my > MAINTAINERS entries to my personal email address. (It turns out > that I never updated some of the later entries...oops) I am sorry to hear that ... > > In

Re: [PATCH] RISC-V: Replace deprecated FUNCTION_VALUE/LIBCALL_VALUE macros with target hooks

2025-08-21 Thread Jeff Law
On 8/18/25 7:42 AM, Kito Cheng wrote: The FUNCTION_VALUE and LIBCALL_VALUE macros are deprecated in favor of the TARGET_FUNCTION_VALUE and TARGET_LIBCALL_VALUE target hooks. This patch replaces the macro definitions with proper target hook implementations. This change is also a preparatory s

Re: [PATCH v9 00/13] C/C++: FMV refactor, C FMV support and ACLE compliance

2025-08-21 Thread Jeff Law
On 8/19/25 2:43 AM, Alfie Richards wrote: Hi All, Resending due to some email issues resulting in undelivered email. Thank you so much for the reviews. This revision is mostly addressing feedback from Richard S. Changes since V8: - Several stylistic changes/code clarity. - Change check_targ

Re: [PATCH] MAINTAINERS: Update my email address and stand down as AArch64 maintainer

2025-08-21 Thread Andrew Pinski
On Wed, Aug 20, 2025 at 11:55 PM Richard Sandiford wrote: > > Today is my last working day at Arm, so this patch switches my > MAINTAINERS entries to my personal email address. (It turns out > that I never updated some of the later entries...oops) > > In order to avoid setting false expectations,

Re: [PATCH] MAINTAINERS: Update my email address and stand down as AArch64 maintainer

2025-08-21 Thread Qing Zhao
Richard, I always remember your help on my first GCC securty feature. At that time, I was just a new comer to the GCC community. Without your patience and time, I cannot finish that first project. Hope everything is smooth in your new life journey. Qing > On Aug 21, 2025, at 13:52, Andrew P

[PATCH v2] preprocessor: More escapes for Makefile rules (-M option) [PR41329, PR121450]

2025-08-21 Thread Joerg Boehmer
This patch adds support for more characters that are special to GNU make in file-names. Especially GNU make expects in rules that #, %, :, *, ? and [ characters are preceded by a backslash to remove their special meaning. PR preprocessor/41329 PR preprocessor/121450 libcpp/Change

[Fortran/121627]: Fix NULL pointer issue

2025-08-21 Thread Steve Kargl
fortran/121627 found an issue with a NULL pointer dereference when the name of the main program conflicts with a symbol in iso_fortran_env. The following patch fixes the issue. While here I've expanded the error message to hopefully explain the issue. 2025-08-21 Steven G. Kargl PR fo

[PATCH] libstdc++: Specialize _Never_valueless_alt for jthread, stop_token and stop_source

2025-08-21 Thread Tomasz Kamiński
The move constructors for stop_source and stop_token are equivalent to copying and clearing the raw pointer, as they are wrappers for a counted-shared state. For jthread, the move constructor performs a member-wise move of stop_source and thread. While std::thread could also have a _Never_valueles

[PATCH] config: Remove unused autoconf files

2025-08-21 Thread Pietro Monteiro
Both GCC and binutils/gdb trees do not use any of the macros defined in these files. Removing them from both trees and regenerating the build scripts results in no diff. The files ax_lib_socket_nsl.m4 and uintmax_t.m4 aren't in the binutils/gdb tree. I did some digging with git and it seems ax_l

RE: [PATCH v1 4/4] RISC-V: Adjust the asm check after enable vmacc.vx combine

2025-08-21 Thread Li, Pan2
Emm, seems this adjustment is not that correct, let me revisit and send v2 if possible. Pan -Original Message- From: Li, Pan2 Sent: Tuesday, August 19, 2025 11:10 AM To: gcc-patches@gcc.gnu.org Cc: juzhe.zh...@rivai.ai; kito.ch...@gmail.com; jeffreya...@gmail.com; rdapp@gmail.com;

Re: [PATCH v9 00/13] C/C++: FMV refactor, C FMV support and ACLE compliance

2025-08-21 Thread Alfie Richards
On 21/08/2025 18:45, Jeff Law wrote: On 8/19/25 2:43 AM, Alfie Richards wrote: Hi All, Resending due to some email issues resulting in undelivered email. Thank you so much for the reviews. This revision is mostly addressing feedback from Richard S. Changes since V8: - Several stylistic chan

Re: [Fortran/121627]: Fix NULL pointer issue

2025-08-21 Thread Jerry D
Done. commit 2c1fd2fdb3029fdd3ea3f88fe635f37b3a5fae36 (HEAD -> master, origin/master, origin/HEAD) Author: Steven G. Kargl Date: Thu Aug 21 14:31:16 2025 -0700 Fortran: Fix NULL pointer issue. PR fortran/121627 gcc/fortran/ChangeLog: * module.cc (create_in

Re: [RFC PATCH 2/7] mangle: Introduce C typeinfo mangling API

2025-08-21 Thread Kees Cook
On Thu, Aug 21, 2025 at 07:14:31PM +, Qing Zhao wrote: > > > > On Aug 21, 2025, at 12:16, Kees Cook wrote: > > > > > >>> + else if (TREE_CODE (fntype_or_fndecl) == FUNCTION_DECL) > >>> +{ > >>> + tree fndecl = fntype_or_fndecl; > >>> + tree base_fntype = TREE_TYPE (fndecl);

[PATCH] [arm] require armv7 support for [PR120424]

2025-08-21 Thread Alexandre Oliva
On Aug 20, 2025, "Richard Earnshaw (lists)" wrote: > On 19/06/2025 14:25, Alexandre Oliva wrote: >> On Jun 19, 2025, Alexandre Oliva wrote: >> +v7 "-march=armv7" __ARM_ARCH_7__ > Similarly to the line directly below, this needs to be 'armv7+fp', > otherwise this won't work on targets that

RE: [PATCH] MAINTAINERS: Update my email address and stand down as AArch64 maintainer

2025-08-21 Thread Li, Pan2
Hi Richard S, It is difficult to say more, thank you for the help in passed years. Best wishes and break a leg! Pan -Original Message- From: Qing Zhao Sent: Friday, August 22, 2025 2:38 AM To: rdsandif...@googlemail.com Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] MAINTAINERS: Upda

Re: [PATCH v2 0/8] libstdc++: Sequence of improvements to .

2025-08-21 Thread Tomasz Kaminski
The patch series is now on trunk, and will continue with the next series soon. Thank you for the contributions, and I am looking forward to the next patches for review. On Wed, Aug 20, 2025 at 6:54 PM Jonathan Wakely wrote: > On 03/08/25 22:57 +0200, Luc Grosheintz wrote: > >The combined effect

Re: [PATCH v2 0/2] Two cleanup patches for .

2025-08-21 Thread Tomasz Kaminski
The patch series is now on trunk, and will continue with the next series soon. Again. thank you for the contributions! On Wed, Aug 20, 2025 at 6:54 PM Jonathan Wakely wrote: > On Mon, 11 Aug 2025 at 21:19, Luc Grosheintz > wrote: > > > > This second iteration: > > > > - fixes the commit messa

Re: [RFC PATCH 2/7] mangle: Introduce C typeinfo mangling API

2025-08-21 Thread Andrew Pinski
On Thu, Aug 21, 2025 at 12:59 AM Andrew Pinski wrote: > > On Thu, Aug 21, 2025 at 12:41 AM Kees Cook wrote: >> >> To support the KCFI type-id which needs to convert unique function >> prototypes into unique 32-bit values, add a subset of the Itanium C++ >> mangling ABI for C typeinfo of function

Re: [PATCH v3] libstdc++: Implement std::dims from .

2025-08-21 Thread Tomasz Kaminski
Patches pushed. On Wed, Aug 20, 2025 at 7:17 PM Jonathan Wakely wrote: > On 21/07/25 17:50 +0200, Luc Grosheintz wrote: > >This commit implements the C++26 feature std::dims described in P2389R2. > >It sets the feature testing macro to 202406 and adds tests. > > > >Also fixes the test mdspan/ver

Re: [PATCH] xtensa: Small improvement to "*btrue_INT_MIN"

2025-08-21 Thread Max Filippov
On Wed, Aug 20, 2025 at 4:30 AM Takayuki 'January June' Suwa wrote: > > This patch changes the implementation of the insn to test whether the > result itself is negative or not, rather than the MSB of the result of > the ABS machine instruction. This eliminates the need to consider bit- > endiann

[committed] libstdc++: Suppress some more additional diagnostics [PR117294]

2025-08-21 Thread Jonathan Wakely
libstdc++-v3/ChangeLog: PR c++/117294 * testsuite/20_util/optional/cons/value_neg.cc: Prune additional output for C++20 and later. * testsuite/20_util/scoped_allocator/69293_neg.cc: Match additional error for C++20 and later. --- Tested x86_64-linux. Pushed

Re: [RFC PATCH 3/7] kcfi: Add core Kernel Control Flow Integrity infrastructure

2025-08-21 Thread Peter Zijlstra
On Thu, Aug 21, 2025 at 01:16:56AM -0700, Andrew Pinski wrote: > > +/* Compute KCFI type ID for a function declaration or function type > > (internal) */ > > +static uint32_t > > +compute_kcfi_type_id (tree fntype_or_fndecl) > > +{ > > + if (!fntype_or_fndecl) > > +return 0; > > + > > + cons

Re: [RFC PATCH 3/7] kcfi: Add core Kernel Control Flow Integrity infrastructure

2025-08-21 Thread Andrew Pinski
On Thu, Aug 21, 2025, 2:13 AM Peter Zijlstra wrote: > On Thu, Aug 21, 2025 at 01:16:56AM -0700, Andrew Pinski wrote: > > > > +/* Compute KCFI type ID for a function declaration or function type > > > (internal) */ > > > +static uint32_t > > > +compute_kcfi_type_id (tree fntype_or_fndecl) > > > +{

[committed] libstdc++: Fix std::numeric_limits<__float128>::max_digits10 [PR121374]

2025-08-21 Thread Jonathan Wakely
When I added this explicit specialization in r14-1433-gf150a084e25eaa I used the wrong value for the number of mantissa digits (I used 112 instead of 113). Then when I refactored it in r14-1582-g6261d10521f9fd I used the value calculated from the incorrect value (35 instead of 36). libstdc++-v3/Ch

[PATCH 1/2] libstdc++: Check _GLIBCXX_USE_PTHREAD_MUTEX_CLOCKLOCK with #if [PR121496]

2025-08-21 Thread Jonathan Wakely
The change in r14-905-g3b7cb33033fbe6 to disable the use of pthread_mutex_clocklock when TSan is active assumed that the _GLIBCXX_USE_PTHREAD_MUTEX_CLOCKLOCK macro was always checked with #if rather than #ifdef, which was not true. This makes the checks use #if consistently. libstdc++-v3/ChangeLo

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

2025-08-21 Thread Peter Zijlstra
On Thu, Aug 21, 2025 at 12:26:37AM -0700, Kees Cook wrote: > Implement x86_64-specific KCFI backend: > > - Function preamble generation with type IDs positioned at -(4+prefix_nops) > offset from function entry point. > > - 16-byte alignment of KCFI preambles using calculated prefix NOPs: > al

[PATCH 2/2] libstdc++: Use pthread_mutex_clocklock when TSan is active [PR121496]

2025-08-21 Thread Jonathan Wakely
This reverts r14-905-g3b7cb33033fbe6 which disabled the use of pthread_mutex_clocklock when TSan is active. That's no longer needed, because GCC has TSan interceptors for pthread_mutex_clocklock since GCC 15.1 and Clang has them since 18.1.0 (released March 2024). The interceptor was added by http

[PATCH v5 2/2] libstdc++: Implement aligned_accessor from mdspan [PR120994]

2025-08-21 Thread Tomasz Kamiński
From: Luc Grosheintz This commit completes the implementation of P2897R7 by implementing and testing the template class aligned_accessor. PR libstdc++/120994 libstdc++-v3/ChangeLog: * include/bits/version.def (aligned_accessor): Add. * include/bits/version.h: Regenerate

Re: [PATCH 1/2]AArch64: Fix costing of scalar throughput based calculation for inner loops [PR121290]

2025-08-21 Thread Richard Sandiford
Richard Biener writes: > On Wed, 20 Aug 2025, Richard Sandiford wrote: > >> Tamar Christina writes: >> > To avoid double counting scalar instructions when doing inner-loop costing >> > the >> > vectorizer uses vect_prologue as the kind instead of vect_body. >> > >> > However doing this results i

Re: [PATCH v5 1/2] libstdc++: Implement is_sufficiently_aligned [PR120994]

2025-08-21 Thread Tomasz Kaminski
On Thu, Aug 21, 2025 at 8:47 AM Tomasz Kamiński wrote: > From: Luc Grosheintz > > This commit implements and tests the function is_sufficiently_aligned > from P2897R7. > > PR libstdc++/120994 > > libstdc++-v3/ChangeLog: > > * include/bits/align.h (is_sufficiently_aligned): New fu

Re: [PATCH v5 1/2] libstdc++: Implement is_sufficiently_aligned [PR120994]

2025-08-21 Thread Jonathan Wakely
On Thu, 21 Aug 2025, 08:22 Tomasz Kaminski, wrote: > > > On Thu, Aug 21, 2025 at 8:47 AM Tomasz Kamiński > wrote: > >> From: Luc Grosheintz >> >> This commit implements and tests the function is_sufficiently_aligned >> from P2897R7. >> >> PR libstdc++/120994 >> >> libstdc++-v3/ChangeLog

[RFC PATCH 3/7] kcfi: Add core Kernel Control Flow Integrity infrastructure

2025-08-21 Thread Kees Cook
This series 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 a

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

2025-08-21 Thread Kees Cook
Implement RISC-V-specific KCFI backend. - Function preamble generation using .word directives for type ID storage at offset from function entry point (no prefix NOPs needed due to natural 4-byte instruction alignment). - Scratch register allocation using t1/t2 (x6/x7) following RISC-V proce

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

2025-08-21 Thread Kees Cook
Implement AArch64-specific KCFI backend. - Function preamble generation using .word directives for type ID storage at offset from function entry point (no prefix NOPs needed due to 4-byte instruction alignment). - Trap debugging through ESR (Exception Syndrome Register) encoding in BRK inst

[RFC PATCH 1/7] sanitizer: Expand sanitizer flag from 32-bit to 64-bit

2025-08-21 Thread Kees Cook
Extend the sanitizer flags infrastructure from unsigned int (32-bit) to unsigned long long (64-bit) to support the future addition of KCFI (Kernel Control Flow Integrity) at bit position 32, which exceeds the previous 32-bit limit. Update all sanitizer-related data structures, function signatures,

[PATCH] Merge BB and loop path in vect_analyze_stmt

2025-08-21 Thread Richard Biener
We have now common patterns for most of the vectorizable_* calls, so merge. This also avoids calling vectorizable_early_exit for BB vect and clarifies signatures of it and vectorizable_phi. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. * tree-vectorizer.h (vectorizable_phi

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

2025-08-21 Thread Kees Cook
Hi! Repeating the start of the 3rd (core kcfi) patch's commit log: This series 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

[RFC PATCH 2/7] mangle: Introduce C typeinfo mangling API

2025-08-21 Thread Kees Cook
To support the KCFI type-id which needs to convert unique function prototypes into unique 32-bit values, add a subset of the Itanium C++ mangling ABI for C typeinfo of function prototypes. This gets us to the first step: a string representation of the function prototype. Trying to extract only the

[RFC PATCH 7/7] kcfi: Add regression test suite

2025-08-21 Thread Kees Cook
Adds a test suite for KCFI (Kernel Control Flow Integrity) ABI. Core Functionality Tests: - kcfi-basics.c: Basic KCFI preamble generation, IPA analysis, and __kcfi_typeid_ symbol emission for external address-taken functions. - kcfi-type-mangling.c: Type ID hashing validation with Itanium C++ AB

[PATCH v3 2/2] Rewrite bool loads for undefined case [PR121279]

2025-08-21 Thread Andrew Pinski
Just like r16-465-gf2bb7ffe84840d8 but this time instead of a VCE there is a full on load from a boolean. This showed up when trying to remove the extra copy in the testcase from the revision mentioned above (pr120122-1.c). So when moving loads from a boolean type from being conditional to non-cond

Re: [PATCH v5 2/2] libstdc++: Implement aligned_accessor from mdspan [PR120994]

2025-08-21 Thread Jonathan Wakely
On Thu, 21 Aug 2025, 08:20 Tomasz Kamiński, wrote: > From: Luc Grosheintz > > This commit completes the implementation of P2897R7 by implementing and > testing the template class aligned_accessor. > > PR libstdc++/120994 > > libstdc++-v3/ChangeLog: > > * include/bits/version.def

[PATCH v3 1/2] LIM: Manually put uninit decl into ssa

2025-08-21 Thread Andrew Pinski
When working on PR121279, I noticed that lim would create an uninitialized decl and marking it with supression for uninitialization warning. This is fine but then into ssa would just call get_or_create_ssa_default_def on that new decl which could in theory take some extra compile time to figure tha

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

2025-08-21 Thread Kees Cook
Implement x86_64-specific KCFI backend: - Function preamble generation with type IDs positioned at -(4+prefix_nops) offset from function entry point. - 16-byte alignment of KCFI preambles using calculated prefix NOPs: aligned(prefix_nops + 5, 16) to maintain cache lines. - Type-id hash avoid

Re: [PATCH v5 1/2] libstdc++: Implement is_sufficiently_aligned [PR120994]

2025-08-21 Thread Jonathan Wakely
OK, thanks On Thu, 21 Aug 2025, 07:47 Tomasz Kamiński, wrote: > From: Luc Grosheintz > > This commit implements and tests the function is_sufficiently_aligned > from P2897R7. > > PR libstdc++/120994 > > libstdc++-v3/ChangeLog: > > * include/bits/align.h (is_sufficiently_aligned)

Re: [RFC PATCH 2/7] mangle: Introduce C typeinfo mangling API

2025-08-21 Thread Andrew Pinski
On Thu, Aug 21, 2025 at 12:41 AM Kees Cook wrote: > To support the KCFI type-id which needs to convert unique function > prototypes into unique 32-bit values, add a subset of the Itanium C++ > mangling ABI for C typeinfo of function prototypes. This gets us to the > first step: a string represent

[PATCH] c: Add folding of nullptr_t in some cases [PR121478]

2025-08-21 Thread Andrew Pinski
The middle-end does not fully understand NULLPTR_TYPE. So it gets confused a lot of the time when dealing with it. This adds the folding that is similarly done in the C++ front-end already. In some cases it should produce slightly better code as there is no reason to load from a nullptr_t variable

Re: [PATCH 1/2]AArch64: Fix costing of scalar throughput based calculation for inner loops [PR121290]

2025-08-21 Thread Richard Biener
On Wed, 20 Aug 2025, Richard Sandiford wrote: > Tamar Christina writes: > > To avoid double counting scalar instructions when doing inner-loop costing > > the > > vectorizer uses vect_prologue as the kind instead of vect_body. > > > > However doing this results in our throughput based costing to

Re: [PATCH 2/2] libstdc++: Use pthread_mutex_clocklock when TSan is active [PR121496]

2025-08-21 Thread Tomasz Kaminski
On Thu, Aug 21, 2025 at 11:34 AM Jonathan Wakely wrote: > This reverts r14-905-g3b7cb33033fbe6 which disabled the use of > pthread_mutex_clocklock when TSan is active. That's no longer needed, > because GCC has TSan interceptors for pthread_mutex_clocklock since GCC > 15.1 and Clang has them sinc

Re: [PATCH] MAINTAINERS: Update my email address and stand down as AArch64 maintainer

2025-08-21 Thread Richard Earnshaw (lists)
On 21/08/2025 07:54, Richard Sandiford wrote: > Today is my last working day at Arm, so this patch switches my > MAINTAINERS entries to my personal email address. (It turns out > that I never updated some of the later entries...oops) > > In order to avoid setting false expectations, and to try to

[commmitted v6 2/2] libstdc++: Implement aligned_accessor from mdspan [PR120994]

2025-08-21 Thread Tomasz Kamiński
From: Luc Grosheintz This commit completes the implementation of P2897R7 by implementing and testing the template class aligned_accessor. PR libstdc++/120994 libstdc++-v3/ChangeLog: * include/bits/version.def (aligned_accessor): Add. * include/bits/version.h: Regenerate

  1   2   >