[PATCH v1] RISC-V: Fix ICE for target attributes has different xlen size

2025-02-14 Thread pan2 . li
From: Pan Li This patch would like to avoid the ICE when the target attribute specific the xlen different to the cmd. Aka compile with rv64gc but target attribute with rv32gcv_zbb. For example as blow: 1 │ long foo (long a, long b) 2 │ __attribute__((target("arch=rv32gcv_zbb")));

[COMMITTED] gcc-15/changes: Restore link to OpenMP project page

2025-02-14 Thread Sandra Loosemore
--- htdocs/gcc-15/changes.html | 7 +++ 1 file changed, 7 insertions(+) diff --git a/htdocs/gcc-15/changes.html b/htdocs/gcc-15/changes.html index f4ad9569..853fad03 100644 --- a/htdocs/gcc-15/changes.html +++ b/htdocs/gcc-15/changes.html @@ -66,6 +66,13 @@ a work-in-progress. New Languages

Re: [PATCH v3] x86: Properly find the maximum stack slot alignment

2025-02-14 Thread H.J. Lu
On Fri, Feb 14, 2025 at 10:08 PM Richard Biener wrote: > > On Fri, 14 Feb 2025, Uros Bizjak wrote: > > > On Fri, Feb 14, 2025 at 4:56 AM H.J. Lu wrote: > > > > > > On Thu, Feb 13, 2025 at 5:17 PM Uros Bizjak wrote: > > > > > > > > On Thu, Feb 13, 2025 at 9:31 AM H.J. Lu wrote: > > > > > > > > >

[pushed] c++: add fixed test [PR83144]

2025-02-14 Thread Marek Polacek
Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- Fixed by r12-4425 and it seemed worth adding. PR c++/83144 gcc/testsuite/ChangeLog: * g++.dg/cpp0x/constexpr-83144.C: New test. --- gcc/testsuite/g++.dg/cpp0x/constexpr-83144.C | 21 1 file changed, 21

Re: [PATCH] libstc++: Improve list assumption after constructor [PR118865]

2025-02-14 Thread Jonathan Wakely
On Fri, 14 Feb 2025, 18:34 Andrew Pinski (QUIC), wrote: > > -Original Message- > > From: Jonathan Wakely > > Sent: Friday, February 14, 2025 6:49 AM > > To: Andrew Pinski (QUIC) > > Cc: gcc-patches@gcc.gnu.org; libstd...@gcc.gnu.org > > Subject: Re: [PATCH] libstc++: Improve list assump

Re: [PATCH] c++: fix propagating REF_PARENTHESIZED_P [PR116379]

2025-02-14 Thread Marek Polacek
On Fri, Feb 14, 2025 at 11:04:09PM +0100, Jason Merrill wrote: > On 2/14/25 4:29 PM, Marek Polacek wrote: > > On Fri, Feb 14, 2025 at 09:30:34AM -0500, Patrick Palka wrote: > > > On Thu, 13 Feb 2025, Marek Polacek wrote: > > > > > > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? >

GCN: Set 'UI_TARGET' for 'TARGET_EXCEPT_UNWIND_INFO' [PR94282, PR113331] (was: [gcn] Set 'UI_NONE' for 'TARGET_EXCEPT_UNWIND_INFO' [PR94282] (was: [PATCH] amdgcn: Add stub personality function))

2025-02-14 Thread Thomas Schwinge
Hi! On 2020-04-29T10:35:54+0200, I wrote: > On 2020-04-23T13:05:33+0200, I wrote: >> I suggest we [...] apply what I'd proposed a month ago in >> "[amdgcn] ld: error: undefined symbol: >> __gxx_personality_v0", and now yesterday (coincidentally) posted. > > Now pushed

[r15-7532 Regression] FAIL: g++.dg/asan/pr118763.C -Os execution test on Linux/x86_64

2025-02-14 Thread haochen.jiang
On Linux/x86_64, e96e1bb69c7b46db18e747ee379a62681bc8c82d is the first bad commit commit e96e1bb69c7b46db18e747ee379a62681bc8c82d Author: Jason Merrill Date: Fri Feb 14 10:53:01 2025 +0100 c++: extended temp cleanups [PR118856] caused FAIL: g++.dg/asan/pr118763.C -O0 execution test FA

Re: [PATCH] c++/modules: Don't treat template parameters as TU-local [PR118846]

2025-02-14 Thread Jason Merrill
On 2/12/25 1:07 PM, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? OK. -- >8 -- There are two separate issues making various template parameters behave as if they were TU-local. Firstly, the TU-local detection code uses WILDCARD_TYPE_P to check for t

Re: [PATCH] c++: fix propagating REF_PARENTHESIZED_P [PR116379]

2025-02-14 Thread Jason Merrill
On 2/14/25 4:29 PM, Marek Polacek wrote: On Fri, Feb 14, 2025 at 09:30:34AM -0500, Patrick Palka wrote: On Thu, 13 Feb 2025, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- Here we have: template struct X{ T val; decltype(auto) v

Re: [PATCH] gcc: testsuite: Fix builtin-speculation-overloads[14].C testism

2025-02-14 Thread Jason Merrill
On 2/14/25 11:48 AM, Matthew Malcomson wrote: On 2/14/25 07:56, Jason Merrill wrote: External email: Use caution opening links or attachments On 2/13/25 11:38 AM, Matthew Malcomson wrote: On 2/12/25 23:30, Jason Merrill wrote: Shall I make that change? Please. Jason Much simpler pa

nvptx: Set 'UI_TARGET' for 'TARGET_EXCEPT_UNWIND_INFO' [PR86660] (was: [c++] Don't emit exception tables for UI_NONE)

2025-02-14 Thread Thomas Schwinge
Hi! On 2018-08-03T11:52:36+0200, Jakub Jelinek wrote: > On Fri, Aug 03, 2018 at 11:45:31AM +0200, Tom de Vries wrote: >> If a target does not support exceptions, it can indicate this by returning >> UI_NONE in TARGET_EXCEPT_UNWIND_INFO. Well, not quite... ;-/ >> Currently the compiler still em

[PUSHED] nvptx: Sanity-check 'init_frag' state

2025-02-14 Thread Thomas Schwinge
The 'init_frag' machinery is used by 'nvptx_assemble_integer' (via 'TARGET_ASM_INTEGER'), 'nvptx_output_skip' (via 'ASM_OUTPUT_SKIP'), 'nvptx_output_ascii' (via 'ASM_OUTPUT_ASCII'). But, it's not obvious that these are called only when that machinery is active (and in a consistent state), which it

[PUSHED] nvptx: Clarify 'nvptx_output_skip' case of no or incomplete initializer

2025-02-14 Thread Thomas Schwinge
I was getting confused about 'nvptx_output_skip' in certain cases not doing anything at all; write down and 'assert' what I found. gcc/ * config/nvptx/nvptx.cc (nvptx_output_skip): Clarify case of no or incomplete initializer. --- gcc/config/nvptx/nvptx.cc | 6 ++ 1 fi

[pushed] c++: add fixed test [PR86933]

2025-02-14 Thread Patrick Palka
Fixed by the PR118265 fix r15-7339-g26d3424ca5d9f4. PR c++/86933 gcc/testsuite/ChangeLog: * g++.dg/cpp1z/variadic-nontype1.C: Mention PR number. * g++.dg/cpp1z/variadic-nontype2.C: New test. --- gcc/testsuite/g++.dg/cpp1z/variadic-nontype1.C | 2 ++ gcc/testsuite/g++.dg

[pushed] c++: add fixed test [PR82936]

2025-02-14 Thread Marek Polacek
Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- Fixed by r8-6829-gaaec81f10fa314; before that: Segmentation fault (core dumped) PR c++/82936 gcc/testsuite/ChangeLog: * g++.dg/cpp0x/vt-82936.C: New test. --- gcc/testsuite/g++.dg/cpp0x/vt-82936.C | 18 ++

[pushed] c++: add fixed test [PR82794]

2025-02-14 Thread Marek Polacek
Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- Fixed by r10-3735. PR c++/82794 gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-pr82794.C: New test. --- gcc/testsuite/g++.dg/cpp2a/concepts-pr82794.C | 8 1 file changed, 8 insertions(+) create mode 100644

[pushed] c++: add fixed test [PR70037]

2025-02-14 Thread Marek Polacek
Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- Fixed by r11-735 + r11-2417. PR c++/70037 gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-pr70037.C: New test. --- gcc/testsuite/g++.dg/cpp2a/concepts-pr70037.C | 18 ++ 1 file changed, 18 insertions(+) c

[PATCH] Fortran: passing of derived type to VALUE,OPTIONAL dummy argument [PR118080]

2025-02-14 Thread Harald Anlauf
Dear all, the attached patch fixes inconsistent handling of passing derived type actual arguments to scalar dummies with VALUE,OPTIONAL attribute. As suggested by Tobias, we should consistently pass a hidden boolean flag that indicates the presence or absence of the actual, similar to the case of

[pushed] c++: add fixed test [PR66878]

2025-02-14 Thread Marek Polacek
Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- Fixed by r11-175. PR c++/66878 gcc/testsuite/ChangeLog: * g++.dg/lookup/using71.C: New test. --- gcc/testsuite/g++.dg/lookup/using71.C | 12 1 file changed, 12 insertions(+) create mode 100644 gcc/testsuite/g

Re: [PATCH v2] ira: Add a target hook for callee-saved register cost scale

2025-02-14 Thread Vladimir Makarov
On 2/14/25 12:27 PM, Peter Bergner wrote: On 2/14/25 10:43 AM, Vladimir Makarov wrote: The patch is very well described and it is OK for me to commit it into the trunk. Thank you for working on this issue, Richard. If we have some new failures on targets I believe the hook has enough descrip

Re: [patch,avr] PR118878: Don't ICE on result from paradoxical reg's alloc.

2025-02-14 Thread Denis Chertykov
Georg-Johann Lay writes: > This patch fixes an ICE on trunk, so I don't plan to backport. > > Ok for trunk? Ok. Denis

RE: [PATCH] libstc++: Improve list assumption after constructor [PR118865]

2025-02-14 Thread Andrew Pinski (QUIC)
> -Original Message- > From: Jonathan Wakely > Sent: Friday, February 14, 2025 6:49 AM > To: Andrew Pinski (QUIC) > Cc: gcc-patches@gcc.gnu.org; libstd...@gcc.gnu.org > Subject: Re: [PATCH] libstc++: Improve list assumption after > constructor [PR118865] > > On Fri, 14 Feb 2025 at 03:03,

Re: 7/7 [Fortran, Patch, Coarray, PR107635] Remove deprecated coarray routines

2025-02-14 Thread Jerry D
On 2/13/25 11:48 AM, Jerry D wrote: On 2/10/25 2:25 AM, Andre Vehreschild wrote: [PATCH 7/7] Fortran: Remove deprecated coarray routines [PR107635] I have applied all patches. Regression tested OK here. From patch 5 there was one reject: patching file gcc/testsuite/gfortran.dg/coarray/send

[pushed] c++: add fixed test [PR66519]

2025-02-14 Thread Marek Polacek
Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- Fixed by r10-6464. PR c++/66519 gcc/testsuite/ChangeLog: * g++.dg/cpp0x/variadic-parm2.C: New test. --- gcc/testsuite/g++.dg/cpp0x/variadic-parm2.C | 12 1 file changed, 12 insertions(+) create mode 100644 gc

[patch,avr] PR118878: Don't ICE on result from paradoxical reg's alloc.

2025-02-14 Thread Georg-Johann Lay
This patch fixes an ICE on trunk, so I don't plan to backport. Ok for trunk? Johann -- AVR: target/118878 - Don't ICE on result from paradoxical reg's alloc. After register allocation, paradoxical subregs may become something like r20:SI += r22:SI which doesn't make much sense as assembly c

Re: [PATCH] tree-optimizatio/118852 - wrong code with 502.gcc_r

2025-02-14 Thread Richard Biener
On Fri, 14 Feb 2025, Uros Bizjak wrote: > On Fri, Feb 14, 2025 at 3:10 PM Richard Biener wrote: > > > > 502.gcc_r when built with -fprofile-generate exposes a SLP discovery > > issue where an IV forced live due to early break is not properly > > discovered if its latch def is part of a different

Re: [PATCH v2] ira: Add a target hook for callee-saved register cost scale

2025-02-14 Thread Peter Bergner
On 2/14/25 10:43 AM, Vladimir Makarov wrote: > The patch is very well described and it is OK for me to commit it into the > trunk. Thank you for working on this issue, Richard. > > If we have some new failures on targets I believe the hook has enough > descriptive power to fix the failures. Note

Re: [PATCH] RISC-V: Bugfix ICE for RVV intrinisc when using no-extension parameters

2025-02-14 Thread Palmer Dabbelt
On Thu, 13 Feb 2025 23:12:54 PST (-0800), ji...@linux.alibaba.com wrote: When using riscv_v_abi, the return and arguments of the function should be adequately checked to avoid ICE. PR target/118872 gcc/ChangeLog: * config/riscv/riscv.cc (riscv_fntype_abi): Strengthen the logic

[PATCH] c++: Don't replace INDIRECT_REFs by a const capture proxy too eagerly [PR117504]

2025-02-14 Thread Simon Martin
We have been miscompiling the following valid code since GCC8, and r8-3497-g281e6c1d8f1b4c === cut here === struct span { span (const int (&__first)[1]) : _M_ptr (__first) {} int operator[] (long __i) { return _M_ptr[__i]; } const int *_M_ptr; }; void foo () { constexpr int a_vec[]{1}; a

Re: [PATCH] c++: Add testcase for now fixed issue [PR117324]

2025-02-14 Thread Marek Polacek
On Fri, Feb 14, 2025 at 04:45:01PM +, Simon Martin wrote: > Hi Marek, > > On 14 Feb 2025, at 17:27, Marek Polacek wrote: > > > On Fri, Feb 14, 2025 at 04:20:07PM +, Simon Martin wrote: > >> The case in this PR does not ICE anymore after the fix for PR118319. > >> > >> This patch simply ad

Re: [PATCH] c++: Add testcase for now fixed issue [PR117324]

2025-02-14 Thread Simon Martin
Hi Marek, On 14 Feb 2025, at 17:27, Marek Polacek wrote: > On Fri, Feb 14, 2025 at 04:20:07PM +, Simon Martin wrote: >> The case in this PR does not ICE anymore after the fix for PR118319. >> >> This patch simply adds the case to the testsuite. >> >> Successfully tested on x86_64-apple-darwin

Re: [PATCH v2] ira: Add a target hook for callee-saved register cost scale

2025-02-14 Thread Vladimir Makarov
On 2/13/25 11:08 AM, Richard Sandiford wrote: From 46ad583e65a1c5a27e2203a7571bba6eb0766bc6 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Fri, 7 Feb 2025 15:40:21 + Subject: [PATCH] ira: Add new hooks for callee-save vs spills [PR117477] To: gcc-patches@gcc.gnu.org Following on

[PATCH] [RISC-V] Tune for removal unnecessary sext in builtin overflows [PR108016]

2025-02-14 Thread Alexey Merzlyakov
It fixes one of the PR108016 mis-optimization. The patch adjusts expanding for __builtin_add/sub_overflow() on RV64 targets to avoid unnecessary sext.w instructions. It replaces expanded for ADD/SUB_OVERFLOW code: r141:SI=r139:DI#0+r140:DI#0 .. r143:DI=sign_extend(r141:SI) to the followong kind

Re: [PATCH] c++: Add testcase for now fixed issue [PR117324]

2025-02-14 Thread Marek Polacek
On Fri, Feb 14, 2025 at 04:20:07PM +, Simon Martin wrote: > The case in this PR does not ICE anymore after the fix for PR118319. > > This patch simply adds the case to the testsuite. > > Successfully tested on x86_64-apple-darwin19.6.0. > > PR c++/117324 > > gcc/testsuite/ChangeLog: >

[PATCH] c++: Add testcase for now fixed issue [PR117324]

2025-02-14 Thread Simon Martin
The case in this PR does not ICE anymore after the fix for PR118319. This patch simply adds the case to the testsuite. Successfully tested on x86_64-apple-darwin19.6.0. PR c++/117324 gcc/testsuite/ChangeLog: * g++.dg/parse/defarg19.C: New test. --- gcc/testsuite/g++.dg/parse/

[pushed] c++: extended temp cleanups [PR118856]

2025-02-14 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- A later testcase in PR118856 highlights a preexisting problem with multiple reference-extended temporaries in a single declaration; if initializing a later one throws, the cleanup for the earlier one is not in scope yet. Let's deal with this

[pushed] c++: remove unicode from comment

2025-02-14 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- We had a stray U+2019 right single quotation mark instead of U+0027 apostrophe. gcc/cp/ChangeLog: * init.cc (perform_member_init): Remove unicode from comment. --- gcc/cp/init.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(

[committed] libstdc++: Fix use of make_pair that used ADL

2025-02-14 Thread Jonathan Wakely
_Rb_tree::_M_equal_range calls make_pair unqualified, which means it uses ADL. As the new testcase shows, this can find something other than std::make_pair. Rather than just changing it to use a qualified call, remove the use of make_pair entirely. We don't need to deduce any types here, we know ex

[committed] libstdc++: Fix more unqualified uses of make_pair

2025-02-14 Thread Jonathan Wakely
There are some unqualified calls to make_pair in Parallel Mode. Fix these by just using a qualified call, because it's simpler and I don't care about this code much. libstdc++-v3/ChangeLog: * include/parallel/algobase.h (__mismatch_switch): Qualify calls to make_pair to avoid ADL.

Re: [PATCH] c++: fix propagating REF_PARENTHESIZED_P [PR116379]

2025-02-14 Thread Marek Polacek
On Fri, Feb 14, 2025 at 09:30:34AM -0500, Patrick Palka wrote: > On Thu, 13 Feb 2025, Marek Polacek wrote: > > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > > -- >8 -- > > Here we have: > > > > template > > struct X{ > > T val; > > decltype(auto) value(){ >

Re: [PATCH] tree-optimizatio/118852 - wrong code with 502.gcc_r

2025-02-14 Thread Uros Bizjak
On Fri, Feb 14, 2025 at 3:10 PM Richard Biener wrote: > > 502.gcc_r when built with -fprofile-generate exposes a SLP discovery > issue where an IV forced live due to early break is not properly > discovered if its latch def is part of a different IVs SSA cycle. > To mitigate this we have to make s

Re: [PATCH] libstc++: Improve list assumption after constructor [PR118865]

2025-02-14 Thread Jonathan Wakely
On Fri, 14 Feb 2025 at 03:03, Andrew Pinski wrote: > > The code example here does: > ``` > if (begin == end) __builtin_unreachable(); > std::list nl(begin, end); > > for (auto it = nl.begin(); it != nl.end(); it++) > { > ... > } > /* Remove the first element of the list. */ > nl.erase(nl.begin());

Re: [PATCH] c++: fix propagating REF_PARENTHESIZED_P [PR116379]

2025-02-14 Thread Patrick Palka
On Thu, 13 Feb 2025, Marek Polacek wrote: > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > -- >8 -- > Here we have: > > template > struct X{ > T val; > decltype(auto) value(){ > return (val); > } > }; > > where the return type of value should be

Re: [PATCH] [ifcombine] cope with signbit tests of extended values

2025-02-14 Thread Richard Biener
On Thu, Feb 13, 2025 at 4:23 PM Alexandre Oliva wrote: > > > A compare with zero may be taken as a sign bit test by > fold_truth_andor_for_ifcombine, but the operand may be extended from a > narrower field. If the operand was narrower, the bitsize will reflect > the narrowing conversion, but if i

Re: [PATCH] analyzer: Handle nonnull_if_nonzero attribute [PR117023]

2025-02-14 Thread David Malcolm
On Thu, 2024-11-14 at 11:19 +0100, Jakub Jelinek wrote: > Hi! Hi; sorry for the delay in responding to this. > > On top of the > https://gcc.gnu.org/pipermail/gcc-patches/2024-November/668554.html > patch which introduces the nonnull_if_nonzero attribute (because > C2Y is allowing NULL arguments

[PATCH] tree-optimizatio/118852 - wrong code with 502.gcc_r

2025-02-14 Thread Richard Biener
502.gcc_r when built with -fprofile-generate exposes a SLP discovery issue where an IV forced live due to early break is not properly discovered if its latch def is part of a different IVs SSA cycle. To mitigate this we have to make sure to create an SLP instance for the original IV. Ideally we'd

Re: [PATCH v3] x86: Properly find the maximum stack slot alignment

2025-02-14 Thread Richard Biener
On Fri, 14 Feb 2025, Uros Bizjak wrote: > On Fri, Feb 14, 2025 at 4:56 AM H.J. Lu wrote: > > > > On Thu, Feb 13, 2025 at 5:17 PM Uros Bizjak wrote: > > > > > > On Thu, Feb 13, 2025 at 9:31 AM H.J. Lu wrote: > > > > > > > > Don't assume that stack slots can only be accessed by stack or frame > >

[PATCH] LoongArch: Use normal RTL pattern instead of UNSPEC for {x, }vsr{a, l}ri instructions

2025-02-14 Thread Xi Ruoyao
Allowing (t + (1ul << imm >> 1)) >> imm to be recognized as a rounding shift operation. gcc/ChangeLog: * config/loongarch/lasx.md (UNSPEC_LASX_XVSRARI): Remove. (UNSPEC_LASX_XVSRLRI): Remove. (lasx_xvsrari_): Remove. (lasx_xvsrlri_): Remove. * config/loonga

Re: [PATCH v3] x86: Properly find the maximum stack slot alignment

2025-02-14 Thread Uros Bizjak
On Fri, Feb 14, 2025 at 4:56 AM H.J. Lu wrote: > > On Thu, Feb 13, 2025 at 5:17 PM Uros Bizjak wrote: > > > > On Thu, Feb 13, 2025 at 9:31 AM H.J. Lu wrote: > > > > > > Don't assume that stack slots can only be accessed by stack or frame > > > registers. We first find all registers defined by s

[PATCH 2/2] RISC-V: Implement TARGET_COMPUTE_MULTILIB_OS

2025-02-14 Thread Jin Ma
According to the definition in gcc/config/riscv/t-linux, after obtaining the reused multilib_dir result using TARGET_COMPUTE_MULTILIB, we should set multilib_os_dir to its parent directory. For example, when building GCC with the options "--enable-multilib --with-arch=rv64gc --with-abi=lp64d" and

[PATCH 1/2] Add TARGET_COMPUTE_MULTILIB_OS hook to override multi-lib-os result.

2025-02-14 Thread Jin Ma
Create a new hook to let target could override the multi-lib-os result. The motivation for this change arises from the fact that using TARGET_COMPUTE_MULTILIB to override the original multilib_dir can lead to unexpected behavior with multilib_os_dir. In our build scripts, we establish a connectio

Re: [PATCH v2 2/8] LoongArch: Allow moving TImode vectors

2025-02-14 Thread Xi Ruoyao
On Fri, 2025-02-14 at 15:46 +0800, Lulu Cheng wrote: > Hi, > > If only apply the first and second patches, the code will not compile. > > Otherwise LGTM. Fixed in v3: https://gcc.gnu.org/pipermail/gcc-patches/2025-February/675776.html -- Xi Ruoyao School of Aerospace Science and Technology,

[PATCH v3 5/8] LoongArch: Simplify {lsx_,lasx_x}vmaddw description

2025-02-14 Thread Xi Ruoyao
Like what we've done for {lsx_,lasx_x}v{add,sub,mul}l{ev,od}, use special predicates and TImode RTL instead of hard-coded const vectors and UNSPECs. Also reorder two operands of the outer plus in the template, so combine will recognize {x,}vadd + {x,}vmulw{ev,od} => {x,}vmaddw{ev,od}. gcc/ChangeL

[PATCH v3 4/8] LoongArch: Simplify {lsx_, lasx_x}vh{add, sub}w description

2025-02-14 Thread Xi Ruoyao
Like what we've done for {lsx_,lasx_x}v{add,sub,mul}l{ev,od}, use special predicates and TImode RTL instead of hard-coded const vectors and UNSPECs. gcc/ChangeLog: * config/loongarch/lasx.md (UNSPEC_LASX_XVHADDW_Q_D): Remove. (UNSPEC_LASX_XVHSUBW_Q_D): Remove. (UNSPEC_LASX

[PATCH v3 6/8] LoongArch: Simplify lsx_vpick description

2025-02-14 Thread Xi Ruoyao
Like what we've done for {lsx_,lasx_x}v{add,sub,mul}l{ev,od}, use special predicates instead of hard-coded const vectors. This is not suitable for LASX where lasx_xvpick has a different semantic. gcc/ChangeLog: * config/loongarch/simd.md (LVEC): New define_mode_attr. (simdfmt_as_

[PATCH v3 8/8] LoongArch: Implement [su]dot_prod* for LSX and LASX modes

2025-02-14 Thread Xi Ruoyao
Despite it's just a special case of "a widening product of which the result used for reduction," having these standard names allows to recognize the dot product pattern earlier and it may be beneficial to optimization. Also fix some test failures with the test cases: - gcc.dg/vect/vect-reduc-chai

[PATCH v3 7/8] LoongArch: Implement vec_widen_mult_{even, odd}_* for LSX and LASX modes

2025-02-14 Thread Xi Ruoyao
Since PR116142 has been fixed, now we can add the standard names so the compiler will generate better code if the result of a widening production is reduced. gcc/ChangeLog: * config/loongarch/simd.md (even_odd): New define_int_attr. (vec_widen_mult__): New define_expand. gcc/test

[PATCH v3 1/8] LoongArch: Try harder using vrepli instructions to materialize const vectors

2025-02-14 Thread Xi Ruoyao
For a = (v4si){0x, 0x, 0x, 0x} we just want vrepli.b $vr0, 0xdd but the compiler actually produces a load: la.local $r14,.LC0 vld $vr0,$r14,0 It's because we only tried vrepli.d which wouldn't work. Try all vrepli instructions for const int vector

[PATCH v3 2/8] LoongArch: Allow moving TImode vectors

2025-02-14 Thread Xi Ruoyao
We have some vector instructions for operations on 128-bit integer, i.e. TImode, vectors. Previously they had been modeled with unspecs, but it's more natural to just model them with TImode vector RTL expressions. For the preparation, allow moving V1TImode and V2TImode vectors in LSX and LASX reg

[PATCH v3 3/8] LoongArch: Simplify {lsx_, lasx_x}v{add, sub, mul}l{ev, od} description

2025-02-14 Thread Xi Ruoyao
These pattern definitions are tediously long, invoking 32 UNSPECs and many hard-coded long const vectors. To simplify them, at first we use the TImode vector operations instead of the UNSPECs, then we adopt an approach in AArch64: using a special predicate to match the const vectors for odd/even i

[PATCH v3 0/8] LoongArch: SIMD odd/even/horizontal widening arithmetic cleanup and optimization

2025-02-14 Thread Xi Ruoyao
This series is intended to fix some test failures on vect-reduc-chain-*.c by adding the [su]dot_prod* expand for LSX and LASX vector modes. But the code base of the related instructions was not readable, so clean it up first (using the approach learnt from AArch64) before adding the expands. v2 =

RE: [PATCH v1] RISC-V: Make VXRM as global register [PR118103]

2025-02-14 Thread Li, Pan2
Thanks Jeff and Richard S. Not sure if I followed up the discussion correct, but this patch only try to fix the vxrm insn deleted during late-combine (same scenario as frm) by adding it to global_regs. If global_regs is not the right place according to the sematic of vxrm, we may need other fix

[PATCH] RISC-V: Fix some dynamic LMUL costing.

2025-02-14 Thread Robin Dapp
Hi, with all-SLP we sometimes annotate statements slightly differently. This patch uses STMT_VINFO_RELEVANT_P in order to walk through potential program points when doing dynamic LMUL costing. Also it makes the LMUL estimate always use the same path. This helps fix a number of test cases that r

[PATCH] RISC-V: Fix some widen-complicate tests.

2025-02-14 Thread Robin Dapp
Hi, this patch adds two bridge patterns for combine in order to fix the widen-complicate tests that regressed since GCC 14. They key is to allow combination with a ephemeral binary-operation insn that widens its first operand. This can subsequently be combined two a double-widening insn. If the

[PATCH] RISC-V: testsuite: Fix reduc-[89].c again.

2025-02-14 Thread Robin Dapp
Hi, my last fix wasn't sufficient. This patch just scans for the scalar insns now. Going to commit as obvious if the CI is happy. Regards Robin gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/reduc/reduc-8.c: Scan for add. * gcc.target/riscv/rvv/autovec/reduc/reduc-9

[PATCH] RISC-V: testsuite: Adjust pr117722.c scan.

2025-02-14 Thread Robin Dapp
Hi, the test scanned for vmin and vmax instead of vminu and vmaxu. This patch fixes that. Will commit as obvious once the CI is OK with it. Regards Robin gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/pr117722.c: Scan for vminu and vmaxu. --- gcc/testsuite/gcc.targe

Re: [PATCH] config: Fix -rdynamic detection for libcc1 usage

2025-02-14 Thread Александр Зинов
Please, take a look at this patch. https://gcc.gnu.org/pipermail/gcc-patches/2025-January/674641.html Ping: David Seifert, Joseph Myers Trying to compile libcc1 plugin in native RISC-V GCC build on X86 > I bumped into the problem that gcc_cv_objdump variable > was not defined in libcc1/configure,

Re: [PATCH] gcc: testsuite: Fix builtin-speculation-overloads[14].C testism

2025-02-14 Thread Matthew Malcomson
On 2/14/25 07:56, Jason Merrill wrote: External email: Use caution opening links or attachments On 2/13/25 11:38 AM, Matthew Malcomson wrote: On 2/12/25 23:30, Jason Merrill wrote: Shall I make that change? Please. Jason Much simpler patch attached ;-) Ok for trunk?From 34bc44d3e49

Re: [PATCH] tree: Fix up the DECL_VALUE_EXPR GC marking [PR118790]

2025-02-14 Thread Richard Biener
On Fri, 14 Feb 2025, Jakub Jelinek wrote: > On Thu, Feb 13, 2025 at 05:21:56PM +0100, Jakub Jelinek wrote: > > The ggc_set_mark call in gt_value_expr_mark_2 is actually wrong, that > > just marks the VAR_DECL itself, but doesn't mark the subtrees of it (type > > etc.). So, I think we need to test

Re: [PATCH v2] wwwdocs: add a Python postprocessing script

2025-02-14 Thread Jonathan Wakely
On Fri, 14 Feb 2025 at 07:22, Gerald Pfeifer wrote: > > On Fri, 24 Jan 2025, David Malcolm wrote: > > The attached patch adds a postprocessing step to "bin" that > > turns e.g. > > TEXT > > to: > > TEXT > > It looks like this is causing an issue for (at least) one of our pages. > > http://gcc.

Re: [wwwdocs] gcc-15/changes.html: Update AMD GPU (GCN) section for new gfx*

2025-02-14 Thread Andrew Stubbs
On 14/02/2025 09:02, Tobias Burnus wrote: Update https://gcc.gnu.org/gcc-15/changes.html#amdgcn for the newly added generic support and the GPUs compatible with the generic devices. OK? To have clickable links: In the patch, both https://gcc.gnu.org/ onlinedocs/gcc/AMD-GCN-Options.html and ht

[PATCH] c-family, tree: Allow nonstring attribute on multidimensional arrays [PR117178]

2025-02-14 Thread Jakub Jelinek
Hi! As requested in the PR117178 thread, the following patch allows nonstring attribute also on multi-dimensional arrays (with cv char/signed char/unsigned char as innermost element type) and pointers to such multi-dimensional arrays or pointers to single-dimensional cv char/signed char/unsigned c

Re: [PATCH] c, v2: do not warn about truncating NUL char when initializing nonstring arrays [PR117178]

2025-02-14 Thread Jakub Jelinek
On Thu, Feb 13, 2025 at 02:10:25PM +0100, Jakub Jelinek wrote: > Kees, are you submitting this under assignment to FSF (maybe the Google one > if it has one) or DCO? See https://gcc.gnu.org/contribute.html#legal > for details. If DCO, can you add your Signed-off-by: tag for it? > > So far lightl

Re: [PATCH] tree: Fix up the DECL_VALUE_EXPR GC marking [PR118790]

2025-02-14 Thread Jakub Jelinek
On Thu, Feb 13, 2025 at 05:21:56PM +0100, Jakub Jelinek wrote: > The ggc_set_mark call in gt_value_expr_mark_2 is actually wrong, that > just marks the VAR_DECL itself, but doesn't mark the subtrees of it (type > etc.). So, I think we need to test gcc_marked_p for whether it is marked > or not, if

Re: [PATCH v2] ira: Add a target hook for callee-saved register cost scale

2025-02-14 Thread Jan Hubicka
> As described below, the patch also shows no change to AArch64 SPEC2017 > scores. I'm afraid I'll need help from x86 folks to do performance > testing there. I will look into this over weekend. I can write x86 version of the hooks. Though in earlier email you mentioned you hacked up something, s

[wwwdocs] gcc-15/changes.html: Update AMD GPU (GCN) section for new gfx*

2025-02-14 Thread Tobias Burnus
Update https://gcc.gnu.org/gcc-15/changes.html#amdgcn for the newly added generic support and the GPUs compatible with the generic devices. OK? To have clickable links: In the patch, both https://gcc.gnu.org/onlinedocs/gcc/AMD-GCN-Options.html and https://gcc.gnu.org/install/specific.html#amd