RE: [PATCH v7] libgfortran: Replace mutex with rwlock

2023-12-09 Thread Zhu, Lipeng
On 2023/12/9 23:23, Jakub Jelinek wrote: > On Sat, Dec 09, 2023 at 10:39:45AM -0500, Lipeng Zhu wrote: > > This patch try to introduce the rwlock and split the read/write to > > unit_root tree and unit_cache with rwlock instead of the mutex to > > increase CPU efficiency. In the get_gfc_unit

[PATCH] aarch64: arm_neon.h - Fix -Wincompatible-pointer-types errors

2023-12-09 Thread Victor Do Nascimento
In the Linux kernel, u64/s64 are [un]signed long long, not [un]signed long. This means that when the `arm_neon.h' header is used by the kernel, any use of the `uint64_t' / `in64_t' types needs to be correctly cast to the correct `__builtin_aarch64_simd_di' / `__builtin_aarch64_simd_df' types when

[PATCH] Add some new DW_IDX_* constants

2023-12-09 Thread Tom Tromey
I've reimplemented the .debug_names code in GDB -- it was quite far from being correct, and the new implementation is much closer to what is specified by DWARF. However, the new writer in GDB needs to emit some symbol properties, so that the reader can be fully functional. This patch adds a few

Re: [PATCH] c++/modules: alias CTAD and specializations table

2023-12-09 Thread Jason Merrill
On 11/24/23 13:09, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? OK. -- >8 -- A rewritten guide for alias CTAD isn't really a specialization of the original guide, so we shouldn't register it as such. This avoids an ICE in the below

Re: [PATCH] c++: fix noexcept checking for trivial operations [PR96090]

2023-12-09 Thread Jason Merrill
On 11/27/23 06:07, Nathaniel Shead wrote: Ping for https://gcc.gnu.org/pipermail/gcc-patches/2023-October/634626.html. I've been made aware since constructing this patch of CWG2820, which has a proposed resolution that would change the result of the testcase 'noexcept(yesthrow_t())' (and

Re: [PATCH] c++: End lifetime of objects in constexpr after destructor call [PR71093]

2023-12-09 Thread Jason Merrill
On 11/2/23 21:18, Nathaniel Shead wrote: Bootstrapped and regtested on x86-64_pc_linux_gnu. I'm not entirely sure if the change I made to have destructors clobber with CLOBBER_EOL instead of CLOBBER_UNDEF is appropriate, but nothing seemed to have broken by doing this and I wasn't able to find

Re: [PATCH] phiopt: Fix ICE with large --param l1-cache-line-size= [PR112887]

2023-12-09 Thread Richard Biener
> Am 09.12.2023 um 10:35 schrieb Jakub Jelinek : > > Hi! > > This function is never called when param_l1_cache_line_size is 0, > but it uses int and unsigned int variables to hold alignment in > bits, so for large param_l1_cache_line_size it is zero and e.g. > DECL_ALIGN () %

v2 [C PATCH] Fix regression causing ICE for structs with VLAs [PR 112488]

2023-12-09 Thread Martin Uecker
I revised version which fixes a problem with breaking other callers of finish_rust. Please ignore the previous one. Bootstrapped and regression tested on x86_64 Fix regression causing ICE for structs with VLAs [PR 112488] A previous patch the fixed several ICEs related to size expressions of

Re: aarch64: Fix +nopredres, +nols64 and +nomops

2023-12-09 Thread Richard Sandiford
Andrew Carlotti writes: > For native cpu feature detection, certain features have no entry in > /proc/cpuinfo, so have to be assumed to be present whenever the detected > cpu is supposed to support that feature. > > However, the logic for this was mistakenly implemented by excluding > these

Re: aarch64: Fix +nocrypto handling

2023-12-09 Thread Richard Sandiford
Andrew Carlotti writes: > Additionally, replace all checks for the AARCH64_FL_CRYPTO bit with > checks for (AARCH64_FL_AES | AARCH64_FL_SHA2) instead. The value of the > AARCH64_FL_CRYPTO bit within isa_flags is now ignored, but it is > retained because removing it would make processing the data

Re: [PATCH] aarch64: Add missing driver-aarch64 dependencies

2023-12-09 Thread Richard Sandiford
Andrew Carlotti writes: > Ok for master? > > gcc/ChangeLog: > > * config/aarch64/x-aarch64: Add missing dependencies. > > > diff --git a/gcc/config/aarch64/x-aarch64 b/gcc/config/aarch64/x-aarch64 > index > 3cf701a0a01ab00eaaafdfad14bd90ebbb1d498f..6fd638faaab7cb5bb2309d36d6dea2adf1fb8d32

Re: [PING][PATCH 2/2] arm: Add support for MVE Tail-Predicated Low Overhead Loops

2023-12-09 Thread Richard Sandiford
Sorry for the slow review. Stamatis Markianos-Wright writes: > [...] > diff --git a/gcc/config/arm/mve.md b/gcc/config/arm/mve.md > index > 44a04b86cb5806fcf50917826512fd203d42106c..c083f965fa9a40781bc86beb6e63654afd14eac4 > 100644 > --- a/gcc/config/arm/mve.md > +++ b/gcc/config/arm/mve.md >

[PATCH 3/3] LoongArch: Add alslsi3_extend

2023-12-09 Thread Xi Ruoyao
Following the instruction cost fix, we are generating alsl.w $a0, $a0, $a0, 4 instead of li.w $t0, 17 mul.w $a0, $t0 for "x * 4", because alsl.w is 4 times faster than mul.w. But we didn't have a sign-extending pattern for alsl.w, causing an extra slli.w instruction generated to

[PATCH 1/3] LoongArch: Include rtl.h for COSTS_N_INSNS instead of hard coding our own

2023-12-09 Thread Xi Ruoyao
With loongarch-def.cc switched from C to C++, we can include rtl.h for COSTS_N_INSNS, instead of hard coding our own. THis is a non-functional change for now, but it will make the code more future-proof in case COSTS_N_INSNS in rtl.h would be changed. gcc/ChangeLog: *

[PATCH 2/3] LoongArch: Fix instruction costs [PR112936]

2023-12-09 Thread Xi Ruoyao
Replace the instruction costs in loongarch_rtx_cost_data constructor based on micro-benchmark results on LA464 and LA664. This allows optimizations like "x * 17" to alsl, and "x * 68" to alsl and slli. gcc/ChangeLog: PR target/112936 * config/loongarch/loongarch-def.cc

[PATCH 0/3] LoongArch: Fix instruction costs

2023-12-09 Thread Xi Ruoyao
Update LoongArch instruction costs based on the micro-benchmark results on LA464 and LA664. In particular, this allows generating alsl/slli or alsl/slli + add pairs for multiplying some constants as on LA464/LA664 a mul instruction is 4x slower than alsl, slli, or add instructions. Bootstrapped

[PATCH] LoongArch: Fix warnings building libgcc

2023-12-09 Thread Xi Ruoyao
We are excluding loongarch-opts.h from target libraries, but now struct loongarch_target and gcc_options are not declared in the target libraries, causing: In file included from ../.././gcc/options.h:8, from ../.././gcc/tm.h:49, from

Re: [PATCH v7] libgfortran: Replace mutex with rwlock

2023-12-09 Thread Jakub Jelinek
On Sat, Dec 09, 2023 at 10:39:45AM -0500, Lipeng Zhu wrote: > This patch try to introduce the rwlock and split the read/write to > unit_root tree and unit_cache with rwlock instead of the mutex to > increase CPU efficiency. In the get_gfc_unit function, the percentage > to step into the

[PATCH v7] libgfortran: Replace mutex with rwlock

2023-12-09 Thread Lipeng Zhu
This patch try to introduce the rwlock and split the read/write to unit_root tree and unit_cache with rwlock instead of the mutex to increase CPU efficiency. In the get_gfc_unit function, the percentage to step into the insert_unit function is around 30%, in most instances, we can get the unit in

Re: [patch] OpenMP/Fortran: Implement omp allocators/allocate for ptr/allocatables

2023-12-09 Thread Jakub Jelinek
On Sat, Dec 09, 2023 at 12:19:10PM +0100, Thomas Schwinge wrote: > > --- a/gcc/omp-builtins.def > > +++ b/gcc/omp-builtins.def > > @@ -467,6 +467,9 @@ DEF_GOMP_BUILTIN > > (BUILT_IN_GOMP_WORKSHARE_TASK_REDUCTION_UNREGISTER, > > DEF_GOMP_BUILTIN (BUILT_IN_GOMP_ALLOC, > >

RE: [PATCH v6] libgfortran: Replace mutex with rwlock

2023-12-09 Thread Zhu, Lipeng
On 2023/12/8 18:19, Jakub Jelinek wrote: > On Fri, Aug 18, 2023 at 11:18:19AM +0800, Zhu, Lipeng wrote: > > From: Lipeng Zhu > > > > This patch try to introduce the rwlock and split the read/write to > > unit_root tree and unit_cache with rwlock instead of the mutex to > > increase CPU

[committed] testsuite: Add testcase for already fixed PR [PR112924]

2023-12-09 Thread Jakub Jelinek
Hi! This testcase got fixed with r14-6132-g50f2a3370d177f8fe9bea0461feb710523e048a2 . I'm just adding a testcase so that it doesn't reappear. Tested on x86_64-linux, with -m32/-m64, current trunk as well as r14-6131 where it ICEd with -m32, committed to trunk as obvious. 2023-12-09 Jakub

Re: Re: [PATCH] RISC-V: Add vectorized strcmp.

2023-12-09 Thread 钟居哲
I didn't use any special configuration: --with-arch=rv64gcv_zvl256b --with-abi=lp64d --test --jobs=64 --with-sim=qemu --enable-gcc-checking=yes,assert,extra,rtlflag,rtl,gimple juzhe.zh...@rivai.ai From: Robin Dapp Date: 2023-12-09 22:07 To: 钟居哲; gcc-patches; palmer; kito.cheng; Jeff Law CC:

[committed] libstdc++: Fix value of __cpp_lib_format macro [PR111826]

2023-12-09 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. I'll check, but I think should be backported to gcc-13 too. -- >8 -- As noted in the PR, we support both features required for the 202110L value, so we should define it with that value. libstdc++-v3/ChangeLog: PR libstdc++/111826 *

Re: [PATCH] RISC-V: Add vectorized strcmp.

2023-12-09 Thread Robin Dapp
> rv64gcv With -minline-strcmp I assume? Regards Robin

[committed] libstdc++: Fix resolution of LWG 4016 for std::ranges::to [PR112876]

2023-12-09 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. -- >8 -- What I implemented in r14-6199-g45630fbcf7875b does not match what I proposed for LWG 4016, and it imposes additional, unwanted requirements on the emplace and insert member functions of the container being populated. libstdc++-v3/ChangeLog:

Re: Re: [PATCH] RISC-V: Add vectorized strcmp.

2023-12-09 Thread 钟居哲
rv64gcv juzhe.zh...@rivai.ai From: Robin Dapp Date: 2023-12-09 21:51 To: 钟居哲; gcc-patches; palmer; kito.cheng; Jeff Law CC: rdapp.gcc Subject: Re: [PATCH] RISC-V: Add vectorized strcmp. > FAIL: gcc.target/riscv/rvv/autovec/builtin/strcmp-run.c execution test > FAIL:

Re: [PATCH] RISC-V: Recognize stepped series in expand_vec_perm_const.

2023-12-09 Thread 钟居哲
It's more reasonable to fix it in vec_perm_const instead of fix it in middle-end. LGTM. juzhe.zh...@rivai.ai From: Robin Dapp Date: 2023-12-09 21:18 To: gcc-patches; palmer; Kito Cheng; jeffreyalaw; juzhe.zh...@rivai.ai CC: rdapp.gcc Subject: [PATCH] RISC-V: Recognize stepped series in

Re: [PATCH] RISC-V: Add vectorized strcmp.

2023-12-09 Thread Robin Dapp
> FAIL: gcc.target/riscv/rvv/autovec/builtin/strcmp-run.c execution test > FAIL: gcc.target/riscv/rvv/autovec/builtin/strcmp-run.c execution test > FAIL: gcc.target/riscv/rvv/autovec/builtin/strcmp-run.c execution test > FAIL: gcc.target/riscv/rvv/autovec/builtin/strcmp-run.c execution test >

[PATCH] RISC-V: Recognize stepped series in expand_vec_perm_const.

2023-12-09 Thread Robin Dapp
Hi, we currently try to recognize various forms of stepped (const_vector) sequence variants in expand_const_vector. Because of complications with canonicalization and encoding it is easier to identify such patterns in expand_vec_perm_const_1 already where perm.series_p () is available. This

Re: [PATCH] Reimplement __gnu_cxx::__ops operators

2023-12-09 Thread François Dumont
On 07/12/2023 14:41, Jonathan Wakely wrote: On Wed, 6 Dec 2023 at 20:55, François Dumont wrote: I think I still got no feedback about this cleanup proposal. Can you remind me why we have all those different functions in predefined_ops.h in the first place? I think it was to avoid having two

Re: [patch] OpenMP/Fortran: Implement omp allocators/allocate for ptr/allocatables

2023-12-09 Thread Thomas Schwinge
Hi Tobias! On 2023-11-08T17:58:10+0100, Tobias Burnus wrote: > OpenMP/Fortran: Implement omp allocators/allocate for ptr/allocatables Nice work! > This commit adds -fopenmp-allocators which enables support for > 'omp allocators' and 'omp allocate' that are associated with a Fortran >

Re: [PATCH] Add support for function attributes and variable attributes

2023-12-09 Thread Guillaume Gomez
Added it. Le jeu. 7 déc. 2023 à 18:13, Antoni Boucher a écrit : > > It seems like you forgot to prefix the commit message with "libgccjit: > ". > > On Thu, 2023-11-30 at 10:55 +0100, Guillaume Gomez wrote: > > Ping David. :) > > > > Le jeu. 23 nov. 2023 à 22:59, Antoni Boucher a > > écrit : > >

Re: [PATCH 15/21]middle-end: [RFC] conditionally support forcing final edge for debugging

2023-12-09 Thread Richard Sandiford
Tamar Christina writes: > Hi All, > > What do people think about having the ability to force only the latch > connected > exit as the exit as a param? I.e. what's in the patch but as a param. > > I found this useful when debugging large example failures as it tells me where > I should be

[PATCH] phiopt: Fix ICE with large --param l1-cache-line-size= [PR112887]

2023-12-09 Thread Jakub Jelinek
Hi! This function is never called when param_l1_cache_line_size is 0, but it uses int and unsigned int variables to hold alignment in bits, so for large param_l1_cache_line_size it is zero and e.g. DECL_ALIGN () % param_align_bits can divide by zero. Looking at the code, the function uses

[Committed] RISC-V: Fix VLS mode movmiaslign bug

2023-12-09 Thread Juzhe-Zhong
PR112932 let me notice there is a bug of current VLS mode misalign pattern. Adapt it same as VLA mode. Commited as it is obvious fix. PR target/112932 gcc/ChangeLog: * config/riscv/vector.md (movmisalign): Fix VLSmode bugs. gcc/testsuite/ChangeLog: *