Re: [PATCH] LoongArch: Allow using --with-arch=native if host CPU is LoongArch

2023-07-22 Thread chenglulu
在 2023/7/20 下午9:28, Xi Ruoyao 写道: If the host triple and the target triple are different but the host is LoongArch, in some cases --with-arch=native can be useful. For example, if we are bootstrapping a loongarch64-linux-musl toolchain on a Glibc-based system and we don't intend to use the too

Re: [PATCH v2 2/3] libstdc++: Optimize is_arithmetic performance by __is_arithmetic built-in

2023-07-22 Thread François Dumont via Gcc-patches
On 17/07/2023 06:48, Ken Matsui wrote: On Sun, Jul 16, 2023 at 5:32 AM François Dumont wrote: On 15/07/2023 06:55, Ken Matsui via Libstdc++ wrote: This patch optimizes the performance of the is_arithmetic trait by dispatching to the new __is_arithmetic built-in trait. libstdc++-v3/ChangeLo

Re: [PATCH v2 3/3] libstdc++: Optimize is_fundamental performance by __is_arithmetic built-in

2023-07-22 Thread François Dumont via Gcc-patches
It seems rather logical cause std::disjunction is supposed to avoid instantiations but in case of: std::disjunction, std::is_null_pointer<_Tp>> you'll avoid std::is_null_pointer instantiation only for 'void' type and at the price of instantiating std::disjunction so 2 instantiations at best b

Re: [PATCH v3 1/3] c++, libstdc++: Implement __is_arithmetic built-in trait

2023-07-22 Thread François Dumont via Gcc-patches
On 18/07/2023 08:27, Ken Matsui via Libstdc++ wrote: This patch implements built-in trait for std::is_arithmetic. gcc/cp/ChangeLog: * cp-trait.def: Define __is_arithmetic. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_ARITHMETIC. * semantics.cc (trait_expr_valu

[x86 PATCH] Don't use insvti_{high, low}part with -O0 (for compile-time).

2023-07-22 Thread Roger Sayle
This patch attempts to help with PR rtl-optimization/110587, a regression of -O0 compile time for the pathological pr28071.c. My recent patch helps a bit, but hasn't returned -O0 compile-time to where it was before my ix86_expand_move changes. The obvious solution/workaround is to guard these ne

Re: [WIP RFC] analyzer: Add optional trim of the analyzer diagnostics going too deep [PR110543]

2023-07-22 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 21 Jul 2023 at 21:05, Benjamin Priour via Gcc-patches wrote: > > Hi, > > Upon David's request I've joined the in progress patch to the below email. > I hope it makes more sense now. > > Best, > Benjamin. > > -- Forwarded message - > From: Benjamin Priour > Date: Tue, Jul 1

[PATCH v5 0/3] c++: Track lifetimes in constant evaluation [PR70331, ...]

2023-07-22 Thread Nathaniel Shead via Gcc-patches
This is an update of the patch series at https://gcc.gnu.org/pipermail/gcc-patches/2023-July/625050.html Changes since v4: - Reordered patches to be more independent from each other (they don't need to keep updating the new tests) - Removed workaround for better locations in cxx_eval_store_exp

[PATCH v5 1/3] c++: Improve location information in constant evaluation

2023-07-22 Thread Nathaniel Shead via Gcc-patches
This patch updates 'input_location' during constant evaluation to ensure that errors in subexpressions that lack location information still provide accurate diagnostics. By itself this change causes some small regressions in diagnostic quality for circumstances where errors used 'input_location' b

[PATCH v5 2/3] c++: Prevent dangling pointers from becoming nullptr in constexpr [PR110619]

2023-07-22 Thread Nathaniel Shead via Gcc-patches
Currently, when typeck discovers that a return statement will refer to a local variable it rewrites to return a null pointer. This causes the error messages for using the return value in a constant expression to be unhelpful, especially for reference return values, and is also a visible change to o

[PATCH v5 3/3] c++: Track lifetimes in constant evaluation [PR70331,PR96630,PR98675]

2023-07-22 Thread Nathaniel Shead via Gcc-patches
This adds rudimentary lifetime tracking in C++ constexpr contexts, allowing the compiler to report errors with using values after their backing has gone out of scope. We don't yet handle other ways of accessing values outside their lifetime (e.g. following explicit destructor calls). PR c+

[x86 PATCH] Use QImode for offsets in zero_extract/sign_extract in i386.md

2023-07-22 Thread Roger Sayle
As suggested by Uros, this patch changes the ZERO_EXTRACTs and SIGN_EXTRACTs in i386.md to consistently use QImode for bit offsets (i.e. third and fourth operands), matching the use of QImode for bit counts in shifts and rotates. There's no change in functionality, and the new patterns simply ens

[committed] Fix length computation bug in bfin port

2023-07-22 Thread Jeff Law via Gcc-patches
The tester seemed to occasionally ping-pong a compilation failure on the builtin-bitops-1.c test. I long suspected it was something like length computations. I finally got a few minutes to dig into it, and sure enough the blackfin port was claiming the "ones" operation was 2 bytes when it is

Re: [PATCH 4/9] vect: Adjust vectorizable_load costing on VMAT_ELEMENTWISE and VMAT_STRIDED_SLP

2023-07-22 Thread Iain Sandoe
Hi Kewen, This patch breaks bootstrap on powerpc-darwin (which has Altivec, but not VSX) while building libgfortran. > On 3 Jul 2023, at 04:19, Kewen.Lin via Gcc-patches > wrote: Please see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110776 thanks Iain

[PATCH] Replace lra-spill.cc's return_regno_p with return_reg_p.

2023-07-22 Thread Roger Sayle
This patch is my attempt to address the compile-time hog issue in PR rtl-optimization/110587. Richard Biener's analysis shows that compilation of pr28071.c with -O0 currently spends ~70% in timer "LRA non-specific" due to return_regno_p failing to filter a large number of calls to regno_in_use_p,

[committed] testsuite: Limit bb-slp-pr95839-v8.c to 64-bit vector targets

2023-07-22 Thread Maciej W. Rozycki
Only run bb-slp-pr95839-v8.c with targets that support vectors of 64 bits, removing regressions with 32-bit x86 targets: FAIL: gcc.dg/vect/bb-slp-pr95839-v8.c scan-tree-dump slp2 "optimized: basic block" FAIL: gcc.dg/vect/bb-slp-pr95839-v8.c -flto -ffat-lto-objects scan-tree-dump slp2 "optimiz

Re: [x86 PATCH] Use QImode for offsets in zero_extract/sign_extract in i386.md

2023-07-22 Thread Uros Bizjak via Gcc-patches
On Sat, Jul 22, 2023 at 5:37 PM Roger Sayle wrote: > > > As suggested by Uros, this patch changes the ZERO_EXTRACTs and SIGN_EXTRACTs > in i386.md to consistently use QImode for bit offsets (i.e. third and fourth > operands), matching the use of QImode for bit counts in shifts and rotates. > > The

Re: [x86 PATCH] Don't use insvti_{high, low}part with -O0 (for compile-time).

2023-07-22 Thread Uros Bizjak via Gcc-patches
On Sat, Jul 22, 2023 at 4:17 PM Roger Sayle wrote: > > > This patch attempts to help with PR rtl-optimization/110587, a regression > of -O0 compile time for the pathological pr28071.c. My recent patch helps > a bit, but hasn't returned -O0 compile-time to where it was before my > ix86_expand_move

[PATCH] Fix alpha building

2023-07-22 Thread Andrew Pinski via Gcc-patches
The problem is after r14-2587-gd8105b10fff951, the definition of extended_count now takes a bool as its last argument but we only have a declaration for the version which takes an int as the last argument. This fixes the problem by changing the declaration to be a bool too. Committed as obvious af

Re: [PATCH v2] RISC-V: optim const DF +0.0 store to mem [PR/110748]

2023-07-22 Thread Vineet Gupta
On 7/21/23 23:05, Jeff Law wrote: On 7/21/23 12:30, Vineet Gupta wrote: Fixes: ef85d150b5963 ("RISC-V: Enable TARGET_SUPPORTS_WIDE_INT") (gcc-13 regression) DF +0.0 is bitwise all zeros so int x0 store to mem can be used to optimize it. void zd(double *) { *d = 0.0; } currently: | fmv.d.

[Committed] RISC-V: optim const DF +0.0 store to mem [PR/110748]

2023-07-22 Thread Vineet Gupta
Fixes: ef85d150b5963 ("RISC-V: Enable TARGET_SUPPORTS_WIDE_INT") DF +0.0 is bitwise all zeros so int x0 store to mem can be used to optimize it. void zd(double *) { *d = 0.0; } currently: | fmv.d.x fa5,zero | fsd fa5,0(a0) | ret With patch | sd zero,0(a0) | ret The fix updates predi

[PATCH] Fix 100864: `(a&!b) | b` is not opimized to `a | b` for comparisons

2023-07-22 Thread Andrew Pinski via Gcc-patches
This adds a special case of the `(a&~b) | b` pattern where `b` and `~b` are comparisons. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: PR tree-optimization/100864 * match.pd ((~x & y) | x -> x | y): Add comparison variant. gcc/testsuite/Chan

[PATCH 2/2] AARCH64: Turn off unwind tables for crtbeginT.o

2023-07-22 Thread Andrew Pinski via Gcc-patches
The problem -fasynchronous-unwind-tables is on by default for aarch64 We need turn it off for crt*.o because it would make __EH_FRAME_BEGIN__ point to .eh_frame data from crtbeginT.o instead of the user-defined object during static linking. This turns it off. OK? Bootstrapped and tested on aarch6

[PATCH 1/2] Fix PR 110066: crash with -pg -static on riscv

2023-07-22 Thread Andrew Pinski via Gcc-patches
The problem -fasynchronous-unwind-tables is on by default for riscv linux We need turn it off for crt*.o because it would make __EH_FRAME_BEGIN__ point to .eh_frame data from crtbeginT.o instead of the user-defined object during static linking. This turns it off. OK? libgcc/ChangeLog: *

Re: [PATCH 1/2] Fix PR 110066: crash with -pg -static on riscv

2023-07-22 Thread Kito Cheng via Gcc-patches
OK for trunk, thanks:) Andrew Pinski via Gcc-patches 於 2023年7月23日 週日 09:07 寫道: > The problem -fasynchronous-unwind-tables is on by default for riscv linux > We need turn it off for crt*.o because it would make __EH_FRAME_BEGIN__ > point > to .eh_frame data from crtbeginT.o instead of the user-de

[PATCH V5] VECT: Support floating-point in-order reduction for length loop control

2023-07-22 Thread Lehua Ding
From: Ju-Zhe Zhong PS: Submitted on behalf of Juzhe Zhong Hi, Richard and Richi. This patch support floating-point in-order reduction for loop length control. Consider this following case: float foo (float *__restrict a, int n) { float result = 1.0; for (int i = 0; i < n; i++) result +

Re: Re: [PATCH V2] VECT: Support floating-point in-order reduction for length loop control

2023-07-22 Thread Lehua Ding
Hi Richard, Bootstrap and regression are passed on X86 and no new testcases fail on AArch64 with V5 patch: https://gcc.gnu.org/pipermail/gcc-patches/2023-July/625293.html V5 patch is ok for trunk? Best, Lehua

Re: [PATCH 1/2] Fix PR 110066: crash with -pg -static on riscv

2023-07-22 Thread Andreas Schwab
On Jul 22 2023, Andrew Pinski via Gcc-patches wrote: > The problem -fasynchronous-unwind-tables is on by default for riscv linux > We need turn it off for crt*.o because it would make __EH_FRAME_BEGIN__ point > to .eh_frame data from crtbeginT.o instead of the user-defined object > during static l