[to-be-committed][RISC-V][PR target/118886] Refine when two insns are signaled as fusion candidates

2025-07-02 Thread Jeff Law
A number of folks have had their fingers in this code and it's going to take a few submissions to do everything we want to do. This patch is primarily concerned with avoiding signaling that fusion can occur in cases where it obviously should not be signaling fusion. Every DEC based fusion I'm

Re: [PATCH v2] libstdc++: construct bitset from string_view (P2697) [PR119742]

2025-07-02 Thread Jonathan Wakely
On Thu, 3 Jul 2025, 00:56 Nathan Myers, wrote: > Changes in V2: > * Generalize private member _M_check_initial_position for use with > both string and string_view arguments. > * Remove unnecessary #if guards for version and hostedness. > * Remove redundant "std::" qualifications in new code. >

Re: [PATCH] check-function-bodies: Support "^[0-9]+:"

2025-07-02 Thread H.J. Lu
On Wed, Jul 2, 2025 at 9:12 AM H.J. Lu wrote: > > While working on > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120881 > > I tried to use check-function-bodies to verify that > > 1: call mcount > > generated by "-pg" is placed at the function entry. Add "^[0-9]+:" to > check-function-bodies t

Re: [PATCH] libquadmath: add quad support for trig-pi functions

2025-07-02 Thread Steve Kargl
On Thu, Jul 03, 2025 at 12:56:24AM +0800, Yuao Ma wrote: > > This patch adds the required function for Fortran trigonometric functions to > work with glibc versions prior to 2.26. It's based on glibc source commit > 632d895f3e5d98162f77b9c3c1da4ec19968b671. > > I've built it successfully on my en

[PATCH v8 1/9] AArch64: place branch instruction rules together

2025-07-02 Thread Karl Meakin
The rules for conditional branches were spread throughout `aarch64.md`. Group them together so it is easier to understand how `cbranch4` is lowered to RTL. gcc/ChangeLog: * config/aarch64/aarch64.md (condjump): Move. (*compare_condjump): Likewise. (aarch64_cb1): Likewise.

[PATCH v8 9/9] AArch64: make rules for CBZ/TBZ higher priority

2025-07-02 Thread Karl Meakin
Move the rules for CBZ/TBZ to be above the rules for CBB/CBH/CB. We want them to have higher priority because they can express larger displacements. gcc/ChangeLog: * config/aarch64/aarch64.md (aarch64_cbz1): Move above rules for CBB/CBH/CB. (*aarch64_tbz1): Likewise. gcc/

Re: [Fortran, Patch, PR120843, v3] Fix reject valid, because of inconformable coranks

2025-07-02 Thread Jerry D
On 7/2/25 9:40 AM, Jerry D wrote: On 7/2/25 3:14 AM, Andre Vehreschild wrote: Hi all, I successfully created a big mess with the previous patch. First of all by applying an outdated one and secondly by adding the conformance checks for coranks in a3f1cdd8ed46f9816b31ab162ae4dac547d34ebc. Checki

[PATCH v9 3/9] AArch64: rename branch instruction rules

2025-07-02 Thread Karl Meakin
Give the `define_insn` rules used in lowering `cbranch4` to RTL more descriptive and consistent names: from now on, each rule is named after the AArch64 instruction that it generates. Also add comments to document each rule. gcc/ChangeLog: * config/aarch64/aarch64.md (condjump): Rename to

[PATCH v9 1/9] AArch64: place branch instruction rules together

2025-07-02 Thread Karl Meakin
The rules for conditional branches were spread throughout `aarch64.md`. Group them together so it is easier to understand how `cbranch4` is lowered to RTL. gcc/ChangeLog: * config/aarch64/aarch64.md (condjump): Move. (*compare_condjump): Likewise. (aarch64_cb1): Likewise.

[PATCH v9 6/9] AArch64: recognize `+cmpbr` option

2025-07-02 Thread Karl Meakin
Add the `+cmpbr` option to enable the FEAT_CMPBR architectural extension. gcc/ChangeLog: * config/aarch64/aarch64-option-extensions.def (cmpbr): New option. * config/aarch64/aarch64.h (TARGET_CMPBR): New macro. * doc/invoke.texi (cmpbr): New option. --- gcc/config

[PATCH v9 9/9] AArch64: make rules for CBZ/TBZ higher priority

2025-07-02 Thread Karl Meakin
Move the rules for CBZ/TBZ to be above the rules for CBB/CBH/CB. We want them to have higher priority because they can express larger displacements. gcc/ChangeLog: * config/aarch64/aarch64.md (aarch64_cbz1): Move above rules for CBB/CBH/CB. (*aarch64_tbz1): Likewise. gcc/

[PATCH v9 8/9] AArch64: rules for CMPBR instructions

2025-07-02 Thread Karl Meakin
Add rules for lowering `cbranch4` to CBB/CBH/CB when CMPBR extension is enabled. gcc/ChangeLog: * config/aarch64/aarch64-protos.h (aarch64_cb_rhs): New function. * config/aarch64/aarch64.cc (aarch64_cb_rhs): Likewise. * config/aarch64/aarch64.md (cbranch4): Rename to ...

[PATCH v9 7/9] AArch64: precommit test for CMPBR instructions

2025-07-02 Thread Karl Meakin
Commit the test file `cmpbr.c` before rules for generating the new instructions are added, so that the changes in codegen are more obvious in the next commit. gcc/testsuite/ChangeLog: * lib/target-supports.exp: Add `cmpbr` to the list of extensions. * gcc.target/aarch64/cmpbr.c: N

[PATCH v9 4/9] AArch64: add constants for branch displacements

2025-07-02 Thread Karl Meakin
Extract the hardcoded values for the minimum PC-relative displacements into named constants and document them. gcc/ChangeLog: * config/aarch64/aarch64.md (BRANCH_LEN_P_128MiB): New constant. (BRANCH_LEN_N_128MiB): Likewise. (BRANCH_LEN_P_1MiB): Likewise. (BRANCH_LE

[PATCH v9 5/9] AArch64: make `far_branch` attribute a boolean

2025-07-02 Thread Karl Meakin
The `far_branch` attribute only ever takes the values 0 or 1, so make it a `no/yes` valued string attribute instead. gcc/ChangeLog: * config/aarch64/aarch64.md (far_branch): Replace 0/1 with no/yes. (aarch64_bcond): Handle rename. (aarch64_cbz1): Likewise.

[PATCH v9 2/9] AArch64: reformat branch instruction rules

2025-07-02 Thread Karl Meakin
Make the formatting of the RTL templates in the rules for branch instructions more consistent with each other. gcc/ChangeLog: * config/aarch64/aarch64.md (cbranch4): Reformat. (cbranchcc4): Likewise. (condjump): Likewise. (*compare_condjump): Likewise. (aar

[PATCH v9 0/9] AArch64: CMPBR support

2025-07-02 Thread Karl Meakin
This patch series adds support for the CMPBR extension. It includes the new `+cmpbr` option and rules to generate the new instructions when lowering conditional branches. Changelog: * v9: - Mark the non-far branches unlikely, so that the branch is consistently generated as: ```asm bra

Re: [PATCH] x86-64: Add RDI clobber to tls_local_dynamic_64 patterns

2025-07-02 Thread Uros Bizjak
On Thu, Jul 3, 2025 at 6:32 AM H.J. Lu wrote: > > *tls_local_dynamic_64_ uses RDI as the __tls_get_addr argument. > Add RDI clobber to tls_local_dynamic_64 patterns to show it. > > PR target/120908 > * config/i386/i386.cc (legitimize_tls_address): Pass RDI to > gen_tls_local_dynamic_64. > * config

Re: [PATCH v3] tree-optimization/120780: Support object size for containing objects

2025-07-02 Thread Richard Biener
On Wed, Jul 2, 2025 at 11:32 PM Siddhesh Poyarekar wrote: > > MEM_REF cast of a subobject to its containing object has negative > offsets, which objsz sees as an invalid access. Support this use case > by peeking into the structure to validate that the containing object > indeed contains a type o

Re: [PATCH v4 2/6] dwarf: create annotation DIEs for btf tags

2025-07-02 Thread Richard Biener
On Wed, Jul 2, 2025 at 7:17 PM David Faust wrote: > > > > On 7/2/25 00:35, Richard Biener wrote: > > On Tue, Jul 1, 2025 at 11:20 PM David Faust wrote: > >> > >> > >> > >> On 7/1/25 01:02, Richard Biener wrote: > >>> On Mon, Jun 30, 2025 at 9:12 PM David Faust > >>> wrote: > > >

[PATCH] x86-64: Add RDI clobber to tls_global_dynamic_64 patterns

2025-07-02 Thread H.J. Lu
*tls_global_dynamic_64_ uses RDI as the __tls_get_addr argument. Add RDI clobber to tls_global_dynamic_64 patterns to show it. PR target/120908 * config/i386/i386.cc (legitimize_tls_address): Pass RDI to gen_tls_global_dynamic_64. * config/i386/i386.md (*tls_global_dynamic_64_): Add RDI clobber an

Re: [PATCH] testsuite, powerpc, v2: Fix vsx-vectorize-* after alignment peeling [PR118567]

2025-07-02 Thread Segher Boessenkool
On Wed, Jul 02, 2025 at 11:06:38AM +0200, Jakub Jelinek wrote: > On Tue, Jul 01, 2025 at 02:50:40PM -0500, Segher Boessenkool wrote: > > No tests become good tests without effort. And tests that are not good > > tests require constant maintenance! > > Here are two patches, either just the first o

[committed] [PR rtl-optimization/120242] Fix SUBREG_PROMOTED_VAR_P after ext-dce's actions

2025-07-02 Thread Jeff Law
[ Whoops, forgot to push the send button... ] I've gone back and forth of these problems multiple times. We have two passes, ext-dce and combine which eliminate extensions using totally different mechanisms. ext-dce looks for cases where the state of upper bits in an object aren't observabl

Re: [PATCH V3] x86: Enable separate shrink wrapping

2025-07-02 Thread Segher Boessenkool
On Wed, Jul 02, 2025 at 01:32:37PM +, Cui, Lili wrote: > > > + /* Don't mess with the following registers. */ if > > > + (frame_pointer_needed) > > > +bitmap_clear_bit (components, HARD_FRAME_POINTER_REGNUM); > > > > What is that about? Isn't that one of the bigger possible wins? > >

Re: [PATCH v2] libstdc++: Use hidden friends for __normal_iterator operators

2025-07-02 Thread Patrick Palka
On Wed, 11 Jun 2025, Jonathan Wakely wrote: > As suggested by Jason, this makes all __normal_iterator operators into > friends so they can be found by ADL and don't need to be separately > exported in module std. > > The operator<=> comparing two iterators of the same type is removed > entirely

Re: [Fortran, Patch, PR120843, v3] Fix reject valid, because of inconformable coranks

2025-07-02 Thread Jerry D
On 7/2/25 3:14 AM, Andre Vehreschild wrote: Hi all, I successfully created a big mess with the previous patch. First of all by applying an outdated one and secondly by adding the conformance checks for coranks in a3f1cdd8ed46f9816b31ab162ae4dac547d34ebc. Checking the standard even using AI (haha

[PATCH] libquadmath: add quad support for trig-pi functions

2025-07-02 Thread Yuao Ma
Hi all, This patch adds the required function for Fortran trigonometric functions to work with glibc versions prior to 2.26. It's based on glibc source commit 632d895f3e5d98162f77b9c3c1da4ec19968b671. I've built it successfully on my end. Documentation is also included. Please take a look wh

Re: [PATCH] s390: Add -fno-stack-protector to 3 tests

2025-07-02 Thread Andreas Schwab
On Jul 02 2025, Stefan Schulze Frielinghaus wrote: > I'm pretty new to tcl and didn't do extensive testing but for my few > experiments it worked so far. I guess `string match` uses globbing so > something like "* -f(no-)?stack-protector* *" doesn't work which is why > I used two matches. You ca

Re: [Fortran, Patch, PR120843, v3] Fix reject valid, because of inconformable coranks

2025-07-02 Thread Andre Vehreschild
Hi all, I successfully created a big mess with the previous patch. First of all by applying an outdated one and secondly by adding the conformance checks for coranks in a3f1cdd8ed46f9816b31ab162ae4dac547d34ebc. Checking the standard even using AI (haha) to figure if coranks of an expression have r

Re: [PATCH] libstdc++: Members missing in std::numeric_limits

2025-07-02 Thread Jonathan Wakely
On Wed, 2 Jul 2025 at 14:45, Mateusz Zych wrote: > > > Oh actually the radix members should be of type int, not bool. I can fix > > that. > > Yes - thank you very much Jonathan for catching that! > It was my honest oversight - I am so used to using auto, that I have > accidentally copied the wro

Re: [PATCH] c, c++: Fix unused result for empty types [PR82134]

2025-07-02 Thread Patrick Palka
On Mon, 9 Jun 2025, Jeremy Rifkin wrote: > Hi, > This fixes PR c/82134 which concerns gcc emitting an incorrect unused > result diagnostic for empty types. This diagnostic is emitted from > tree-cfg.cc because of a couple code paths which attempt to avoid > copying empty types, resulting in GIMPLE

Re: [PATCH v2] libstdc++: Use hidden friends for __normal_iterator operators

2025-07-02 Thread Patrick Palka
On Wed, 2 Jul 2025, Jonathan Wakely wrote: > On Wed, 2 Jul 2025 at 15:29, Patrick Palka wrote: > > > > > > On Wed, 11 Jun 2025, Jonathan Wakely wrote: > > > > > As suggested by Jason, this makes all __normal_iterator operators into > > > friends so they can be found by ADL and don't need to be se

Re: [PATCH v4 2/6] dwarf: create annotation DIEs for btf tags

2025-07-02 Thread David Faust
On 7/2/25 00:35, Richard Biener wrote: > On Tue, Jul 1, 2025 at 11:20 PM David Faust wrote: >> >> >> >> On 7/1/25 01:02, Richard Biener wrote: >>> On Mon, Jun 30, 2025 at 9:12 PM David Faust wrote: On 6/30/25 06:11, Richard Biener wrote: >> +static void >> +gen_btf_

Re: [PATCH v2] libstdc++: Use hidden friends for __normal_iterator operators

2025-07-02 Thread Jonathan Wakely
On Wed, 2 Jul 2025 at 18:03, Patrick Palka wrote: > > On Wed, 2 Jul 2025, Jonathan Wakely wrote: > > > On Wed, 2 Jul 2025 at 15:29, Patrick Palka wrote: > > > > > > > > > On Wed, 11 Jun 2025, Jonathan Wakely wrote: > > > > > > > As suggested by Jason, this makes all __normal_iterator operators in

Re: [PATCH] libstdc++: Members missing in std::numeric_limits

2025-07-02 Thread Mateusz Zych
> Oh actually the radix members should be of type int, not bool. I can fix that. Yes - thank you very much Jonathan for catching that! It was my honest oversight - I am so used to using auto, that I have accidentally copied the wrong type. Also, thank you for adding tests - I should have added the

Re: [PATCH 1/1] contrib: add vmtest-tool to test BPF programs

2025-07-02 Thread Jose E. Marchesi
> Hi Jose, > Apologies for the late reply, I haven't been feeling well for the past > few days. No worries! >> > This patch adds the vmtest-tool subdirectory under contrib which tests >> > BPF programs under a live kernel using a QEMU VM. It automatically >> > builds the specified kernel vers

Re: [PATCH] libstdc++: Members missing in std::numeric_limits

2025-07-02 Thread Mateusz Zych
OK, then I’ll prepare appropriate patch with tests and send it when I’m done implementing it. Thanks, Mateusz Zych On Wed, 2 Jul 2025 at 16:59, Jonathan Wakely wrote: > On Wed, 2 Jul 2025 at 14:45, Mateusz Zych wrote: > > > > > Oh actually the radix members should be of type int, not bool. I c

RE: [PATCH V3] x86: Enable separate shrink wrapping

2025-07-02 Thread Cui, Lili
> -Original Message- > From: Segher Boessenkool > Sent: Monday, June 30, 2025 6:23 AM > To: Cui, Lili > Cc: ubiz...@gmail.com; gcc-patches@gcc.gnu.org; Liu, Hongtao > ; richard.guent...@gmail.com; Michael Matz > > Subject: Re: [PATCH V3] x86: Enable separate shrink wrapping > > Hi! >

Re: [PATCH v2] libstdc++: Use hidden friends for __normal_iterator operators

2025-07-02 Thread Jonathan Wakely
On Wed, 2 Jul 2025 at 15:29, Patrick Palka wrote: > > > On Wed, 11 Jun 2025, Jonathan Wakely wrote: > > > As suggested by Jason, this makes all __normal_iterator operators into > > friends so they can be found by ADL and don't need to be separately > > exported in module std. > > > > The operator<

Re: [PATCH] libstdc++: Members missing in std::numeric_limits

2025-07-02 Thread Jonathan Wakely
On Wed, 2 Jul 2025 at 17:15, Mateusz Zych wrote: > > OK, then I’ll prepare appropriate patch with tests and send it when I’m done > implementing it. That would be great, thanks. I won't push the initial patch, we can wait for you to prepare the complete fix. Please note that for a more significa

Re: [PATCH 1/1] contrib: add vmtest-tool to test BPF programs

2025-07-02 Thread Piyush Raj
Hi Jose, Apologies for the late reply, I haven't been feeling well for the past few days. > This patch adds the vmtest-tool subdirectory under contrib which tests > BPF programs under a live kernel using a QEMU VM. It automatically > builds the specified kernel version with eBPF support enabled

Re: [PATCH 1/1] [RFC][AutoFDO] Propagate information to outline copies if not inlined

2025-07-02 Thread Jan Hubicka
> On 02/07/25 07:26, Kugan Vivekanandarajah wrote: > > > > > > > > > > Given the latest few patches that you have committed, is this patch > > > necessary > > > anymore? I have not fully understood the new logic as I was on holiday > > > last > > > week, but it looks like the propagation is oc

Re: [PATCH] x86-64: Add RDI clobber to tls_global_dynamic_64 patterns

2025-07-02 Thread Uros Bizjak
On Wed, Jul 2, 2025 at 2:43 PM H.J. Lu wrote: > > *tls_global_dynamic_64_ uses RDI as the __tls_get_addr argument. > Add RDI clobber to tls_global_dynamic_64 patterns to show it. > > PR target/120908 > * config/i386/i386.cc (legitimize_tls_address): Pass RDI to > gen_tls_global_dynamic_64. > * con

Re: [Fortran, Patch, PR120843, v3] Fix reject valid, because of inconformable coranks

2025-07-02 Thread Steve Kargl
On Wed, Jul 02, 2025 at 04:36:38AM -0700, Damian Rouson wrote: > git branch > gir checkout > git add > git commit > git rebase > git push > > It’s time to move beyond emailing patches! (Please.) I don't use git other than 'git clone', 'git reset --hard', and 'git diff'. If gfortran development

Re: [PATCH] libstdc++: construct bitset from string_view (P2697) [PR119742]

2025-07-02 Thread Jonathan Wakely
On Tue, 1 Jul 2025 at 23:36, Nathan Myers wrote: > > Add a bitset constructor from string_view, with other arguments > matching the constructor from string. Test in ways that exercise > code paths not checked in existing tests for other constructors. > Fix existing tests that would fail to detect

Re: [PATCH] [RISC-V] Fix shift type for RVV interleaved stepped patterns [PR120356]

2025-07-02 Thread Jeff Law
On 7/2/25 2:16 AM, Robin Dapp wrote: CI-testing was failed: https://github.com/ewlu/gcc-precommit-ci/ issues/3585#issuecomment-3022157670 for sat_u_add-5-u32.c and vect-reduc-sad-1.c. These failures are compile issues appeared due to afdo-crossmodule-1b.c file. For some reason, in both case

Re: [PATCH v7 8/9] AArch64: rules for CMPBR instructions

2025-07-02 Thread Karl Meakin
On 01/07/2025 11:02, Richard Sandiford wrote: Karl Meakin writes: @@ -763,6 +784,68 @@ (define_expand "cbranchcc4" "" ) +;; Emit a `CB (register)` or `CB (immediate)` instruction. +;; The immediate range depends on the comparison code. +;; Comparisons against immediates outside this

Re: [PATCH] AArch64: Use correct cost for shifted halfword load/stores

2025-07-02 Thread Richard Sandiford
Wilco Dijkstra writes: > Since all Armv9 cores support shifted LDRH/STRH, use the correct cost of zero > for these. > > Passes regress, OK for commit? > > gcc: > * config/aarch64/tuning_models/generic_armv9_a.h > (generic_armv9_a_addrcost_table): Use zero cost for himode. OK if th

Re: [PATCH v2] vect: Misalign checks for gather/scatter.

2025-07-02 Thread Robin Dapp
I'm not sure? I'd prefer some refactoring to make this more obvious (and the split between the two functions doesn't help ...). If you're sure it's all covered then ignore this comment, I can do the refactoring as followup. It just wasn't obvious to me. Ah, I think I misread your original com

Re: [PATCH] [RISC-V] Fix shift type for RVV interleaved stepped patterns [PR120356]

2025-07-02 Thread Robin Dapp
CI-testing was failed: https://github.com/ewlu/gcc-precommit-ci/issues/3585#issuecomment-3022157670 for sat_u_add-5-u32.c and vect-reduc-sad-1.c. These failures are compile issues appeared due to afdo-crossmodule-1b.c file. For some reason, in both cases the following snippets are being inserted i

[PING][PATCH] Add string_slice class.

2025-07-02 Thread Alfie Richards
Ping for this patch. Thanks, Alfie On 20/06/2025 14:23, Alfie Richards wrote: Thanks for the pointer Joseph. This update adds tests to gcc/testsuite/g++.dg/warn/Wformat-gcc_diag-1.C as this seems to be where similar tests are done (eg, %D for tree). I couldn't find any tests for the actual ou

[PATCH] testsuite, powerpc, v2: Fix vsx-vectorize-* after alignment peeling [PR118567]

2025-07-02 Thread Jakub Jelinek
On Tue, Jul 01, 2025 at 02:50:40PM -0500, Segher Boessenkool wrote: > No tests become good tests without effort. And tests that are not good > tests require constant maintenance! Here are two patches, either just the first one or both can be used and both were tested on powerpc64le-linux. The fi

Re: [PATCH v2] libstdc++: Lift locale initialization in main chrono format loop [PR110739]

2025-07-02 Thread Jonathan Wakely
On Wed, 2 Jul 2025 at 10:33, Tomasz Kaminski wrote: > > > > On Wed, Jul 2, 2025 at 11:27 AM Jonathan Wakely wrote: >> >> On 01/07/25 16:54 +0200, Tomasz Kamiński wrote: >> >This patch lifts locale initialization from locale-specific handling methods >> >into _M_format_to function, and pass the lo

Re: [PATCH] libstdc++: make range view ctors explicit (P2711) [PR119744]

2025-07-02 Thread Jonathan Wakely
On Tue, 1 Jul 2025 at 23:34, Nathan Myers wrote: > > Make range view constructors explicit, per P2711. Technically, this > is a breaking change, but it is unlikely to break any production > code, as reliance on non-explicit construction is unidiomatic.. > > libstdc++-v3/ChangeLog > PR libs

Re: [PATCH] s390: Add -fno-stack-protector to 3 tests

2025-07-02 Thread Stefan Schulze Frielinghaus
On Tue, Jul 01, 2025 at 06:33:12PM +0200, Jakub Jelinek wrote: > On Tue, Jul 01, 2025 at 03:47:53PM +0200, Stefan Schulze Frielinghaus wrote: > > In the past years I have started to use more and more function body > > checks whenever gcc emits optimal code for a function. With that I > > wanted to

Re: [PATCH] libstdc++: Members missing in std::numeric_limits

2025-07-02 Thread Jonathan Wakely
On 02/07/25 03:36 +0300, Mateusz Zych wrote: Hello libstdc++ Team! I have recently found a bug in libstdc++, that is, the std::numeric_limits<> template specializations for integer-class types are missing some of static data members, which results in compilation errors of valid C++ code: - Co

Re: [PATCH] s390: Add -fno-stack-protector to 3 tests

2025-07-02 Thread Jakub Jelinek
On Wed, Jul 02, 2025 at 11:43:13AM +0200, Stefan Schulze Frielinghaus wrote: > On Tue, Jul 01, 2025 at 06:33:12PM +0200, Jakub Jelinek wrote: > > On Tue, Jul 01, 2025 at 03:47:53PM +0200, Stefan Schulze Frielinghaus wrote: > > > In the past years I have started to use more and more function body >

Re: [PATCH] libstdc++: Format chrono %a/%A/%b/%B/%p using locale's time_put [PR117214]

2025-07-02 Thread Tomasz Kaminski
To do that, you may need to extract a debug/throws checks from this functions, i.e. having something like: if (_M_check_ok(__t, __conv)) {}; else (__use_locale_fmt && ...) else switch() Where _M_check_ok() would have a switch that checks if value is ok() based on specifier, and throw, print mes

Re: [PATCH] libstdc++: Members missing in std::numeric_limits

2025-07-02 Thread Jonathan Wakely
On Wed, 2 Jul 2025 at 10:50, Jonathan Wakely wrote: > > On 02/07/25 03:36 +0300, Mateusz Zych wrote: > >Hello libstdc++ Team! > > > >I have recently found a bug in libstdc++, that is, > >the std::numeric_limits<> template specializations for integer-class types > >are missing some of static data m

Re: [PATCH] libstdc++: Members missing in std::numeric_limits

2025-07-02 Thread Jonathan Wakely
On 02/07/25 11:52 +0100, Jonathan Wakely wrote: On Wed, 2 Jul 2025 at 10:50, Jonathan Wakely wrote: On 02/07/25 03:36 +0300, Mateusz Zych wrote: >Hello libstdc++ Team! > >I have recently found a bug in libstdc++, that is, >the std::numeric_limits<> template specializations for integer-class ty

Re: [Fortran, Patch, PR120843, v3] Fix reject valid, because of inconformable coranks

2025-07-02 Thread Damian Rouson
git branch gir checkout git add git commit git rebase git push It’s time to move beyond emailing patches! (Please.) Damian On Wed, Jul 2, 2025 at 03:17 Andre Vehreschild wrote: > Hi all, > > I successfully created a big mess with the previous patch. First of all by > applying an outdated one

Re: [PATCH v2] libstdc++: Lift locale initialization in main chrono format loop [PR110739]

2025-07-02 Thread Jonathan Wakely
On 01/07/25 16:54 +0200, Tomasz Kamiński wrote: This patch lifts locale initialization from locale-specific handling methods into _M_format_to function, and pass the locale by const reference. To avoid unnecessary computation of locale::classic(), we use _Optional_locale, and emplace into it only

Re: [PATCH] libstdc++: Format chrono %a/%A/%b/%B/%p using locale's time_put [PR117214]

2025-07-02 Thread Tomasz Kaminski
On Wed, Jul 2, 2025 at 9:13 AM XU Kailiang wrote: > > C++ formatting locale could have a custom time_put that performs > differently from the C locale, so do not use __timepunct directly. > > libstdc++-v3/ChangeLog: > > PR libstdc++/117214 > * include/bits/chrono_io.h (__formatter

Re: [PATCH] libstdc++: Format chrono %a/%A/%b/%B/%p using locale's time_put [PR117214]

2025-07-02 Thread Jonathan Wakely
On Wed, 2 Jul 2025 at 10:30, Tomasz Kaminski wrote: > > > > On Wed, Jul 2, 2025 at 9:13 AM XU Kailiang wrote: >> >> >> C++ formatting locale could have a custom time_put that performs >> differently from the C locale, so do not use __timepunct directly. >> >> libstdc++-v3/ChangeLog: >> >>

Re: [PATCH v2] libstdc++: Lift locale initialization in main chrono format loop [PR110739]

2025-07-02 Thread Tomasz Kaminski
On Wed, Jul 2, 2025 at 11:27 AM Jonathan Wakely wrote: > On 01/07/25 16:54 +0200, Tomasz Kamiński wrote: > >This patch lifts locale initialization from locale-specific handling > methods > >into _M_format_to function, and pass the locale by const reference. > >To avoid unnecessary computation of

Re: [PATCH v2] vect: Misalign checks for gather/scatter.

2025-07-02 Thread Richard Biener
On Wed, 2 Jul 2025, Robin Dapp wrote: > > The else (get_group_load_store_type) can end up returning > > VMAT_GATHER_SCATTER and thus require the above checking as well. > > Isn't this already covered by > > if (*memory_access_type == VMAT_ELEMENTWISE > || (*memory_access_type == VMAT_GATHE

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

2025-07-02 Thread Richard Biener
On Tue, Jun 10, 2025 at 11:40 PM David Faust wrote: > > Add two new c-family attributes, "btf_type_tag" and "btf_decl_tag" > along with a simple shared handler for them. > > gcc/c-family/ > * c-attribs.cc (c_common_attribute_table): Add btf_decl_tag and > btf_type_tag attributes. >

Re: [PATCH 1/2] doc: Clarify mode of else operand for vec_mask_load_lanesmn

2025-07-02 Thread Richard Biener
On Tue, 1 Jul 2025, Alex Coplan wrote: > This extends the documentation of the vec_mask_load_lanes optab to > explicitly state that the mode of the else operand is n, i.e. the mode > of a single subvector. > > OK to install? OK. > Thanks, > Alex > > gcc/ChangeLog: > > * doc/md.texi (Sta

Re: [PATCH v2] vect: Misalign checks for gather/scatter.

2025-07-02 Thread Robin Dapp
The else (get_group_load_store_type) can end up returning VMAT_GATHER_SCATTER and thus require the above checking as well. Isn't this already covered by if (*memory_access_type == VMAT_ELEMENTWISE || (*memory_access_type == VMAT_GATHER_SCATTER && GATHER_SCATTER_LEGACY_P (*gs_inf

Re: [PATCH 2/2] aarch64: Drop const_int from aarch64_maskload_else_operand

2025-07-02 Thread Kyrylo Tkachov
> On 1 Jul 2025, at 18:37, Alex Coplan wrote: > > The "else operand" to maskload should always be a const_vector, never a > const_int. > > This was just an issue I noticed while looking through the code, I don't > have a testcase which shows a concrete problem due to this. > > Testing of tha

Re: [PATCH] [RISC-V] Fix shift type for RVV interleaved stepped patterns [PR120356]

2025-07-02 Thread Alexey Merzlyakov
On Tue, Jul 01, 2025 at 09:28:34AM +0200, Robin Dapp wrote: > > It corrects the shift type of interleaved stepped patterns for const vector > > expanding in LRA. The shift instruction was initially LSHIFTRT, and it seems > > still should be the same type for both LRA and other cases. > > This is O

[PATCH v2] c++: Fix FMV return type ambiguation

2025-07-02 Thread Alfie Richards
Hi Jason, Thanks for the feedback, see below an updated patch. Again reg-tested on Aarch64 and x86. Thanks, Alfie -- >8 -- Add logic for the case of two FMV annotated functions with identical signature other than the return type. Previously this was ignored, this changes the behavior to emit

[PATCH] Do not query further vector epilogues after a masked epilogue

2025-07-02 Thread Richard Biener
When doing --param vect-partial-vector-usage=1 we'd continue querying the target whether it wants more vector epilogues, but when it comes back with a suggestion we then might iterate endlessly. Do not even ask the target when we decided for the last epilogue to be one with partial vectors. Boots

[PATCH v8 2/9] AArch64: reformat branch instruction rules

2025-07-02 Thread Karl Meakin
Make the formatting of the RTL templates in the rules for branch instructions more consistent with each other. gcc/ChangeLog: * config/aarch64/aarch64.md (cbranch4): Reformat. (cbranchcc4): Likewise. (condjump): Likewise. (*compare_condjump): Likewise. (aar

[pushed] c++: uninitialized TARGET_EXPR and constexpr [PR120684]

2025-07-02 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- In r15-7532 for PR118856 I introduced a TARGET_EXPR with a TARGET_EXPR_INITIAL of void_node to express that no initialization is done. And indeed evaluating that doesn't store a value for the TARGET_EXPR_SLOT variable. But then at the end o

[PATCH] x86-64: Add RDI clobber to tls_local_dynamic_64 patterns

2025-07-02 Thread H.J. Lu
*tls_local_dynamic_64_ uses RDI as the __tls_get_addr argument. Add RDI clobber to tls_local_dynamic_64 patterns to show it. PR target/120908 * config/i386/i386.cc (legitimize_tls_address): Pass RDI to gen_tls_local_dynamic_64. * config/i386/i386.md (*tls_local_dynamic_64_): Add RDI clobber and us

[PATCH v4] rs6000: Adding missed ISA 3.0 atomic memory operation instructions.

2025-07-02 Thread jeevitha
Hi All, The following patch has been bootstrapped and regtested on powerpc64le-linux. Changes from V3: * Replaced named operands with positional operands in inline assembly for better readability. * Considered using _ADDR[0] and _ADDR[1] to make memory reads more explicit to the compiler. * Cle

[PATCH v3] RISC-V: Mips P8700 Conditional Move Support.

2025-07-02 Thread Umesh Kalappa
Indentation are updated accordingly and no regress found. gcc/ChangeLog: *config/riscv/riscv-cores.def(RISCV_CORE): Updated the supported march. *config/riscv/riscv-ext-mips.def(DEFINE_RISCV_EXT): New file added for mips conditional mov extension. *config/riscv/ris

Re: [PATCH v6 1/3][Middle-end] Provide more contexts for -Warray-bounds, -Wstringop-*warning messages due to code movements from compiler transformation (Part 1) [PR109071, PR85788, PR88771, PR106762,

2025-07-02 Thread Richard Biener
On Tue, Jul 1, 2025 at 5:17 PM Qing Zhao wrote: > > > > > On Jul 1, 2025, at 03:14, Richard Biener wrote: > > > > On Mon, Jun 30, 2025 at 10:37 PM Qing Zhao wrote: > >> > >> Hi, David, > >> > >> Thank you for the info. > >> > >> Yes, this does sound like a general issue in this area. > >> > >> I

[PATCH] libstdc++: Format chrono %a/%A/%b/%B/%p using locale's time_put [PR117214]

2025-07-02 Thread XU Kailiang
C++ formatting locale could have a custom time_put that performs differently from the C locale, so do not use __timepunct directly. libstdc++-v3/ChangeLog: PR libstdc++/117214 * include/bits/chrono_io.h (__formatter_chrono::_M_a_A, __formatter_chrono::_M_b_B, __formatter

[PATCH] LoongArch: Prevent subreg of subreg in CRC

2025-07-02 Thread Xi Ruoyao
The register_operand predicate can match subreg, then we'd have a subreg of subreg and it's invalid. Use lowpart_subreg to avoid the nested subreg. gcc/ChangeLog: * config/loongarch/loongarch.md (crc_combine): Avoid nested subreg. gcc/testsuite/ChangeLog: * gcc.c-tortu

Re: [PATCH v4 2/6] dwarf: create annotation DIEs for btf tags

2025-07-02 Thread Richard Biener
On Tue, Jul 1, 2025 at 11:20 PM David Faust wrote: > > > > On 7/1/25 01:02, Richard Biener wrote: > > On Mon, Jun 30, 2025 at 9:12 PM David Faust wrote: > >> > >> > >> > >> On 6/30/25 06:11, Richard Biener wrote: > +static void > +gen_btf_decl_tag_dies (tree t, dw_die_ref target, dw_die

[PATCH] tree-optimization/118669 - fixup wrongly aligned loads/stores

2025-07-02 Thread Richard Biener
The vectorizer tracks alignment of datarefs with dr_aligned and dr_unaligned_supported but that's aligned with respect to the target alignment which can be less aligned than the mode used for the access. The following fixes this discrepancy for vectorizing loads and stores. The issue is visible f

[PATCH] libstdc++: Make VERIFY a variadic macro

2025-07-02 Thread Jonathan Wakely
This defines the testsuite assertion macro VERIFY so that it allows un-parenthesized expressions containing commas. This matches how assert is defined in C++26, following the approval of P2264R7. The primary motivation is to allow expressions that the preprocessor splits into multiple arguments, e

[PATCH v8 7/9] AArch64: precommit test for CMPBR instructions

2025-07-02 Thread Karl Meakin
Commit the test file `cmpbr.c` before rules for generating the new instructions are added, so that the changes in codegen are more obvious in the next commit. gcc/testsuite/ChangeLog: * lib/target-supports.exp: Add `cmpbr` to the list of extensions. * gcc.target/aarch64/cmpbr.c: N

[PATCH v8 4/9] AArch64: add constants for branch displacements

2025-07-02 Thread Karl Meakin
Extract the hardcoded values for the minimum PC-relative displacements into named constants and document them. gcc/ChangeLog: * config/aarch64/aarch64.md (BRANCH_LEN_P_128MiB): New constant. (BRANCH_LEN_N_128MiB): Likewise. (BRANCH_LEN_P_1MiB): Likewise. (BRANCH_LE

[PATCH v3] tree-optimization/120780: Support object size for containing objects

2025-07-02 Thread Siddhesh Poyarekar
MEM_REF cast of a subobject to its containing object has negative offsets, which objsz sees as an invalid access. Support this use case by peeking into the structure to validate that the containing object indeed contains a type of the subobject at that offset and if present, adjust the wholesize f

[PATCH v8 8/9] AArch64: rules for CMPBR instructions

2025-07-02 Thread Karl Meakin
Add rules for lowering `cbranch4` to CBB/CBH/CB when CMPBR extension is enabled. gcc/ChangeLog: * config/aarch64/aarch64-protos.h (aarch64_cb_rhs): New function. * config/aarch64/aarch64.cc (aarch64_cb_rhs): Likewise. * config/aarch64/aarch64.md (cbranch4): Rename to ...

Re: [PATCH v7 8/9] AArch64: rules for CMPBR instructions

2025-07-02 Thread Richard Sandiford
Karl Meakin writes: > On 01/07/2025 11:02, Richard Sandiford wrote: >> Karl Meakin writes: >>> @@ -763,6 +784,68 @@ (define_expand "cbranchcc4" >>> "" >>> ) >>> >>> +;; Emit a `CB (register)` or `CB (immediate)` instruction. >>> +;; The immediate range depends on the comparison code. >>>

[PATCH v8 0/9] AArch64: CMPBR support

2025-07-02 Thread Karl Meakin
This patch series adds support for the CMPBR extension. It includes the new `+cmpbr` option and rules to generate the new instructions when lowering conditional branches. Changelog: * v8: - Support far branches for the `CBB` and `CBH` instructions, and add tests for them. - Mark the branch in

[PATCH v8 5/9] AArch64: make `far_branch` attribute a boolean

2025-07-02 Thread Karl Meakin
The `far_branch` attribute only ever takes the values 0 or 1, so make it a `no/yes` valued string attribute instead. gcc/ChangeLog: * config/aarch64/aarch64.md (far_branch): Replace 0/1 with no/yes. (aarch64_bcond): Handle rename. (aarch64_cbz1): Likewise.

[PATCH v8 3/9] AArch64: rename branch instruction rules

2025-07-02 Thread Karl Meakin
Give the `define_insn` rules used in lowering `cbranch4` to RTL more descriptive and consistent names: from now on, each rule is named after the AArch64 instruction that it generates. Also add comments to document each rule. gcc/ChangeLog: * config/aarch64/aarch64.md (condjump): Rename to

[PATCH v8 6/9] AArch64: recognize `+cmpbr` option

2025-07-02 Thread Karl Meakin
Add the `+cmpbr` option to enable the FEAT_CMPBR architectural extension. gcc/ChangeLog: * config/aarch64/aarch64-option-extensions.def (cmpbr): New option. * config/aarch64/aarch64.h (TARGET_CMPBR): New macro. * doc/invoke.texi (cmpbr): New option. --- gcc/config

[PATCH v2] libstdc++: construct bitset from string_view (P2697) [PR119742]

2025-07-02 Thread Nathan Myers
Changes in V2: * Generalize private member _M_check_initial_position for use with both string and string_view arguments. * Remove unnecessary #if guards for version and hostedness. * Remove redundant "std::" qualifications in new code. * Improve Doxygen source readability. * Clarify commit messag

[PATCH] c++: -fno-delete-null-pointer-checks constexpr addr comparison [PR71962]

2025-07-02 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- Here the flag -fno-delete-null-pointer-checks causes the trivial address comparison in inline int a, b; static_assert(&a != &b); to be rejected as non-constant because with the flag we can't assume such