Re: [PATCH] RISC-V: Use dominance analysis in global vsetvl elimination

2023-09-11 Thread Kito Cheng via Gcc-patches
LGTM, and I guess you will remove get_all_predecessors once LMUL cost model can use dominator info as well? On Mon, Sep 11, 2023 at 11:34 AM Juzhe-Zhong wrote: > > I found that it's more reasonable to use existing dominance analysis. > > gcc/ChangeLog: > > * config/riscv/riscv-vsetvl.cc

Re: Re: [PATCH] RISC-V: Use dominance analysis in global vsetvl elimination

2023-09-11 Thread juzhe.zh...@rivai.ai
Committed. Thanks kito. >> I guess you will remove get_all_predecessors once LMUL cost >> model can use dominator info as well? Yes. I am trying but there is a failed case for dynamic LMUL. Not sure whether it can work now. juzhe.zh...@rivai.ai From: Kito Cheng Date: 2023-09-11 15:03 To: Juz

[PATCH v1] RISC-V: Implement RESOLVE_OVERLOADED_BUILTIN for RVV intrinsic

2023-09-11 Thread Pan Li via Gcc-patches
From: Pan Li This patch would like add the framework to support the RVV overloaded intrinsic API in riscv-xxx-xxx-gcc, like riscv-xxx-xxx-g++ did. However, it almost leverage the hook TARGET_RESOLVE_OVERLOADED_BUILTIN with below steps. * Register overloaded functions. * Add function_resolver fo

[r14-3823 Regression] FAIL: c-c++-common/analyzer/compound-assignment-1.c -std=c++98 (test for warnings, line 72) on Linux/x86_64

2023-09-11 Thread Jiang, Haochen via Gcc-patches
On Linux/x86_64, 50b5199cff690891726877e1c00ac53dfb7cc1c8 is the first bad commit commit 50b5199cff690891726877e1c00ac53dfb7cc1c8 Author: benjamin priour Date: Sat Sep 9 18:03:56 2023 +0200 analyzer: Move gcc.dg/analyzer tests to c-c++-common (2) [PR96395] caused FAIL: c-c++-common/analy

Re: [PATCH v1] RISC-V: Implement RESOLVE_OVERLOADED_BUILTIN for RVV intrinsic

2023-09-11 Thread juzhe.zh...@rivai.ai
Thanks for supporting it even though I don't like this feature :). The framework is LGTM. Let's wait for kito's more comments. juzhe.zh...@rivai.ai From: pan2.li Date: 2023-09-11 15:57 To: gcc-patches CC: juzhe.zhong; pan2.li; yanzhang.wang; kito.cheng Subject: [PATCH v1] RISC-V: Implement RE

Re: [PATCH v2] analyzer: Call off a superseding when diagnostics are unrelated [PR110830]

2023-09-11 Thread Andreas Schwab via Gcc-patches
../../gcc/analyzer/diagnostic-manager.cc: In function 'bool ana::compatible_epath_p(const exploded_path*, const exploded_path*)': ../../gcc/analyzer/diagnostic-manager.cc:969:1: warning: control reaches end of non-void function [-Wreturn-type] -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Ke

RE: [PATCH v1] Mode-Switching: Add optional EMIT_AFTER hook

2023-09-11 Thread Li, Pan2 via Gcc-patches
Hi Jeff, Kindly ping for the Patch V2 as below. https://gcc.gnu.org/pipermail/gcc-patches/2023-August/628508.html Pan -Original Message- From: Li, Pan2 Sent: Friday, August 25, 2023 8:45 PM To: Li, Pan2 ; Jeff Law ; gcc-patches@gcc.gnu.org Cc: juzhe.zh...@rivai.ai; Wang, Yanzhang ;

Re: [PATCH] pretty-print: Fix up pp_wide_int [PR111329]

2023-09-11 Thread Richard Sandiford via Gcc-patches
Jakub Jelinek writes: > Hi! > > The recent pp_wide_int changes for _BitInt support (because not all > wide_ints fit into the small fixed size digit_buffer anymore) apparently > broke > +FAIL: gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c (test for excess > errors) > +FAIL: gcc.dg/analyzer/out-o

Re: [PATCH v1] RISC-V: Implement RESOLVE_OVERLOADED_BUILTIN for RVV intrinsic

2023-09-11 Thread Kito Cheng via Gcc-patches
> @@ -545,7 +563,7 @@ struct move_def : public build_base > /* According to rvv-intrinsic-doc, it does not add "_m" suffix > for vop_m C++ overloaded API. */ > -if (overloaded_p && instance.pred == PRED_TYPE_m) > +if (overloaded_p) Just make sure it's the right change? >

Re: Re: [PATCH v1] RISC-V: Implement RESOLVE_OVERLOADED_BUILTIN for RVV intrinsic

2023-09-11 Thread juzhe.zh...@rivai.ai
>> Just make sure it's the right change? It seem incorrect to me. More comments (I just reviewed again): +tree +function_resolver::lookup () +{ + unsigned int code_limit = vec_safe_length (registered_functions); + + for (unsigned code = get_sub_code () + 1; code < code_limit; code++) +{ +

[PATCH] RISC-V: Remove redundant functions

2023-09-11 Thread Juzhe-Zhong
I just finished V2 version of LMUL cost model. Turns out we don't these redundant functions. Remove them. gcc/ChangeLog: * config/riscv/riscv-protos.h (get_all_predecessors): Remove. (get_all_successors): Ditto. * config/riscv/riscv-v.cc (get_all_predecessors): Ditto.

Re: [PATCH] RISC-V: Remove redundant functions

2023-09-11 Thread Kito Cheng via Gcc-patches
LGTM On Mon, Sep 11, 2023 at 5:20 PM Juzhe-Zhong wrote: > > I just finished V2 version of LMUL cost model. > Turns out we don't these redundant functions. > > Remove them. > > gcc/ChangeLog: > > * config/riscv/riscv-protos.h (get_all_predecessors): Remove. > (get_all_successors):

[PATCH V2] RISC-V: Support Dynamic LMUL Cost model

2023-09-11 Thread Juzhe-Zhong
This patch support dynamic LMUL cost modeling with --param=riscv-autovec-lmul=dynamic. Consider this following case: void foo (int32_t *__restrict a, int32_t *__restrict b,int32_t *__restrict c, int32_t *__restrict a2, int32_t *__restrict b2, int32_t *__restrict c2, int32_t *__res

[PATCH V3] RISC-V: Support Dynamic LMUL Cost model

2023-09-11 Thread Juzhe-Zhong
This patch support dynamic LMUL cost modeling with --param=riscv-autovec-lmul=dynamic. Consider this following case: void foo (int32_t *__restrict a, int32_t *__restrict b,int32_t *__restrict c, int32_t *__restrict a2, int32_t *__restrict b2, int32_t *__restrict c2, int32_t *__res

RE: [PATCH] RISC-V: Remove redundant functions

2023-09-11 Thread Li, Pan2 via Gcc-patches
Committed, thanks Kito. Pan -Original Message- From: Gcc-patches On Behalf Of Kito Cheng via Gcc-patches Sent: Monday, September 11, 2023 5:26 PM To: Juzhe-Zhong Cc: gcc-patches@gcc.gnu.org; kito.ch...@gmail.com Subject: Re: [PATCH] RISC-V: Remove redundant functions LGTM On Mon, Sep

Re: [PATCH 2/2] libstdc++: Add dg-require-thread-fence in several tests

2023-09-11 Thread Jonathan Wakely via Gcc-patches
On Sun, 10 Sept 2023 at 20:31, Christophe Lyon wrote: > > Some targets like arm-eabi with newlib and default settings rely on > __sync_synchronize() to ensure synchronization. Newlib does not > implement it by default, to make users aware they have to take special > care. > > This makes a few tes

[PATCH] libstdc++: Check if getent is available in git config script [PR111359]

2023-09-11 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, powerpc-aix, and minimally tested on macOS 12.6 (darwin 21.6.0). OK for trunk? -- >8 -- contrib/ChangeLog: PR other/111359 * gcc-git-customization.sh: Check for getent before using it. Use id on macOS. --- contrib/gcc-git-customization.sh | 6 +-

Re: [PATCH] libstdc++: Check if getent is available in git config script [PR111359]

2023-09-11 Thread Jakub Jelinek via Gcc-patches
On Mon, Sep 11, 2023 at 12:06:19PM +0100, Jonathan Wakely via Gcc-patches wrote: > Tested x86_64-linux, powerpc-aix, and minimally tested on macOS 12.6 > (darwin 21.6.0). > > OK for trunk? > > -- >8 -- > > contrib/ChangeLog: > > PR other/111359 > * gcc-git-customization.sh: Check fo

[Patch] OpenMP (C only): omp allocate - extend parsing support, improve diagnostic (was: [Patch] OpenMP (C only): omp allocate - handle stack vars, improve diagnostic)

2023-09-11 Thread Tobias Burnus
The patch adds more check and fixes some minor FE bits, but it now has a 'sorry' for automatic/stack variables in the middle end. I think it is useful by itself as it completes the C FE part and adds diagnostic, even if the actual code generation is disabled. Comments, remarks, suggestions? The

Re: [PATCH] [11/12/13/14 Regression] ABI break in _Hash_node_value_base since GCC 11 [PR 111050]

2023-09-11 Thread Jonathan Wakely via Gcc-patches
On Sun, 10 Sept 2023 at 14:57, François Dumont via Libstdc++ wrote: > > Following confirmation of the fix by TC here is the patch where I'm > simply adding a 'constexpr' on _M_next(). > > Please let me know this ChangeLog entry is correct. I would prefer this > patch to be assigned to 'TC' with me

Re: [Patch] OpenMP (C only): omp allocate - extend parsing support, improve diagnostic (was: [Patch] OpenMP (C only): omp allocate - handle stack vars, improve diagnostic)

2023-09-11 Thread Jakub Jelinek via Gcc-patches
Hi! One question to David below, CCed. On Mon, Sep 11, 2023 at 01:44:07PM +0200, Tobias Burnus wrote: > --- a/gcc/c/c-decl.cc > +++ b/gcc/c/c-decl.cc > @@ -681,6 +681,11 @@ decl_jump_unsafe (tree decl) >if (VAR_P (decl) && C_DECL_COMPOUND_LITERAL_P (decl)) > return false; > > + if (fl

RE: Re: [PATCH v1] RISC-V: Implement RESOLVE_OVERLOADED_BUILTIN for RVV intrinsic

2023-09-11 Thread Li, Pan2 via Gcc-patches
> -if (overloaded_p && instance.pred == PRED_TYPE_m) > +if (overloaded_p) Thanks for pointing this out, my misunderstanding for policy function result in this change as mistake, will send V2 for this. > Plz change it into : Actually, it is not easy to convert to this approach as aarc

RE: [PATCH v1] RISC-V: Implement RESOLVE_OVERLOADED_BUILTIN for RVV intrinsic

2023-09-11 Thread Li, Pan2 via Gcc-patches
> No. You must construct instance. 'strcmp' is very ugly. Strcmp here is defensive code here for early exit if not found (can be removed for correctness), which is not required to find the right declaration. Pan From: juzhe.zhong Sent: Monday, September 11, 2023 8:20 PM To: Li, Pan2 Cc: kito.

Re: [PATCH 2/2] libstdc++: Add dg-require-thread-fence in several tests

2023-09-11 Thread Christophe Lyon via Gcc-patches
On Mon, 11 Sept 2023 at 12:59, Jonathan Wakely wrote: > On Sun, 10 Sept 2023 at 20:31, Christophe Lyon > wrote: > > > > Some targets like arm-eabi with newlib and default settings rely on > > __sync_synchronize() to ensure synchronization. Newlib does not > > implement it by default, to make us

[PATCH] fortran: Undo new symbols in all namespaces [PR110996]

2023-09-11 Thread Mikael Morin via Gcc-patches
Hello, this fixes a memory management issue in the fortran frontend. I have included the (reduced) testcase from the PR, even if it wasn't failing here on x86_64 with the test harness. Tested on x86_64-pc-linux-gnu and manually checked the testcase with valgrind. OK for master? -- >8 -- Remove n

Re: [PATCH] libgomp: Fix build for -fshort-enums

2023-09-11 Thread Sebastian Huber
On 04.07.23 08:20, Sebastian Huber wrote: On 22.05.23 14:51, Sebastian Huber wrote: Make sure that the API enums have at least the size of int.  Otherwise the following build error may occur: In file included from gcc/libgomp/env.c:34: ./libgomp_f.h: In function 'omp_check_defines': ./libgomp_

Re: [PATCH] libatomic: Provide gthr.h default implementation

2023-09-11 Thread Sebastian Huber
On 31.05.23 09:27, Richard Biener wrote: On Wed, May 31, 2023 at 7:31 AM Sebastian Huber wrote: On 30.05.23 13:17, Richard Biener wrote: The alternative would be to provide the required subset of atomic library functions from libgcov.a and emit calls to that directly? The locked data isn't pa

Re: RE: [PATCH v1] RISC-V: Implement RESOLVE_OVERLOADED_BUILTIN for RVV intrinsic

2023-09-11 Thread 钟居哲
function_instance get_read_vl_instance (void) { return function_instance ("read_vl", bases::read_vl, shapes::read_vl, none_ops[0], PRED_TYPE_none, &p_none_void_ops); } tree get_read_vl_decl (void) { function_instance instance = get_read_vl_instance (); hashval_t hash = instance.has

Re: [Patch] OpenMP (C only): omp allocate - extend parsing support, improve diagnostic (was: [Patch] OpenMP (C only): omp allocate - handle stack vars, improve diagnostic)

2023-09-11 Thread David Malcolm via Gcc-patches
On Mon, 2023-09-11 at 13:54 +0200, Jakub Jelinek wrote: > Hi! > > One question to David below, CCed. > > On Mon, Sep 11, 2023 at 01:44:07PM +0200, Tobias Burnus wrote: [...] > > > + > > + if (DECL_SOURCE_LOCATION (allocator) > > > DECL_SOURCE_LOCATION (var)) > > +   { > > +

Re: [PATCH] RISC-V: Enable RVV scalable vectorization by default[PR111311]

2023-09-11 Thread Jeff Law via Gcc-patches
On 9/10/23 21:42, juzhe.zh...@rivai.ai wrote: Ping this patch. I think it's time to enable scalable vectorization by default and do the whole regression every time (except vect.exp that we didn't enable yet) Update current FAILs status: Real FAILS (ICE and execution FAIL): FAIL: gcc.dg/p

Re: [PATCH 2/2] libstdc++: Add dg-require-thread-fence in several tests

2023-09-11 Thread Jonathan Wakely via Gcc-patches
On Mon, 11 Sept 2023 at 13:36, Christophe Lyon wrote: > > > > On Mon, 11 Sept 2023 at 12:59, Jonathan Wakely wrote: >> >> On Sun, 10 Sept 2023 at 20:31, Christophe Lyon >> wrote: >> > >> > Some targets like arm-eabi with newlib and default settings rely on >> > __sync_synchronize() to ensure syn

Re: [Patch] OpenMP (C only): omp allocate - extend parsing support, improve diagnostic (was: [Patch] OpenMP (C only): omp allocate - handle stack vars, improve diagnostic)

2023-09-11 Thread Tobias Burnus
Hi, thanks for the comments and for the line-number thing. (I wanted to re-check it myself but then totally forgot about it.) Attached is the updated patch, fixing the line-number comparison, the C++ addition to the enum decl in two of the testcases, and adding "allocator" to the one inform (bot

RE: [PATCH] RISC-V: Enable RVV scalable vectorization by default[PR111311]

2023-09-11 Thread Li, Pan2 via Gcc-patches
Committed, thanks Jeff. Pan -Original Message- From: Gcc-patches On Behalf Of Jeff Law via Gcc-patches Sent: Monday, September 11, 2023 9:12 PM To: juzhe.zh...@rivai.ai; gcc-patches Cc: Kito.cheng ; kito.cheng Subject: Re: [PATCH] RISC-V: Enable RVV scalable vectorization by default[

Re: [PATH] [CLEANUP] Remove trailing whitespace characters

2023-09-11 Thread David Malcolm via Gcc-patches
On Sun, 2023-09-10 at 16:36 +0200, Guillaume Gomez wrote: > When going through the code, I saw a lot of trailing whitespace > characters so I decided to write a small script that would remove > them. I didn't expect there would be so many though... Not sure if > patch with so many changes are accep

Re: [PATH] [CLEANUP] Remove trailing whitespace characters

2023-09-11 Thread Guillaume Gomez via Gcc-patches
Hi David. Thanks for the feedback! Well, I think at this point, better to get "global approval" on the idea and on what you suggested (which I agree with) before I make any additional changes considering how big the patch is. Let's wait for others to also express their opinion here.

Re: [Patch] OpenMP (C only): omp allocate - extend parsing support, improve diagnostic (was: [Patch] OpenMP (C only): omp allocate - handle stack vars, improve diagnostic)

2023-09-11 Thread Jakub Jelinek via Gcc-patches
On Mon, Sep 11, 2023 at 03:21:54PM +0200, Tobias Burnus wrote: > + if (TREE_STATIC (var)) > + { > + if (allocator == NULL_TREE && allocator_loc == UNKNOWN_LOCATION) > + error_at (loc, "% clause required for " > +"static variable %qD", var); > + e

Re: [PATH] [CLEANUP] Remove trailing whitespace characters

2023-09-11 Thread Jakub Jelinek via Gcc-patches
On Mon, Sep 11, 2023 at 09:27:48AM -0400, David Malcolm via Gcc-patches wrote: > On Sun, 2023-09-10 at 16:36 +0200, Guillaume Gomez wrote: > > When going through the code, I saw a lot of trailing whitespace > > characters so I decided to write a small script that would remove > > them. I didn't exp

[PATCH v2 1/2] c++: Initial support for P0847R7 (Deducing This) [PR102609]

2023-09-11 Thread waffl3x via Gcc-patches
Bootstrapped and tested on x86_64-linux with no regressions. Hopefully I fixed all the issues. I also took the opportunity to remove the small mistake present in v1, so that is no longer a concern. Thanks again for all the patience. -AlexFrom 0db52146880faf20e7a7b786dad47c686a5f26d6 Mon Sep 17

Re: [PATCH 2/2] libstdc++: Add dg-require-thread-fence in several tests

2023-09-11 Thread Christophe Lyon via Gcc-patches
On Mon, 11 Sept 2023 at 15:12, Jonathan Wakely wrote: > On Mon, 11 Sept 2023 at 13:36, Christophe Lyon > wrote: > > > > > > > > On Mon, 11 Sept 2023 at 12:59, Jonathan Wakely > wrote: > >> > >> On Sun, 10 Sept 2023 at 20:31, Christophe Lyon > >> wrote: > >> > > >> > Some targets like arm-eabi

[committed] libstdc++: Formatting std::thread::id and std::stacktrace (P2693R1)

2023-09-11 Thread Jonathan Wakely via Gcc-patches
Tested aarch64-linux. Pushed to trunk. -- >8 -- New std::formatter specializations for C++23. libstdc++-v3/ChangeLog: * include/bits/version.def (__cpp_lib_formatters): Define. * include/bits/version.h: Regenerate. * include/std/stacktrace (formatter) (formatter>

Re: [PATCH 1/2] c++: refine dependent_alias_template_spec_p [PR90679]

2023-09-11 Thread Patrick Palka via Gcc-patches
On Thu, 1 Jun 2023, Patrick Palka wrote: > For a complex alias template-id, dependent_alias_template_spec_p returns > true if any template argument of the template-id is dependent. This > predicate indicates that substitution into the template-id may behave > differently with respect to SFINAE th

Re: [PATCH 2/2] c++: partial ordering and dep alias tmpl specs [PR90679]

2023-09-11 Thread Patrick Palka via Gcc-patches
On Thu, 1 Jun 2023, Patrick Palka wrote: > During partial ordering, we want to look through dependent alias > template specializations within template arguments and otherwise > treat them as opaque in other contexts (see e.g. r7-7116-g0c942f3edab108 > and r11-7011-g6e0a231a4aa240). To that end te

Re: [PATCH] analyzer: Move gcc.dg/analyzer tests to c-c++-common (2) [PR96395]

2023-09-11 Thread Christophe Lyon via Gcc-patches
Hi! On Wed, 6 Sept 2023 at 22:22, David Malcolm via Gcc-patches < gcc-patches@gcc.gnu.org> wrote: > On Wed, 2023-09-06 at 15:50 +0200, Benjamin Priour wrote: > > Hi David, > > Thanks for the review. > > > > > > > > On Tue, Sep 5, 2023 at 1:53 PM David Malcolm > > wrote: > > > > > On Mon, 2023-0

[PATCH] MATCH: [PR111349] add missing :c to cmp in the `(a CMP CST1) ? max : a` pattern

2023-09-11 Thread Andrew Pinski via Gcc-patches
When I added this pattern in r14-1411-g17cca3c43e2f49, I had missed the :c on the cmp part of the pattern meaning there might be some missing optimizations happening. The testcase shows an example of the missed optmization. Committed as obvious after a bootstrap/test on x86_64-linux-gnu.

[COMMITTED] gccrs: move functions from rust-gcc-diagnostics to rust-diagnostics.cc

2023-09-11 Thread Arthur Cohen
From: Parthib <94271200+parthib...@users.noreply.github.com> gcc/rust/ChangeLog: * Make-lang.in: Removed rust-gcc-diagnostics object file. * rust-diagnostics.cc (rust_be_get_quotechars): Added from original file. (rust_be_internal_error_at): Likewise.

Re: [PATH] [CLEANUP] Remove trailing whitespace characters

2023-09-11 Thread Eric Gallager via Gcc-patches
On Mon, Sep 11, 2023 at 9:43 AM Jakub Jelinek via Gcc-patches wrote: > > On Mon, Sep 11, 2023 at 09:27:48AM -0400, David Malcolm via Gcc-patches wrote: > > On Sun, 2023-09-10 at 16:36 +0200, Guillaume Gomez wrote: > > > When going through the code, I saw a lot of trailing whitespace > > > characte

Re: [PATH] [CLEANUP] Remove trailing whitespace characters

2023-09-11 Thread Arthur Cohen
On 9/11/23 16:43, Eric Gallager via Gcc-patches wrote: On Mon, Sep 11, 2023 at 9:43 AM Jakub Jelinek via Gcc-patches wrote: On Mon, Sep 11, 2023 at 09:27:48AM -0400, David Malcolm via Gcc-patches wrote: On Sun, 2023-09-10 at 16:36 +0200, Guillaume Gomez wrote: When going through the code, I

Re: [PATCH v2] libstdc++: Define _GLIBCXX_HAS_BUILTIN_TRAIT

2023-09-11 Thread Jonathan Wakely via Gcc-patches
On Thu, 31 Aug 2023 at 13:33, Ken Matsui wrote: > > On Tue, Aug 8, 2023 at 1:23 PM Jonathan Wakely wrote: > > > > > > > > On Wed, 19 Jul 2023 at 20:33, Ken Matsui via Libstdc++ > > wrote: > >> > >> This patch defines _GLIBCXX_HAS_BUILTIN_TRAIT macro, which will be used > >> as a flag to toggle

Re: [PATCH v2] libstdc++: Define _GLIBCXX_HAS_BUILTIN_TRAIT

2023-09-11 Thread Ken Matsui via Gcc-patches
On Mon, Sep 11, 2023 at 7:51 AM Jonathan Wakely wrote: > > On Thu, 31 Aug 2023 at 13:33, Ken Matsui wrote: > > > > On Tue, Aug 8, 2023 at 1:23 PM Jonathan Wakely wrote: > > > > > > > > > > > > On Wed, 19 Jul 2023 at 20:33, Ken Matsui via Libstdc++ > > > wrote: > > >> > > >> This patch defines

Re: [PATCH 2/2] libstdc++: Add dg-require-thread-fence in several tests

2023-09-11 Thread Jonathan Wakely via Gcc-patches
On Mon, 11 Sept 2023 at 14:57, Christophe Lyon wrote: > > > > On Mon, 11 Sept 2023 at 15:12, Jonathan Wakely wrote: >> >> On Mon, 11 Sept 2023 at 13:36, Christophe Lyon >> wrote: >> > >> > >> > >> > On Mon, 11 Sept 2023 at 12:59, Jonathan Wakely wrote: >> >> >> >> On Sun, 10 Sept 2023 at 20:31,

RE: RE: [PATCH v1] RISC-V: Implement RESOLVE_OVERLOADED_BUILTIN for RVV intrinsic

2023-09-11 Thread Li, Pan2 via Gcc-patches
For function instance with void or void arguments, it is easy as you mentioned as below. For generate API (to get the right hash), you need to build the rvv_type_info, predications_type_index and rvv_op_info from the arglist (aka vec) from hook. Then we need to construct above parameters from o

Re: [PATCH 2/2] libstdc++: Add dg-require-thread-fence in several tests

2023-09-11 Thread Richard Earnshaw (lists) via Gcc-patches
On 11/09/2023 16:22, Jonathan Wakely via Gcc-patches wrote: > On Mon, 11 Sept 2023 at 14:57, Christophe Lyon > wrote: >> >> >> >> On Mon, 11 Sept 2023 at 15:12, Jonathan Wakely wrote: >>> >>> On Mon, 11 Sept 2023 at 13:36, Christophe Lyon >>> wrote: On Mon, 11 Sept 2023 at 12

[PATCH] libstdc++ Use _GLIBCXX_USE_BUILTIN_TRAIT

2023-09-11 Thread Ken Matsui via Gcc-patches
This patch uses _GLIBCXX_USE_BUILTIN_TRAIT macro instead of __has_builtin in the type_traits header for traits that have a corresponding fallback non-built-in implementation. This macro supports to toggle the use of built-in traits in the type_traits header through _GLIBCXX_DO_NOT_USE_BUILTIN_TRAIT

Re: [PATCH 2/2] libstdc++: Add dg-require-thread-fence in several tests

2023-09-11 Thread Christophe Lyon via Gcc-patches
On Mon, 11 Sept 2023 at 17:22, Jonathan Wakely wrote: > On Mon, 11 Sept 2023 at 14:57, Christophe Lyon > wrote: > > > > > > > > On Mon, 11 Sept 2023 at 15:12, Jonathan Wakely > wrote: > >> > >> On Mon, 11 Sept 2023 at 13:36, Christophe Lyon > >> wrote: > >> > > >> > > >> > > >> > On Mon, 11 Se

Re: [PATCH] libstdc++ Use _GLIBCXX_USE_BUILTIN_TRAIT

2023-09-11 Thread Patrick Palka via Gcc-patches
On Mon, 11 Sep 2023, Ken Matsui via Gcc-patches wrote: > This patch uses _GLIBCXX_USE_BUILTIN_TRAIT macro instead of __has_builtin in > the type_traits header for traits that have a corresponding fallback > non-built-in implementation. This macro supports to toggle the use of built-in > traits in

Re: [PATCH] s390: Fix builtins vec_rli and verll

2023-09-11 Thread Andreas Krebbel via Gcc-patches
On 9/11/23 08:56, Stefan Schulze Frielinghaus wrote: > On Mon, Aug 28, 2023 at 11:33:37AM +0200, Andreas Krebbel wrote: >> Hi Stefan, >> >> do you really need to introduce a new flag for U64 given that the type of >> the builtin is unsigned long? > > In function s390_const_operand_ok the immediat

[committed] libstdc++: Move __glibcxx_assert_fail to its own file

2023-09-11 Thread Jonathan Wakely via Gcc-patches
Tested aarch64-linux. Pushed to trunk. Maybe worth backporting too. -- >8 -- This avoids a dependency on the other symbols in src/c++11/debug.o when linking statically to libstdc++.a without using -Wl,--gc-sections. libstdc++-v3/ChangeLog: * src/c++11/Makefile.am: Add new file.

[committed] libstdc++: Remove unconditional use of atomics in Debug Mode

2023-09-11 Thread Jonathan Wakely via Gcc-patches
Tested aarch64-linux. Pushed to trunk. Probably worth backporting too. -- >8 -- The fix for PR 91910 (r10-3426-gf7a3a382279585) introduced unconditional uses of atomics into src/c++11/debug.cc, which causes linker errors for arm4t where GCC emits an unresolved reference to __sync_synchronize. B

Re: [PATCH 2/2] libstdc++: Add dg-require-thread-fence in several tests

2023-09-11 Thread Jonathan Wakely via Gcc-patches
On Mon, 11 Sept 2023 at 16:40, Christophe Lyon wrote: > > > > On Mon, 11 Sept 2023 at 17:22, Jonathan Wakely wrote: >> >> On Mon, 11 Sept 2023 at 14:57, Christophe Lyon >> wrote: >> > >> > >> > >> > On Mon, 11 Sept 2023 at 15:12, Jonathan Wakely wrote: >> >> >> >> On Mon, 11 Sept 2023 at 13:36,

[PATCH 01/13] libstdc++: Add support for running tests with multiple -std options

2023-09-11 Thread Jonathan Wakely via Gcc-patches
This copies the code from the compiler's gcc/testsuite/lib/g++-dg.exp so that each test can be run multiple times, with different -std options. This means that we can remove most { dg-options "-std=gnu++20" } directives from tests, because the testsuite will automatically select a set of -std optio

[PATCH 00/13] libstdc++: Add support for running tests with multiple -std options

2023-09-11 Thread Jonathan Wakely via Gcc-patches
This patch series replicates the behaviour of the g++ testsuite, so that libstdc++ tests can easily be run for multiple different -std options in a single testsuite run. As described in the updated docs, the -std options to use for every test can be overridden by setting v3_std_list in ~/.dejagnur

[PATCH 03/13] libstdc++: Replace dg-options "-std=c++17" with dg-add-options strict_std

2023-09-11 Thread Jonathan Wakely via Gcc-patches
These tests can (and should) also be run for later standards, so replace the { dg-options "-std=c++17" } with { dg-add-options strict_std }. * testsuite/tr1/5_numerical_facilities/special_functions/07_conf_hyperg/compile_cxx17.cc: Replace dg-options -std=c++17 with dg-add-options

[PATCH 06/13] libstdc++: Remove dg-options "-std=gnu++20" from and tests

2023-09-11 Thread Jonathan Wakely via Gcc-patches
The testsuite will automatically select C++20 for these tests now, and removing the hardcoded -std option allows them to be tested for C++23 and C++26 as well. libstdc++-v3/ChangeLog: * testsuite/std/concepts/1.cc: Remove dg-options. * testsuite/std/concepts/2.cc: Likewise.

[PATCH 13/13] libstdc++: Simplify dejagnu directives for some tests using threads

2023-09-11 Thread Jonathan Wakely via Gcc-patches
Replace dg-require-effective-target directives with a target selector on the dg-do directive. We can also remove { dg-require-effective-target pthread } and the associated { dg-options "-pthread" } by allowing it to run on non-pthread targets and conditionally adding -pthread only for pthread targ

[PATCH 04/13] libstdc++: Replace dg-options "-std=c++20" with dg-add-options strict_std

2023-09-11 Thread Jonathan Wakely via Gcc-patches
The testsuite will automatically select C++20 for these tests now, and removing the hardcoded -std option allows them to be tested for C++23 and C++26 as well. Because they test a problem seen with -std=c++20 add the new { dg-add-options strict_std } directive so that the test runner uses -std=c++N

[PATCH 07/13] libstdc++: Remove dg-options "-std=gnu++2a" from constrained algo tests

2023-09-11 Thread Jonathan Wakely via Gcc-patches
The testsuite will automatically select C++20 for these tests now, and removing the hardcoded -std option allows them to be tested for C++23 and C++26 as well. libstdc++-v3/ChangeLog: * testsuite/20_util/function_objects/range.cmp/equal_to.cc: Remove dg-options. * testsuit

[PATCH 02/13] libstdc++: Replace dg-options "-std=c++11" with dg-add-options strict_std

2023-09-11 Thread Jonathan Wakely via Gcc-patches
These tests can (and should) also be run for later standards, so replace the { dg-options "-std=c++11" } with { dg-add-options strict_std } and a target selector for c++11. libstdc++-v3/ChangeLog: * testsuite/23_containers/deque/48101-2_neg.cc: Replace dg-options with target selec

[PATCH 09/13] libstdc++: Remove dg-options "-std=gnu++20" from std::chrono tests

2023-09-11 Thread Jonathan Wakely via Gcc-patches
The testsuite will automatically select C++20 for these tests now, and removing the hardcoded -std option allows them to be tested for C++23 and C++26 as well. libstdc++-v3/ChangeLog: * testsuite/20_util/duration/arithmetic/overflow_c++20.cc: Remove dg-options. * testsuite

[PATCH 12/13] libstdc++: Remove dg-options "-std=gnu++2a" from XFAIL std::span tests

2023-09-11 Thread Jonathan Wakely via Gcc-patches
The testsuite will automatically select C++20 for these tests now, and removing the hardcoded -std option allows them to be tested for C++23 and C++26 as well. We can also combine the { dg-require-effective-target c++2a } directive with the dg-do selector. We need to add the no_pch options for te

[PATCH 05/13] libstdc++: Remove dg-options "-std=c++20" from and tests

2023-09-11 Thread Jonathan Wakely via Gcc-patches
The testsuite will automatically select C++20 for these tests now, and removing the hardcoded -std option allows them to be tested for C++23 and C++26 as well. There doesn't seem to be any reason they need to use strict -std=c++20 mode, so don't add the { dg-add-options strict_std } directive, jus

[PATCH 08/13] libstdc++: Remove dg-options "-std=gnu++20" from std::format tests

2023-09-11 Thread Jonathan Wakely via Gcc-patches
The testsuite will automatically select C++20 for these tests now, and removing the hardcoded -std option allows them to be tested for C++23 and C++26 as well. libstdc++-v3/ChangeLog: * testsuite/std/format/arguments/args.cc: Remove dg-options. * testsuite/std/format/arguments/lwg

RISC-V: Replace not + bitwise_imm with li + bitwise_not

2023-09-11 Thread Jivan Hakobyan via Gcc-patches
In the case when we have C code like this int foo (int a) { return 100 & ~a; } GCC generates the following instruction sequence foo: not a0,a0 andia0,a0,100 ret This patch replaces that with this sequence foo: li a5,100 andn a0,a5,a0 ret The profitabili

[PATCH 10/13] libstdc++: Remove dg-options "-std=gnu++23" from std::expected tests

2023-09-11 Thread Jonathan Wakely via Gcc-patches
The testsuite will automatically select C++23 for these tests now, and removing the hardcoded -std option allows them to be tested for C++26 as well. libstdc++-v3/ChangeLog: * testsuite/20_util/expected/assign.cc: Remove dg-options. * testsuite/20_util/expected/bad.cc: Likewise.

[PATCH 11/13] libstdc++: Remove dg-options "-std=gnu++23" from remaining tests

2023-09-11 Thread Jonathan Wakely via Gcc-patches
The testsuite will automatically select C++23 for these tests now, and removing the hardcoded -std option allows them to be tested for C++26 as well. libstdc++-v3/ChangeLog: * testsuite/18_support/headers/limits/synopsis_cxx23.cc: Remove dg-options. * testsuite/18_support/

Re: [PATCH] analyzer: Move gcc.dg/analyzer tests to c-c++-common (2) [PR96395]

2023-09-11 Thread Benjamin Priour via Gcc-patches
Hi Christophe, On Mon, Sep 11, 2023 at 4:23 PM Christophe Lyon wrote: > Hi! > > > On Wed, 6 Sept 2023 at 22:22, David Malcolm via Gcc-patches < > gcc-patches@gcc.gnu.org> wrote: > >> On Wed, 2023-09-06 at 15:50 +0200, Benjamin Priour wrote: >> > Hi David, >> > Thanks for the review. >> > >> > >>

[PATCH 0/2] Optimize is_member_function_pointer trait performance

2023-09-11 Thread Ken Matsui via Gcc-patches
This patch series optimizes is_member_function_pointer trait performance. The first patch implements __is_member_function_pointer built-in trait. The second patch optimizes is_member_function_pointer trait performance by using __is_member_function_pointer built-in trait if available. The performan

[PATCH 2/2] libstdc++: Optimize is_member_function_pointer trait performance

2023-09-11 Thread Ken Matsui via Gcc-patches
This patch optimizes the performance of the is_member_function_pointer trait by dispatching to the new __is_member_function_pointer built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_member_function_pointer): Use __is_member_function_pointer built-in trait.

[PATCH 1/2] c++: Implement __is_member_function_pointer built-in trait

2023-09-11 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_member_function_pointer. gcc/cp/ChangeLog: * cp-trait.def (IS_MEMBER_FUNCTION_POINTER): Define __is_member_function_pointer. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_MEMBER_FUNCTION_POINTER. * se

Re: [PATCH] [11/12/13/14 Regression] ABI break in _Hash_node_value_base since GCC 11 [PR 111050]

2023-09-11 Thread François Dumont via Gcc-patches
On 11/09/2023 13:51, Jonathan Wakely wrote: On Sun, 10 Sept 2023 at 14:57, François Dumont via Libstdc++ wrote: Following confirmation of the fix by TC here is the patch where I'm simply adding a 'constexpr' on _M_next(). Please let me know this ChangeLog entry is correct. I would prefer thi

Re: [PATCH] RISC-V Add Types to Un-Typed Thead Instructions:

2023-09-11 Thread Edwin Lu
On 9/10/2023 8:37 AM, Jeff Law via Gcc-patches wrote: On 8/31/23 11:36, Edwin Lu wrote: Related Discussion: https://inbox.sourceware.org/gcc-patches/12fb5088-3f28-0a69-de1e-f387371a5...@gmail.com/ This patch updates the THEAD instructions to ensure that no insn is left without a type attribut

Re: [r14-3823 Regression] FAIL: c-c++-common/analyzer/compound-assignment-1.c -std=c++98 (test for warnings, line 72) on Linux/x86_64

2023-09-11 Thread Benjamin Priour via Gcc-patches
Hi, Thanks for the report, After investigation it seems the location of the new dejagnu directive for C++ differs depending on the configuration. The expected warning is still emitted, but its location differ slightly. I expect it to be not an issue per se of the analyzer, but a divergence in the

[PATCH] sccvn: Avoid ICEs on _BitInt load BIT_AND_EXPR mask [PR111338]

2023-09-11 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase ICEs, because vn_walk_cb_data::push_partial_def uses a fixed size buffer (64 target bytes) for its construction/deconstruction of partial stores and fails if larger precision than that is needed, and the PR93582 changes assert push_partial_def succeeds (and check the var

Re: [PATCH v2 1/5][Committed] RISC-V: Update Types for Vector Instructions

2023-09-11 Thread Edwin Lu
On 9/8/2023 4:56 PM, Jeff Law via Gcc-patches wrote: On 9/8/23 12:16, Edwin Lu wrote: This patch adds types to vector instructions that were added after or were missed by the original patch https://gcc.gnu.org/pipermail/gcc-patches/2023-August/628594.html gcc/ChangeLog: * config/riscv/a

[PATCH] small _BitInt tweaks

2023-09-11 Thread Jakub Jelinek via Gcc-patches
Hi! When discussing PR111369 with Andrew Pinski, I've realized that I haven't added BITINT_TYPE handling to range_check_type. Right now (unsigned) max + 1 == (unsigned) min for signed _BitInt,l so I think we don't need to do the extra hops for BITINT_TYPE (though possibly we don't need them for I

Re: [PATCH 3/5][Committed] RISC-V: Add Types to Un-Typed Zicond Instructions

2023-09-11 Thread Edwin Lu
On 9/7/2023 6:17 AM, Jeff Law via Gcc-patches wrote: On 9/6/23 18:42, Tsukasa OI via Gcc-patches wrote: Looks okay to me but will need to resolve merge conflicts after commit af88776caa20 ("RISC-V: Add support for 'XVentanaCondOps' reusing 'Zicond' support"). Sure.  We allow trival updates t

Re: [PATCH 4/5][Committed] RISC-V: Update Types for RISC-V Instructions

2023-09-11 Thread Edwin Lu
On 9/6/2023 4:23 PM, Kito Cheng via Gcc-patches wrote: LGTM Edwin Lu 於 2023年9月7日 週四 01:52 寫道: This patch adds types to riscv instructions that were added or were missed by the original patch https://gcc.gnu.org/pipermail/gcc-patches/2023-August/628996.html gcc/ChangeLog: * config/r

Re: [PATCH] fortran: Undo new symbols in all namespaces [PR110996]

2023-09-11 Thread Harald Anlauf via Gcc-patches
Hi Mikael, On 9/11/23 14:38, Mikael Morin via Gcc-patches wrote: Hello, this fixes a memory management issue in the fortran frontend. I have included the (reduced) testcase from the PR, even if it wasn't failing here on x86_64 with the test harness. Tested on x86_64-pc-linux-gnu and manually ch

[committed] i386: Handle CONST_WIDE_INT in output_pic_addr_const [PR111340]

2023-09-11 Thread Uros Bizjak via Gcc-patches
PR target/111340 gcc/ChangeLog: * config/i386/i386.cc (output_pic_addr_const): Handle CONST_WIDE_INT. Call output_addr_const for CASE_CONST_SCALAR_INT. gcc/testsuite/ChangeLog: * gcc.target/i386/pr111340.c: New test. Bootstrapped and regression tested on x86_64-linux-gnu {,-m32

Re: [PATCH] analyzer: implement symbolic value support for CPython plugin's refcnt checker [PR107646]

2023-09-11 Thread David Malcolm via Gcc-patches
On Sun, 2023-09-10 at 22:12 -0400, Eric Feng wrote: > On Thu, Sep 7, 2023 at 1:28 PM David Malcolm > wrote: > > > On Mon, 2023-09-04 at 22:13 -0400, Eric Feng wrote: > > [...snip...] > > > > > > I know you're emulating the old behavior I implemented way back in > > cpychecker, but I don't li

Re: RISC-V: Replace not + bitwise_imm with li + bitwise_not

2023-09-11 Thread Andrew Waterman via Gcc-patches
Note this is a size-speed tradeoff, as the Zcb extension has a 16-bit-wide C.NOT instruction. Might want to suppress this optimization when Zcb is present and the function is being optimized for size. On Mon, Sep 11, 2023 at 9:52 AM Jivan Hakobyan via Gcc-patches wrote: > > In the case when we

Re: [C PATCH 1/6 v2] c: reorganize recursive type checking

2023-09-11 Thread Joseph Myers
On Sun, 10 Sep 2023, Martin Uecker via Gcc-patches wrote: > Thanks Joseph, below is a a revised version of this patch > with slight additional changes to the comment of > tagged_types_tu_compatible_p. > > ok for trunk? The revised version of this patch is OK. -- Joseph S. Myers jos...@codesou

Re: [PATCH V3] RISC-V: Support Dynamic LMUL Cost model

2023-09-11 Thread Robin Dapp via Gcc-patches
Hi Juzhe, glad that we can use the dominator info directly. Could we move the calculation of the info to the beginning (if it's not available)? That makes it clearer that it's a prerequisite. Function comments look good now. Some general remarks kind of similar to v1: - I would prefer a hash

Re: [PATCH] gimple-match: Do not try UNCOND optimization with COND_LEN.

2023-09-11 Thread Robin Dapp via Gcc-patches
Hi, as Juzhe noticed in gcc.dg/pr92301.c there was still something missing in the last patch. The attached v2 makes sure we always have a COND_LEN operation before returning true and initializes len and bias even if they are unused. Bootstrapped and regtested on aarch64 and x86. Regards Robin

[PATCH] MATCH: [PR111348] add missing :c to cmp in the `(a CMP b) ? minmax : minmax` pattern

2023-09-11 Thread Andrew Pinski via Gcc-patches
When I added this pattern in r14-337-gc43819a9b4cd, I had missed the :c on the cmp part of the pattern meaning there might be some missing optimizations happening. The testcase shows an example of the missed optmization. Committed as obvious after a bootstrap/test on x86_64-linux-gnu. PR

Re: [r14-3823 Regression] FAIL: c-c++-common/analyzer/compound-assignment-1.c -std=c++98 (test for warnings, line 72) on Linux/x86_64

2023-09-11 Thread Jakub Jelinek via Gcc-patches
On Mon, Sep 11, 2023 at 07:27:57PM +0200, Benjamin Priour via Gcc-patches wrote: > Thanks for the report, > > After investigation it seems the location of the new dejagnu directive for > C++ differs depending on the configuration. > The expected warning is still emitted, but its location differ sl

[PING][PATCH 0/9] Add btf_decl_tag C attribute

2023-09-11 Thread David Faust via Gcc-patches
Ping. This series adds a new C language attribute for recording additional information in DWARF and BTF, similar to an existing attribute in clang. https://gcc.gnu.org/pipermail/gcc-patches/2023-July/624156.html There are components in c-family, dwarf, ctf and btf. Thanks. On 7/11/23 14:57, Dav

[PATCH 0/2] Optimize is_unbounded_array trait performance

2023-09-11 Thread Ken Matsui via Gcc-patches
This patch series optimizes is_unbounded_array trait performance. The first patch implements __is_unbounded_array built-in trait. The second patch optimizes is_unbounded_array trait performance by using __is_unbounded_array built-in trait if available. The performance improvement is shown in the f

[PATCH 1/2] c++: Implement __is_unbounded_array built-in trait

2023-09-11 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_unbounded_array. gcc/cp/ChangeLog: * cp-trait.def (IS_UNBOUNDED_ARRAY): Define __is_unbounded_array. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_UNBOUNDED_ARRAY. * semantics.cc (trait_expr_value): L

[PATCH 2/2] libstdc++: Optimize is_unbounded_array trait performance

2023-09-11 Thread Ken Matsui via Gcc-patches
This patch optimizes the performance of the is_unbounded_array trait by dispatching to the new __is_unbounded_array built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_unbounded_array_v): Use __is_unbounded_array built-in trait. Signed-off-by: Ken Matsui --- l

[PATCH] RISC-V: Finish Typing Un-Typed Instructions and Turn on Assert

2023-09-11 Thread Edwin Lu
Updates autovec instruction that was added after last patch and turns on the assert statement to ensure all new instructions have a type. * config/riscv/autovec-opt.md: Update type * config/riscv/riscv.cc (riscv_sched_variable_issue): Remove assert Signed-off-by: Edwin Lu --- gc

  1   2   >