RE: [PATCH v2] Vect: Support truncate after .SAT_SUB pattern in zip

2024-06-27 Thread Li, Pan2
tmp_80 = ivtmp_79 - _81; riscv64-unknown-elf-gcc (GCC) 15.0.0 20240627 (experimental) Copyright (C) 2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Pan -Or

[PATCH 2/3 v2] RISC-V: Add Zvfbfmin and Zvfbfwma intrinsic

2024-06-27 Thread Feng Wang
v2: Rebase. Accroding to the intrinsic doc, the 'Zvfbfmin' and 'Zvfbfwma' intrinsic functions are added by this patch. gcc/ChangeLog: * config/riscv/riscv-vector-builtins-bases.cc (class vfncvtbf16_f): Add 'Zvfbfmin' intrinsic in bases. (class vfwcvtbf16_f): Ditto.

[PATCH 3/3 v2] RISC-V: Add md files for vector BFloat16

2024-06-27 Thread Feng Wang
v2:Rebase. Accroding to the BFloat16 spec, some vector iterators and new pattern are added in md files. gcc/ChangeLog: * config/riscv/riscv.md: Add new insn name for vector BFloat16. * config/riscv/vector-iterators.md: Add some iterators for vector BFloat16. * config/risc

[PATCH 1/3 v2] RISC-V: Add vector type of BFloat16 format

2024-06-27 Thread Feng Wang
v2: Rebase. The vector type of BFloat16 format is added in this patch, subsequent extensions to zvfbfmin and zvfwma need to be based on this patch. gcc/ChangeLog: * config/riscv/genrvv-type-indexer.cc (bfloat16_type): Generate bf16 vector_type and scalar_type in DEF_RVV_TYPE_I

[PATCH] i386: Fix regression after refactoring legitimize_pe_coff_symbol, ix86_GOT_alias_set and PE_COFF_LEGITIMIZE_EXTERN_DECL

2024-06-27 Thread Evgeny Karpov
Thank you for reporting the issues and discussing the root causes. It helped in preparing the patch. This patch fixes 3 bugs reported after merging the "Add DLL import/export implementation to AArch64" series. https://gcc.gnu.org/pipermail/gcc-patches/2024-June/653955.html The series refactors th

Re: [PATCH v1] Match: Support more forms for the scalar unsigned .SAT_SUB

2024-06-27 Thread Andrew Pinski
On Wed, Jun 19, 2024 at 12:37 AM Li, Pan2 wrote: > > Hi Richard, > > Given almost all unsigned SAT_ADD/SAT_SUB patches are merged, I revisit the > original code pattern aka zip benchmark. > It may look like below: > > void test (uint16_t *x, uint16_t *y, unsigned wsize, unsigned count) > { > un

[PATCH][GCC 14] aarch64: Add support for -mcpu=grace

2024-06-27 Thread Kyrylo Tkachov
Hi all, This is the GCC 14 version of the patch. It’s the same as the trunk one, but aarch64-tune.md regeneration looks different. Pushing to the branch. Thanks, Kyrill grace-14.patch Description: grace-14.patch

Re: [PATCH] Hard register asm constraint

2024-06-27 Thread Georg-Johann Lay
Am 24.05.24 um 11:13 Am 25.06.24 um 16:03 schrieb Paul Koning: On Jun 24, 2024, at 1:50 AM, Stefan Schulze Frielinghaus wrote: Ping. On Mon, Jun 10, 2024 at 07:19:19AM +0200, Stefan Schulze Frielinghaus wrote: Ping. On Fri, May 24, 2024 at 11:13:12AM +0200, Stefan Schulze Frielinghaus

Re: [PATCH] i386: Refactor vcvttps2qq/vcvtqq2ps patterns.

2024-06-27 Thread Hongtao Liu
On Thu, Jun 27, 2024 at 9:23 AM Hu, Lin1 wrote: > > Hi, all > > This patch aims to refactor vcvttps2qq/vcvtqq2ps patterns for remove redundant > round_*_modev8sf_condition. > > Bootstrapped and regtested on x86-64-linux-gnu, OK for trunk? Ok. > > BRs, > Lin > > gcc/ChangeLog: > > * config/

RE: [PATCH v1] Match: Support more forms for the scalar unsigned .SAT_SUB

2024-06-27 Thread Li, Pan2
Yes, you are right. The supported forms for now don't involve any widening ops. Thus, below uint64_t form is failed to detect, will add it to my backlog. uint32_t saturation_add(uint32_t a, uint32_t b) { const uint64_t tmp = (uint64_t)a + b; if (tmp > UINT32_MAX) { return UINT3

Re: [PATCH v2] MIPS: Output $0 for conditional trap if !ISA_HAS_COND_TRAPI

2024-06-27 Thread YunQiang Su
Maciej W. Rozycki 于2024年6月27日周四 00:07写道: > > On Thu, 20 Jun 2024, YunQiang Su wrote: > > > MIPSr6 removes condition trap instructions with imm, so the instruction > > like `teq $2,imm` will be converted to > > li $at, imm > > teq $2, $at > > > > The current version of Gas cannot detect if imm

[PATCH][GCC 14] aarch64: Add support for -mcpu=grace

2024-06-27 Thread Kyrylo Tkachov
Hi all, This is the GCC 13 version of the patch. Pushing to the branch. Thanks, Kyrill grace-13.patch Description: grace-13.patch

[PATCH 3/7] [x86] Match IEEE min/max with UNSPEC_IEEE_{MIN,MAX}.

2024-06-27 Thread liuhongt
These versions of the min/max patterns implement exactly the operations min = (op1 < op2 ? op1 : op2) max = (!(op1 < op2) ? op1 : op2) gcc/ChangeLog: PR target/115517 * config/i386/sse.md (*minmax3_1): New pre_reload define_insn_and_split. (*minmax3_2): Ditto.

[PATCH 0/7][x86] Remove vcond{,u,eq} expanders.

2024-06-27 Thread liuhongt
There're several regressions after obsolete vcond{,u,eq}, Some regressions are due to the direct optimizations in ix86_expand_{fp,int}_vcond..i.e ix86_expand_sse_fp_minmax. Some regrssions are due to optimizations relies on canonicalization in ix86_expand_{fp,int}_vcond. This series add define_spl

[PATCH 1/7] [x86] Add more splitters to match (unspec [op1 op2 (gt op3 constm1_operand)] UNSPEC_BLENDV)

2024-06-27 Thread liuhongt
These define_insn_and_split are needed after vcond{,u,eq} is obsolete. gcc/ChangeLog: PR target/115517 * config/i386/sse.md (*_blendv_gt): New define_insn_and_split. (*_blendv_gtint): Ditto. (*_blendv_not_gtint): Ditto. (*_pb

[PATCH 6/7] [x86] Optimize a < 0 ? -1 : 0 to (signed)a >> 31.

2024-06-27 Thread liuhongt
Try to optimize x < 0 ? -1 : 0 into (signed) x >> 31 and x < 0 ? 1 : 0 into (unsigned) x >> 31. Add define_insn_and_split for the optimization did in ix86_expand_int_vcond. gcc/ChangeLog: PR target/115517 * config/i386/sse.md ("*ashr3_1"): New define_insn_and_split.

[PATCH][GCC 12] aarch64: Add support for -mcpu=grace

2024-06-27 Thread Kyrylo Tkachov
Hi all, This is the GCC 12 version of the patch, still using the AARCH64_FL_* syntax for option extensions. Pushing to the branch. Thanks, Kyrill grace-12.patch Description: grace-12.patch

[PATCH 4/7] Add more splitter for mskmov with avx512 comparison.

2024-06-27 Thread liuhongt
gcc/ChangeLog: PR target/115517 * config/i386/sse.md (*_movmsk_lt_avx512): New define_insn_and_split. (*_movmsk_ext_lt_avx512): Ditto. (*_pmovmskb_lt_avx512): Ditto. (*_pmovmskb_zext_lt_avx512): Ditto. (*sse2_pmovmskb_ext_lt_a

[PATCH 2/7] Lower AVX512 kmask comparison back to AVX2 comparison when op_{true, false} is vector -1/0.

2024-06-27 Thread liuhongt
gcc/ChangeLog PR target/115517 * config/i386/sse.md (*_cvtmask2_not): New pre_reload splitter. (*_cvtmask2_not): Ditto. (*avx2_pcmp3_6): Ditto. (*avx2_pcmp3_7): Ditto. --- gcc/config/i386/sse.md | 97 ++

[PATCH 5/7] Adjust testcase for the regressed testcases after obsolete of vcond{, u, eq}.

2024-06-27 Thread liuhongt
> Richard suggests that we implement the "obvious" transforms like > inversion in the middle-end but if for example unsigned compares > are not supported the us_minus + eq + negative trick isn't on > that list. > > The main reason to restrict vec_cmp would be to avoid > a <= b ? c : d going with an

Re: [PATCH][GCC 14] aarch64: Add support for -mcpu=grace

2024-06-27 Thread Kyrylo Tkachov
The subject line should, of course, say [GCC 13] rather than [GCC 14] > On 27 Jun 2024, at 10:21, Kyrylo Tkachov wrote: > > External email: Use caution opening links or attachments > > > Hi all, > > This is the GCC 13 version of the patch. > Pushing to the branch. > Thanks, > Kyrill > >

[PATCH 7/7] Remove vcond{, u, eq} expanders since they will be obsolete.

2024-06-27 Thread liuhongt
gcc/ChangeLog: PR target/115517 * config/i386/mmx.md (vcondv2sf): Removed. (vcond): Ditto. (vcond): Ditto. (vcondu): Ditto. (vcondu): Ditto. * config/i386/sse.md (vcond): Ditto. (vcond): Ditto. (vcond): Ditto. (vcond):

[x86 SSE PATCH] Some additional ternlog refinements.

2024-06-27 Thread Roger Sayle
This patch is another round of refinements to fine tune the new ternlog infrastructure in i386's sse.md. This patch tweaks ix86_ternlog_idx to allow multiple MEM/CONST_VECTOR/VEC_DUPLICATE operands prior to splitting (before reload), when force_register is called on all but one of these operands.

[PATCH][GCC 11] aarch64: Add support for -mcpu=grace

2024-06-27 Thread Kyrylo Tkachov
Hi all, This is the GCC 11 (and last) version of the patch. Pushing to the branch. Thanks, Kyrill grace-11.patch Description: grace-11.patch

Re: [PATCH] i386: Fix regression after refactoring legitimize_pe_coff_symbol, ix86_GOT_alias_set and PE_COFF_LEGITIMIZE_EXTERN_DECL

2024-06-27 Thread Uros Bizjak
On Thu, Jun 27, 2024 at 9:16 AM Evgeny Karpov wrote: > > Thank you for reporting the issues and discussing the root causes. > It helped in preparing the patch. > > This patch fixes 3 bugs reported after merging > the "Add DLL import/export implementation to AArch64" series. > https://gcc.gnu.org/p

[PATCH 2/2] libstdc++: Add debug assertions to std::vector [PR103191]

2024-06-27 Thread Jonathan Wakely
The previous commit allows these to work for constexpr too, which is nice. Tested x86_64-linux. Pushed to trunk. -- >8 -- This adds debug assertions for std::vector element access. libstdc++-v3/ChangeLog: PR libstdc++/103191 * include/bits/stl_bvector.h (vector::operator[])

[PATCH 1/2] libstdc++: Enable more debug assertions during constant evaluation [PR111250]

2024-06-27 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. Worth backporting, I think, but I'll wait a bit. -- >8 -- Some of our debug assertions expand to nothing unless _GLIBCXX_ASSERTIONS is defined, which means they are not checked during constant evaluation. By making them unconditionally expand to a __glibcxx_

Re: [PATCH] Hard register asm constraint

2024-06-27 Thread Stefan Schulze Frielinghaus
On Thu, Jun 27, 2024 at 09:45:32AM +0200, Georg-Johann Lay wrote: > > > Am 24.05.24 um 11:13 Am 25.06.24 um 16:03 schrieb Paul Koning: > > > > > > > On Jun 24, 2024, at 1:50 AM, Stefan Schulze Frielinghaus > > > wrote: > > > > > > Ping. > > > > > > On Mon, Jun 10, 2024 at 07:19:19AM +0200,

[committed] libstdc++: Fix std::format for chrono::duration with unsigned rep [PR115668]

2024-06-27 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. Backports needed to 13 and 14. -- >8 -- Using std::chrono::abs is only valid if numeric_limits::is_signed is true, so using it unconditionally made it ill-formed to format a duration with an unsigned rep. The duration formatter might as negate the duration i

[COMMITTED 6/7] ada: Reject ambiguous function calls in interpolated string expressions

2024-06-27 Thread Marc Poulhiès
From: Javier Miranda gcc/ada/ * sem_ch2.adb (Analyze_Interpolated_String_Literal): Report interpretations of ambiguous parameterless function calls. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch2.adb | 80 -

[COMMITTED 2/7] ada: Overridden operation field not correctly set for controlling result wrappers

2024-06-27 Thread Marc Poulhiès
From: Martin Clochard Implicit wrapper overridings generated for functions with controlling result when deriving with null extension may have field Overridden_Operation incorrectly set, when making several such derivations in succession. This happens because overridings were assumed to come from

[COMMITTED 3/7] ada: Bug using user defined string literals with interpolated strings

2024-06-27 Thread Marc Poulhiès
From: Javier Miranda The frontend rejects the use of user defined string literals using interpolated strings. gcc/ada/ * sem_res.adb (Has_Applicable_User_Defined_Literal): Add missing support for interpolated strings. Tested on x86_64-pc-linux-gnu, committed on master. --- gc

[COMMITTED 7/7] ada: Remove last uses of System.Address_Operations in runtime library

2024-06-27 Thread Marc Poulhiès
From: Eric Botcazou This completes the switch from using System.Address_Operations to using only System.Storage_Elements in the runtime library. The remaining uses were for simple optimizations that can be done by the optimizer alone. gcc/ada/ * libgnat/s-carsi8.adb: Remove clauses for

[COMMITTED 4/7] ada: Fix array-manipulating code in Mdll

2024-06-27 Thread Marc Poulhiès
From: Ronan Desplanques This patch fixes a duo of array assigments in Mdll that were bound to fail. gcc/ada/ * mdll.adb (Build_Non_Reloc_DLL): Fix incorrect assignment to array object. (Ada_Build_Non_Reloc_DLL): Likewise. Tested on x86_64-pc-linux-gnu, committed on mast

[COMMITTED 5/7] ada: Add missing dimension information for target names

2024-06-27 Thread Marc Poulhiès
From: Eric Botcazou It is computed from the Etype of N_Target_Name nodes. gcc/ada/ * sem_ch5.adb (Analyze_Target_Name): Call Analyze_Dimension on the node once the Etype is set. * sem_dim.adb (OK_For_Dimension): Set to True for N_Target_Name. (Analyze_Dimension):

[COMMITTED 1/7] ada: Implement first half of Generalized Finalization

2024-06-27 Thread Marc Poulhiès
From: Eric Botcazou This implements the first half of the Generalized Finalization proposal, namely the Finalizable aspect as well as its optional relaxed semantics for the finalization operations, but the latter part is only implemented for dynamically allocated objects. In accordance with the

[PATCH 1/2] libstdc++: Simplify class templates

2024-06-27 Thread Jonathan Wakely
I'm planning to push this, although arguably the first change isn't worth doing if we can't use it everywhere. If we need to keep the old code for EDG, maybe we should just keep using that? The new version probably compiles faster though. Removing the dependency on std::aligned_storage and adding

[PATCH] aarch64: Remove RNG and MTE from -mcpu=neoverse-v2

2024-06-27 Thread Kyrylo Tkachov
Hi all, According to the TRM for Neoverse V2 the Memory Tagging and RNG features are optional configurations of the core and may not always be present. Therefore -mcpu=neoverse-v2 shouldn't enable them, similar to how the crypto extensions aren’t enabled by default. Bootstrapped and tested on aa

[PATCH 2/2] libstdc++: Do not use C++11 alignof in C++98 mode [PR104395]

2024-06-27 Thread Jonathan Wakely
As I commented in the PR, I think it would be nice if the compiler accepted C++11 alignof in C++98 mode when -faligned-new is used. But even if G++ added that, we'd need Clang to use it, and then wait a few releases for that new Clang support to be in widespread use. So let's just disable the exte

Re: [PATCH v2] Vect: Support truncate after .SAT_SUB pattern in zip

2024-06-27 Thread Uros Bizjak
EN_STORE (vectp_out.12_75, 32B, { -1, ... }, _81, 0, > vect_patt_49.11_73); > vectp_op_1.7_69 = vectp_op_1.7_68 + ivtmp_67; > vectp_out.12_76 = vectp_out.12_75 + ivtmp_74; > ivtmp_80 = ivtmp_79 - _81; > > riscv64-unknown-elf-gcc (GCC) 15.0.0 20240627 (experimental) >

Re: [PATCH] i386: Fix regression after refactoring legitimize_pe_coff_symbol, ix86_GOT_alias_set and PE_COFF_LEGITIMIZE_EXTERN_DECL

2024-06-27 Thread Christophe Lyon
Hi Evgeny, Minor comments: - the patch title should end with [PRn, ...] (choose the most relevant bug number) - ChangeLog should mention every bug with PR component/n so that the bugzilla hooks will notice the commit. See https://gcc.gnu.org/contribute.html#patches (but I can do it for yo

Re: [PATCH] i386: Fix regression after refactoring legitimize_pe_coff_symbol, ix86_GOT_alias_set and PE_COFF_LEGITIMIZE_EXTERN_DECL

2024-06-27 Thread unlvsur unlvsur
Can this process be a little bit simpler in the future? Get Outlook for Android From: Christophe Lyon Sent: Thursday, June 27, 2024 5:30:47 AM To: Evgeny Karpov Cc: gcc-patches@gcc.gnu.org ; ubiz...@gmail.com ; richard.sandif...@arm.com ;

Re: [PATCH v3] [testsuite] [arm] [vect] adjust mve-vshr test [PR113281]

2024-06-27 Thread Alexandre Oliva
On Jun 26, 2024, Richard Sandiford wrote: > Alexandre Oliva writes: >> On Jun 25, 2024, Richard Sandiford wrote: >> Richard (Sandiford), do you happen to recall why the IRC conversation mentioned in the PR trail decided to drop it entirely, even for signed types? >> >>> In the

[PATCH 1/2] tree-optimization/115669 - fix SLP reduction association

2024-06-27 Thread Richard Biener
The following avoids associating a reduction path as that might get STMT_VINFO_REDUC_IDX out-of-sync with the SLP operand order. This is a latent issue with SLP reductions but now easily exposed as we're doing single-lane SLP reductions. When we achieved SLP only we can move and update this meta-d

[PATCH 2/2] Harden SLP reduction support wrt STMT_VINFO_REDUC_IDX

2024-06-27 Thread Richard Biener
The following makes sure that for a SLP reductions all lanes have the same STMT_VINFO_REDUC_IDX. Once we move that info and can adjust it we can implement swapping. It also makes the existing protection against operand swapping trigger for all stmts participating in a reduction, not just the fina

Re: [PATCH 0/7][x86] Remove vcond{,u,eq} expanders.

2024-06-27 Thread Richard Biener
On Thu, Jun 27, 2024 at 10:27 AM liuhongt wrote: > > There're several regressions after obsolete vcond{,u,eq}, > Some regressions are due to the direct optimizations in > ix86_expand_{fp,int}_vcond..i.e ix86_expand_sse_fp_minmax. > Some regrssions are due to optimizations relies on canonicalizatio

Re: [PATCH 2/7] Lower AVX512 kmask comparison back to AVX2 comparison when op_{true, false} is vector -1/0.

2024-06-27 Thread Richard Biener
On Thu, Jun 27, 2024 at 10:30 AM liuhongt wrote: > > gcc/ChangeLog In PR115659 Kewen notes that ISEL (and possibly folding) could do a better job with these. In addition to the mentioned issues we can also try whether the target can handle an alternate mask mode. So instead of gating with

Re: [PATCH 5/7] Adjust testcase for the regressed testcases after obsolete of vcond{, u, eq}.

2024-06-27 Thread Richard Biener
On Thu, Jun 27, 2024 at 10:30 AM liuhongt wrote: > > > Richard suggests that we implement the "obvious" transforms like > > inversion in the middle-end but if for example unsigned compares > > are not supported the us_minus + eq + negative trick isn't on > > that list. > > > > The main reason to r

Re: [PATCH] i386: Fix regression after refactoring legitimize_pe_coff_symbol, ix86_GOT_alias_set and PE_COFF_LEGITIMIZE_EXTERN_DECL

2024-06-27 Thread Richard Biener
On Thu, Jun 27, 2024 at 10:40 AM Uros Bizjak wrote: > > On Thu, Jun 27, 2024 at 9:16 AM Evgeny Karpov > wrote: > > > > Thank you for reporting the issues and discussing the root causes. > > It helped in preparing the patch. > > > > This patch fixes 3 bugs reported after merging > > the "Add DLL i

Re: [PATCH] i386: Fix regression after refactoring legitimize_pe_coff_symbol, ix86_GOT_alias_set and PE_COFF_LEGITIMIZE_EXTERN_DECL

2024-06-27 Thread Sam James
Evgeny Karpov writes: > Thank you for reporting the issues and discussing the root causes. > It helped in preparing the patch. Thanks. I'll test it shortly but it looks equivalent to my local changes, so LGTM. > > This patch fixes 3 bugs reported after merging > the "Add DLL import/export impl

[PATCH] i386: Fix regression after refactoring legitimize_pe_coff_symbol, ix86_GOT_alias_set and PE_COFF_LEGITIMIZE_EXTERN_DECL

2024-06-27 Thread Evgeny Karpov
Thursday, June 27, 2024 10:39 AM Uros Bizjak wrote: > > diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc > > index 5dfa7d49f58..20adb42e17b 100644 > > --- a/gcc/config/i386/i386-expand.cc > > +++ b/gcc/config/i386/i386-expand.cc > > @@ -414,6 +414,10 @@ ix86_expand_mov

[PATCH 1/3] libstdc++: Use RAII in

2024-06-27 Thread Jonathan Wakely
This refactoring to use RAII doesn't seem to make any difference in benchmarks, although the generated code for some std::vector operations seems to be slightly larger. Maybe it will be faster (or slower) in some cases I didn't test? I think I like the change anyway - any other opinions on whether

[PATCH 2/3] libstdc++: Optimize __uninitialized_default using memset

2024-06-27 Thread Jonathan Wakely
For trivial types std::__uninitialized_default (which is used by std::uninitialized_value_construct) value-initializes the first element then copies that to the rest of the range using std::fill. Tamar is working on improved vectorization for std::fill, but for this value-initialized case where we

[PATCH 3/3] libstdc++: Use std::__uninitialized_default for ranges::uninitialized_value_construct

2024-06-27 Thread Jonathan Wakely
By generalizing std::__uninitialized_default to work with non-common ranges (i.e. iterator/sentinel pair) we can reuse it for the ranges::uninitialized_value_construct function. Doing that ensures that whatever optimizations we have for std::uninitialized_value_construct are automatically used for

[PATCH] i386: Fix regression after refactoring legitimize_pe_coff_symbol, ix86_GOT_alias_set and PE_COFF_LEGITIMIZE_EXTERN_DECL

2024-06-27 Thread Evgeny Karpov
Thursday, June 27, 2024 11:31 AM Christophe Lyon wrote: > > Hi Evgeny, > > Minor comments: > - the patch title should end with [PRn, ...] (choose the most > relevant bug number) > - ChangeLog should mention every bug with PR component/n > so that the bugzilla hooks will notice the commit.

Re: [gcc r15-1619] ira: Scale save/restore costs of callee save registers with block frequency

2024-06-27 Thread Andreas Schwab
This breaks s390. ../../../../../gcc/libstdc++-v3/src/c++17/floating_to_chars.cc: In function ‘std::to_chars_result std::__floating_to_chars_shortest(char*, char*, T, chars_format) [with T = long double]’: ../../../../../gcc/libstdc++-v3/src/c++17/floating_to_chars.cc:1306:3: internal compiler

[PATCH v3] c: Error message for incorrect use of static in array declarations

2024-06-27 Thread Uecker, Martin
Next version with the improved location. I assume the [PATCH] should become part of the commit message. Bootstrapped and regression tested on x86_64. c: Error message for incorrect use of static in array declarations. Add an explicit error messages when c99's static is used wi

[committed v2] libstdc++: Fix std::codecvt for empty dest [PR37475]

2024-06-27 Thread Jonathan Wakely
Here's what I've pushed, with a typo fixed as spotted by Kristian in the PR comments. Tested x86_64-linux. Pushed to trunk. -- >8 -- For the GNU locale model, codecvt::do_out and codecvt::do_in incorrectly return 'ok' when the destination range is empty. That happens because detecting incomplete

Re: [PATCH 2/3] libstdc++: Optimize __uninitialized_default using memset

2024-06-27 Thread Jonathan Wakely
On Thu, 27 Jun 2024 at 11:53, Jonathan Wakely wrote: > > For trivial types std::__uninitialized_default (which is used by > std::uninitialized_value_construct) value-initializes the first element > then copies that to the rest of the range using std::fill. > > Tamar is working on improved vectoriz

Re: [PATCH 2/2] Harden SLP reduction support wrt STMT_VINFO_REDUC_IDX

2024-06-27 Thread Richard Biener
On Thu, 27 Jun 2024, Richard Biener wrote: > The following makes sure that for a SLP reductions all lanes have > the same STMT_VINFO_REDUC_IDX. Once we move that info and can adjust > it we can implement swapping. It also makes the existing protection > against operand swapping trigger for all s

[PATCH 2/3] libstdc++: Optimize __uninitialized_default using memset

2024-06-27 Thread Maciej Cencora
Hi, not sure whether I've missed some conditional that would exclude this case, but your change seems to incorrectly handle trivial types that have a non-zero bit pattern of value-initialized object, e.g. pointer to member. Regards, Maciej Cencora

Re: PR target/115618: can we back port the fix to GCC 13?

2024-06-27 Thread Andrew Carlotti
On Wed, Jun 26, 2024 at 09:03:26AM +, Kyrylo Tkachov wrote: > Hi Andrew, > > I’ve tested the fix for PR 115618 from your commit r14-6612-g8d30107455f230 > on the GCC 13 branch. > I’d like to back port it to that branch. > Is there any problem with that I should be aware of? > It applies clean

Re: [PATCH 2/3] libstdc++: Optimize __uninitialized_default using memset

2024-06-27 Thread Jonathan Wakely
On Thu, 27 Jun 2024 at 13:40, Maciej Cencora wrote: > > Hi, > > not sure whether I've missed some conditional that would exclude this case, > but your change seems to incorrectly handle trivial types that have a > non-zero bit pattern of value-initialized object, e.g. pointer to member. Good poi

Re: [PATCH 2/3] libstdc++: Optimize __uninitialized_default using memset

2024-06-27 Thread Jonathan Wakely
On Thu, 27 Jun 2024 at 13:49, Jonathan Wakely wrote: > > On Thu, 27 Jun 2024 at 13:40, Maciej Cencora wrote: > > > > Hi, > > > > not sure whether I've missed some conditional that would exclude this case, > > but your change seems to incorrectly handle trivial types that have a > > non-zero bit

Re: [PATCH 2/3] libstdc++: Optimize __uninitialized_default using memset

2024-06-27 Thread Maciej Cencora
You could include some of the bigger classes by checking whether the class type is bit_cast-able to std::array of bytes, and that bitcasted output is equal to value-initialized array. Regards, Maciej czw., 27 cze 2024 o 14:50 Jonathan Wakely napisał(a): > On Thu, 27 Jun 2024 at 13:49, Jonathan

Re: [PATCH] s390: Check for ADDR_REGS in s390_decompose_addrstyle_without_index

2024-06-27 Thread Andreas Krebbel
On 6/26/24 14:15, Stefan Schulze Frielinghaus wrote: An explicit check for address registers was not required so far since during register allocation the processing of address constraints was sufficient. However, address constraints themself do not check for REGNO_OK_FOR_{BASE,INDEX}_P. Thus, w

Re: [PATCH 2/3] libstdc++: Optimize __uninitialized_default using memset

2024-06-27 Thread Maciej Cencora
I think going the bit_cast way would be the best because it enables the optimization for many more classes including common wrappers like optional, variant, pair, tuple and std::array. Regards, Maciej Cencora czw., 27 cze 2024 o 14:57 Maciej Cencora napisał(a): > You could include some of the b

[pushed] Disable late-combine for -O0 [PR115677]

2024-06-27 Thread Richard Sandiford
late-combine relies on df, which for -O0 is only initialised late (pass_df_initialize_no_opt, after split1). Other df-based passes cope with this by requiring optimize > 0, so this patch does the same for late-combine. Bootstrapped & regression tested on aarch64-linux-gnu, pushed as obvious. Ric

RE: [PATCH] aarch64: Remove RNG and MTE from -mcpu=neoverse-v2

2024-06-27 Thread Tamar Christina
Hi Kyrill, > -Original Message- > From: Kyrylo Tkachov > Sent: Thursday, June 27, 2024 9:58 AM > To: gcc-patches@gcc.gnu.org > Cc: Richard Earnshaw ; Richard Sandiford > > Subject: [PATCH] aarch64: Remove RNG and MTE from -mcpu=neoverse-v2 > > Hi all, > > According to the TRM for Neove

RE: [PATCH v3] Vect: Support truncate after .SAT_SUB pattern in zip

2024-06-27 Thread Li, Pan2
Hi Richard, As mentioned by tamar in previous, would like to try even more optimization based on this patch. Assume we take zip benchmark as example, we may have gimple similar as below unsigned int _1, _2; unsigned short int _9; _9 = (unsigned short int).SAT_SUB (_1, _2); If we can locate the

Re: [PATCH] aarch64: Remove RNG and MTE from -mcpu=neoverse-v2

2024-06-27 Thread Kyrylo Tkachov
Hi Tamar, Thanks for going through the docs here, > On 27 Jun 2024, at 16:19, Tamar Christina wrote: > > External email: Use caution opening links or attachments > > > Hi Kyrill, > >> -Original Message- >> From: Kyrylo Tkachov >> Sent: Thursday, June 27, 2024 9:58 AM >> To: gcc-patch

RE: [PATCH] aarch64: Remove RNG and MTE from -mcpu=neoverse-v2

2024-06-27 Thread Tamar Christina
> -Original Message- > From: Kyrylo Tkachov > Sent: Thursday, June 27, 2024 3:49 PM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; Richard Earnshaw ; > Richard Sandiford > Subject: Re: [PATCH] aarch64: Remove RNG and MTE from -mcpu=neoverse-v2 > > Hi Tamar, > Thanks for going thro

[BACKPORT] AArch64: Fix strict-align cpymem/setmem [PR103100]

2024-06-27 Thread Wilco Dijkstra
OK to backport to GCC13 (it applies cleanly and regress/bootstrap passes)? Cheers, Wilco On 29/11/2023 18:09, Richard Sandiford wrote: > Wilco Dijkstra writes: >> v2: Use UINTVAL, rename max_mops_size. >> >> The cpymemdi/setmemdi implementation doesn't fully support strict alignment. >> Block t

Re: [PATCH v5] gcc, libcpp: Add warning switch for "#pragma once in main file" [PR89808]

2024-06-27 Thread Ken Matsui
Ping. On Sat, Jun 15, 2024 at 10:30 PM Ken Matsui wrote: > > This patch adds a warning switch for "#pragma once in main file". The > warning option name is Wpragma-once-outside-header, which is the same > as Clang provides. > > PR preprocessor/89808 > > gcc/c-family/ChangeLog: > >

Re: [PATCH] vect: Fix shift-by-induction for single-lane slp

2024-06-27 Thread Feng Xue OS
I added two test cases for the examples your mentioned. BTW: would you please look over another 3 lane-reducing patches that have been updated? If ok, I would consider to check them in. Thanks, Feng -- Allow shift-by-induction for slp node, when it is single lane, which is aligned with the or

RE: [PATCH][c++ frontend]: check for missing condition for novector [PR115623]

2024-06-27 Thread Tamar Christina
> -Original Message- > From: Jason Merrill > Sent: Tuesday, June 25, 2024 10:24 PM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; nd ; nat...@acm.org > Subject: Re: [PATCH][c++ frontend]: check for missing condition for novector > [PR115623] > > On 6/25/24 12:52, Tamar Christina wr

Re: [PATCH v3] c: Error message for incorrect use of static in array declarations

2024-06-27 Thread Marek Polacek
On Thu, Jun 27, 2024 at 11:06:51AM +, Uecker, Martin wrote: > > Next version with the improved location. I assume the [PATCH] > should become part of the commit message. Just the "c: ..." part please. > Bootstrapped and regression tested on x86_64. Thanks, this patch is OK. > c: Err

Re: [PATCH v3] Arm: Fix disassembly error in Thumb-1 relaxed load/store [PR115188]

2024-06-27 Thread Wilco Dijkstra
Hi Richard, > Doing just this will mean that the register allocator will have to undo a > pre/post memory operand that was accepted by the predicate (memory_operand).  > I think we really need a tighter predicate (lets call it noautoinc_mem_op) > here to avoid that.  Note that the existing uses

Re: [PATCH v3] Arm: Fix ldrd offset range [PR115153]

2024-06-27 Thread Wilco Dijkstra
Hi Richard, > The Linaro CI is reporting an ICE while building libgfortran with this change. So it looks like Thumb-2 oddly enough restricts the negative range of DFmode eventhough that is unnecessary and inefficient. The easiest workaround turned out to avoid using checked adjust_address. Cheer

Re: [PATCH 3/3 v2] RISC-V: Add md files for vector BFloat16

2024-06-27 Thread Patrick O'Neill
Hi Feng, Precommit results for the series: https://github.com/ewlu/gcc-precommit-ci/issues/1809#issuecomment-2193980567 https://patchwork.sourceware.org/project/gcc/patch/20240627070121.32461-3-wangf...@eswincomputing.com/ It looks like there are 5 minor testsuite failures added. Log from t

Re: [PATCH] libgccjit: Add support for machine-dependent builtins

2024-06-27 Thread Uros Bizjak
On Thu, Jun 27, 2024 at 12:49 AM David Malcolm wrote: > > On Thu, 2023-11-23 at 17:17 -0500, Antoni Boucher wrote: > > Hi. > > I did split the patch and sent one for the bfloat16 support and > > another > > one for the vector support. > > > > Here's the updated patch for the machine-dependent buil

Re: [BACKPORT] AArch64: Fix strict-align cpymem/setmem [PR103100]

2024-06-27 Thread Richard Sandiford
Wilco Dijkstra writes: > OK to backport to GCC13 (it applies cleanly and regress/bootstrap passes)? Yes, thanks. Richard > > Cheers, > Wilco > > On 29/11/2023 18:09, Richard Sandiford wrote: >> Wilco Dijkstra writes: >>> v2: Use UINTVAL, rename max_mops_size. >>> >>> The cpymemdi/setmemdi impl

nvptx vs. [PATCH] Add a late-combine pass [PR106594]

2024-06-27 Thread Thomas Schwinge
Hi! On 2023-10-24T19:49:10+0100, Richard Sandiford wrote: > This patch adds a combine pass that runs late in the pipeline. Great! In context of 'nvptx vs. "fwprop: invoke change_is_worthwhile to judge if a replacement is worthwhile"', I've beek looking a bit thr

[PATCH] fixincludes: adjust stdio fix for macOS 15 headers

2024-06-27 Thread FX Coudert
macOS 15 headers move the bulk of the content of to an included header <_stdio.h> so we apply the “apple_local_stdio_fn_deprecation” fixinclude to this file also. Restores bootstrap on darwin24. OK to push? FX fixincludes/ChangeLog: * fixincl.x: Regenerate. * inclhack.def (a

Re: [PATCH v2] MIPS: Output $0 for conditional trap if !ISA_HAS_COND_TRAPI

2024-06-27 Thread Maciej W. Rozycki
On Thu, 27 Jun 2024, YunQiang Su wrote: > > The missed optimisation in GAS, which used not to trigger pre-R6, is > > irrelevant from this change's point of view and just adds noise. I'm > > surprised that it worked even in the first place, as I reckon GCC is > > supposed to emit regular MIPS cod

Re: [PATCH] jit: Ensure ssize_t is defined.

2024-06-27 Thread FX Coudert
Among the review comments from the last round, Jakub suggested: > Perhaps libgccjit.h could use > #ifdef __has_include > #if __has_include () > #include > #endif > #endif > instead of just #include . I’m not sure it’s necessary since other headers treat as always available, but I suppose it ca

Re: [PATCH] fixincludes: adjust stdio fix for macOS 15 headers

2024-06-27 Thread Iain Sandoe
> On 27 Jun 2024, at 17:59, FX Coudert wrote: > > macOS 15 headers move the bulk of the content of to an included > header <_stdio.h> so we apply the “apple_local_stdio_fn_deprecation” > fixinclude to this file also. > > Restores bootstrap on darwin24. > OK to push? OK. thanks for the fix

Re: [PATCH] fixincludes: adjust stdio fix for macOS 15 headers

2024-06-27 Thread FX Coudert
> OK. thanks for the fix > I guess we have also to backport if we want earlier branches to bootstrap > there too? Thanks. I’ll backport after some time. FX

Re: [PATCH v5] aarch64: Add vector popcount besides QImode [PR113859]

2024-06-27 Thread Richard Sandiford
Sorry for the slow reply. Pengxuan Zheng writes: > This patch improves GCC’s vectorization of __builtin_popcount for aarch64 > target > by adding popcount patterns for vector modes besides QImode, i.e., HImode, > SImode and DImode. > > With this patch, we now generate the following for V8HI: >

Re: [PATCH] i386: Fix regression after refactoring legitimize_pe_coff_symbol, ix86_GOT_alias_set and PE_COFF_LEGITIMIZE_EXTERN_DECL

2024-06-27 Thread Uros Bizjak
On Thu, Jun 27, 2024 at 12:50 PM Evgeny Karpov wrote: > > Thursday, June 27, 2024 10:39 AM > Uros Bizjak wrote: > > > > diff --git a/gcc/config/i386/i386-expand.cc > > > b/gcc/config/i386/i386-expand.cc > > > index 5dfa7d49f58..20adb42e17b 100644 > > > --- a/gcc/config/i386/i386-expand.cc > > >

Re: [gcc r15-1619] ira: Scale save/restore costs of callee save registers with block frequency

2024-06-27 Thread Andrew Pinski
On Thu, Jun 27, 2024 at 3:57 AM Andreas Schwab wrote: > > This breaks s390. > > ../../../../../gcc/libstdc++-v3/src/c++17/floating_to_chars.cc: In function > ‘std::to_chars_result std::__floating_to_chars_shortest(char*, char*, T, > chars_format) [with T = long double]’: > ../../../../../gcc/lib

Re: [PATCH] _Hashtable fancy pointer support

2024-06-27 Thread François Dumont
Thanks for the link, based on it I removed some of the nullptr usages keeping only assignments. François On 26/06/2024 23:41, Jonathan Wakely wrote: On Wed, 26 Jun 2024 at 21:39, François Dumont wrote: Hi Here is my proposal to add support for fancy allocator pointer. The only place where

[x86 PATCH] Handle sign_extend like zero_extend in *concatditi3_[346]

2024-06-27 Thread Roger Sayle
This patch generalizes some of the patterns in i386.md that recognize double word concatenation, so they handle sign_extend the same way that they handle zero_extend in appropriate contexts. As a motivating example consider the following function: __int128 foo(long long x, unsigned long long y)

Re: nvptx vs. [PATCH] Add a late-combine pass [PR106594]

2024-06-27 Thread Thomas Schwinge
Hi! On 2024-06-27T18:49:17+0200, I wrote: > On 2023-10-24T19:49:10+0100, Richard Sandiford > wrote: >> This patch adds a combine pass that runs late in the pipeline. [After sending, I realized I replied to a previous thread of this work.] > I've beek looking a bit through recent nvptx target c

Re: [PATCH] _Hashtable fancy pointer support

2024-06-27 Thread Jonathan Wakely
On Thu, 27 Jun 2024 at 20:25, François Dumont wrote: > > Thanks for the link, based on it I removed some of the nullptr usages > keeping only assignments. That's not necessary. A nullable pointer type is equality comparable with nullptr_t, and nullptr can be implicitly converted to the pointer ty

[PATCH] c: ICE on invalid with attribute optimize [PR115549]

2024-06-27 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- I had this PR in my open tabs so why not go ahead and fix it. decl_attributes gets last_decl, the last already pushed declaration, to be used in common_handle_aligned_attribute. In C++, we look up the decl via find_last_decl,

[PATCH] preprocessor: Create the parser before handling command-line includes [PR115312]

2024-06-27 Thread Lewis Hyatt
Hello- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115312 This fixes a 14.1 regression with PCH for MinGW and other platforms that don't use stdc-predef.h. Bootstrap + regtest all languages on x86-64 Linux; bootstrap + regtest c,c++ on x86_64-w64-mingw32. Is it OK for 14 branch and master please

Re: [PATCH] c: ICE on invalid with attribute optimize [PR115549]

2024-06-27 Thread Marek Polacek
Sorry, I used the wrong e-mail address for Joseph. On Thu, Jun 27, 2024 at 05:04:41PM -0400, Marek Polacek wrote: > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > -- >8 -- > I had this PR in my open tabs so why not go ahead and fix it. > > decl_attributes gets last_decl, the la

Re: [PATCH] c: ICE with invalid sizeof [PR115642]

2024-06-27 Thread Marek Polacek
Sorry, I used the wrong e-mail address for Joseph. On Wed, Jun 26, 2024 at 11:09:37AM -0400, Marek Polacek wrote: > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > -- >8 -- > Here we ICE in c_expr_sizeof_expr on an erroneous expr.value. The > code checks for expr.value == error_

Re: nvptx vs. [PATCH] Add a late-combine pass [PR106594]

2024-06-27 Thread Thomas Schwinge
Hi! On 2024-06-27T22:27:21+0200, I wrote: > On 2024-06-27T18:49:17+0200, I wrote: >> On 2023-10-24T19:49:10+0100, Richard Sandiford >> wrote: >>> This patch adds a combine pass that runs late in the pipeline. > > [After sending, I realized I replied to a previous thread of this work.] > >> I've

  1   2   >