[PATCH] c++: Implement C++ CWG3048 - Empty destructuring expansion statements

2025-08-24 Thread Jakub Jelinek
Hi! The following patch implements the proposed resolution of https://cplusplus.github.io/CWG/issues/3048.html Instead of rejecting structured binding size it just builds a normal decl rather than structured binding declaration. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

[PATCH] c++: Fix ICE with parameter uses in expansion stmts [PR121575]

2025-08-24 Thread Jakub Jelinek
Hi! The following testcase shows an ICE when a parameter of a non-template function is referenced in expansion stmt body. tsubst_expr in that case assumes that either the PARM_DECL has registered local specialization, or is this argument or it is in unevaluated context. Parameters are always defi

Re: [PATCH 3/3] OpenMP: give error when variant is the same as the base function [PR118839]

2025-08-24 Thread Tobias Burnus
Sandra Loosemore wrote: As noted in the issue, the C++ front end has deeper problems: […] Some real solution ought to be included as part of fixing PR118791. okay. gcc/c/ […] gcc/cp/ […] gcc/fortran/ PR middle-end/118839 * trans-openmp.cc (gfc_trans_omp_declare_variant): Error i

Re: [PATCH] libstdc++: Optimized bind_front/bind_back for zero bound args.

2025-08-24 Thread Tomasz Kaminski
On Wed, Aug 20, 2025 at 12:09 PM Tomasz Kamiński wrote: > This patch adjusts the implementation of bind_front(f) and bind_back(f) > (with zero bound arguments), so it returns an auto(f) (a copy of the > functor), rather than a specialization of Bind_front/Bind_back. This change > is mostly unobse

[PATCH] c++: Check for *jump_target earlier in cxx_bind_parameters_in_call [PR121601]

2025-08-24 Thread Jakub Jelinek
Hi! The following testcase ICEs, because the /* Check we aren't dereferencing a null pointer when calling a non-static member function, which is undefined behaviour. */ if (i == 0 && DECL_OBJECT_MEMBER_FUNCTION_P (fun) && integer_zerop (arg) /* But ignore

Re: [PATCH 2/3] OpenMP: Fix handling of "simd" selector on "declare variant" [PR121630]

2025-08-24 Thread Jakub Jelinek
On Sun, Aug 24, 2025 at 08:16:32PM -0600, Sandra Loosemore wrote: > As noted in PR middle-end/121630, GCC seems to think that the "simd" > construct selector on "declare variant" implies that the variant > function accepts vectorized arguments, although this is not anywhere > in the OpenMP specific

[PATCH 3/3] OpenMP: give error when variant is the same as the base function [PR118839]

2025-08-24 Thread Sandra Loosemore
As noted in the issue, the C++ front end has deeper problems: it's supposed to do the name lookup of the variant at the call site but is instead doing it when parsing the "declare variant" construct, before registering the decl for the base function. The C++ part of the patch is a band-aid to catc

[PATCH 2/3] OpenMP: Fix handling of "simd" selector on "declare variant" [PR121630]

2025-08-24 Thread Sandra Loosemore
As noted in PR middle-end/121630, GCC seems to think that the "simd" construct selector on "declare variant" implies that the variant function accepts vectorized arguments, although this is not anywhere in the OpenMP specification. Additionally, it does not actually vectorize the calls when doing

[PATCH v2 1/3] OpenMP: Improve front-end error-checking for "declare variant"

2025-08-24 Thread Sandra Loosemore
This patch fixes a number of problems with parser error checking of "declare variant", especially in the C front end. The new C testcase unprototyped-variant.c added by this patch used to ICE when gimplifying the call site, at least in part because the variant was being recorded even after it was

[PATCH v2 0/3] "declare variant" error checking fixes

2025-08-24 Thread Sandra Loosemore
My fixes for "declare variant", previously posted here https://gcc.gnu.org/pipermail/gcc-patches/2025-August/692306.html have now grown to a set of 3 patches. Part 1 is a very lightly edited version of the original patch, just tweaking the wording of the "match" message and adding additional "in

[committed] Fix invalid right shift count with recent ifcvt changes

2025-08-24 Thread Jeff Law
I got too clever trying to simplify the right shift computation in my recent ifcvt patch. Interestingly enough, I haven't seen anything but the Linaro CI configuration actually trip the problem, though the code is clearly wrong. The problem I was trying to avoid were the leading zeros when ca

Re: [PATCH] LoongArch: Fix ICE in highway-1.3.0 testsuite [PR121634]

2025-08-24 Thread Lulu Cheng
在 2025/8/23 下午7:13, Xi Ruoyao 写道: I can't believe I made such a stupid pasto and the regression test didn't detect anything wrong. PR target/121634 gcc/ * config/loongarch/simd.md (simd_maddw_evod__): Use WVEC_HALF instead of WVEC for the mode of the sign_extend for

[PATCH 2/3] Forwprop: boolify forward_propagate_into_comparison

2025-08-24 Thread Andrew Pinski
After changing the return type of remove_prop_source_from_use, forward_propagate_into_comparison will never return 2. So boolify forward_propagate_into_comparison. Bootstrapped and tested on x86_64-linux-gnu. gcc/ChangeLog: * tree-ssa-forwprop.cc (forward_propagate_into_comparison): Bool

[PATCH 1/3] forwprop: Remove return type of remove_prop_source_from_use

2025-08-24 Thread Andrew Pinski
Since r5-4705-ga499aac5dfa5d9, remove_prop_source_from_use has always return false. This removes the return type of remove_prop_source_from_use and cleans up the usage of remove_prop_source_from_use. Bootstrapped and tested on x86_64-linux-gnu. gcc/ChangeLog: * tree-ssa-forwprop.cc (remo

[PATCH 3/3] forwprop: Boolify simplify_permutation

2025-08-24 Thread Andrew Pinski
After the return type of remove_prop_source_from_use was changed to void, simplify_permutation only returns 1 or 0 so it can be boolified. Bootstrapped and tested on x86_64-linux-gnu. gcc/ChangeLog: * tree-ssa-forwprop.cc (simplify_permutation): Boolify. (pass_forwprop::execute):

RE: [PATCH v4] Use x86 GFNI for vectorized constant byte shifts/rotates

2025-08-24 Thread Liu, Hongtao
> -Original Message- > From: Andi Kleen > Sent: Sunday, August 24, 2025 11:49 PM > To: gcc-patches@gcc.gnu.org > Cc: Liu, Hongtao ; Andi Kleen > Subject: [PATCH v4] Use x86 GFNI for vectorized constant byte shifts/rotates > > From: Andi Kleen > > [v4 version: Exclude for >> 7. Add t

[PATCH 3/3] xtensa: Make use of compact insn definition syntax for insns whose have multiple alternatives

2025-08-24 Thread Takayuki 'January June' Suwa
The use of compact syntax makes the relationship between asm output, operand constraints, and insn attributes easier to understand and modify, especially for "mov_internal". gcc/ChangeLog: * config/xtensa/xtensa.md (addsi3, mulhisi3, andsi3, zero_extendsi2, extendhisi2_internal,

[PATCH 1/3] xtensa: Simplify "zero_extend[hq]isi2" insn patterns

2025-08-24 Thread Takayuki 'January June' Suwa
gcc/ChangeLog: * config/xtensa/xtensa.md (mode_bits): New mode attribute. (zero_extendsi2): Use the appropriate mode iterator and attribute to unify "zero_extend[hq]isi2" to this description. --- gcc/config/xtensa/xtensa.md | 20 +--- 1 file change

[PATCH 2/3] xtensa: Simplify "*masktrue_const_bitcmpl" insn pattern

2025-08-24 Thread Takayuki 'January June' Suwa
gcc/ChangeLog: * config/xtensa/xtensa.md (The auxiliary define_split for *masktrue_const_bitcmpl): Use a more concise function call, i.e., (1 << GET_MODE_BITSIZE (mode)) - 1 is equivalent to GET_MODE_MASK (mode). --- gcc/config/xtensa/xtensa.md | 2 +- 1 f

Re: [PATCH] config: Remove unused autoconf files

2025-08-24 Thread Joseph Myers
On Thu, 21 Aug 2025, Pietro Monteiro wrote: > 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. Can you confirm they're also not used in newlib-cygwin, the other tree shar

[PATCH v4] Use x86 GFNI for vectorized constant byte shifts/rotates

2025-08-24 Thread Andi Kleen
From: Andi Kleen [v4 version: Exclude for >> 7. Add test cases for 256/128bit and improve tests. Remove some AVX512F checks. Fix mode iterator.] [v3 version: Remove unnecessary _mask pattern. Add extra FAIL case. Remove unnecessary AVX512F check. Fix changelog.] [v2 version: Split rotate patte

[PATCH] forwprop: Mark the old switch index for (maybe) dceing

2025-08-24 Thread Andrew Pinski
While looking at this code I noticed that we don't remove the old switch index assignment if it is only used in the switch after it is modified in simplify_gimple_switch. This fixes that by marking the old switch index for the dce worklist. Bootstrapped and tested on x86_64-linux-gnu. gcc/ChangeL

Re: [PATCH] c++/modules: Provide definitions of synthesized methods outside their defining module [PR120499]

2025-08-24 Thread Nathaniel Shead
On Sat, Aug 23, 2025 at 01:18:19PM -0400, Patrick Palka wrote: > On Fri, 22 Aug 2025, Nathaniel Shead wrote: > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > -- >8 -- > > > > In the PR, we're getting a linker error from _Vector_impl's destructor > > never getting em

[PATCH] c++/modules: Fix ADL [PR117658]

2025-08-24 Thread Nathaniel Shead
Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? -- >8 -- On looking again at [basic.lookup.argdep] p4, I believe GCC hasn't fully implemented the wording here for ADL. This patch fixes two issues. First, 4.3 indicates that a function exported from a named module should be visib

[PATCH v1] RISC-V: Add test case for unsigned scalar SAT_MUL form 4

2025-08-24 Thread pan2 . li
From: Pan Li The form 4 of unsigned scalar SAT_MUL is covered in middle-expand alreay, add test case here to cover form 4. The below test suites are passed for this patch series. * The rv64gcv fully regression test. gcc/testsuite/ChangeLog: * gcc.target/riscv/sat/sat_arith.h: Add test