[PATCH] Make graph dumps use graphviz format

2024-05-02 Thread Richard Biener
SLP build eventually uses graphds graphs, the following makes its dump use graphviz format so you can easily visualize it. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. * graphds.cc (dump_graph): Dump in graphviz format. --- gcc/graphds.cc | 17 ++--- 1 file ch

Re: [PATCH] PR middle-end/111701: signbit(x*x) vs -fsignaling-nans

2024-05-02 Thread Richard Biener
On Fri, Apr 26, 2024 at 10:19 AM Roger Sayle wrote: > > > This patch addresses PR middle-end/111701 where optimization of signbit(x*x) > using tree_nonnegative_p incorrectly eliminates a floating point > multiplication when the operands may potentially be signaling NaNs. > > The above bug fix also

Re: [PATCH] Update libbid according to the latest Intel Decimal Floating-Point Math Library.

2024-05-02 Thread Richard Biener
On Sun, Apr 28, 2024 at 7:53 AM liuhongt wrote: > > The Intel Decimal Floating-Point Math Library is available as open-source on > Netlib[1]. > > [1] https://www.netlib.org/misc/intel/. > > Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. > Ok for trunk? OK for trunk. Thanks, Richard.

Re: [PATCH] PR tree-opt/113673: Avoid load merging from potentially trapping additions.

2024-05-02 Thread Richard Biener
On Sun, Apr 28, 2024 at 11:11 AM Roger Sayle wrote: > > > This patch fixes PR tree-optimization/113673, a P2 ice-on-valid regression > caused by load merging of (ptr[0]<<8)+ptr[1] when -ftrapv has been > specified. When the operator is | or ^ this is safe, but for addition > of signed integer typ

Re: [PATCH v3 1/2] Driver: Add new -truncate option

2024-05-02 Thread Richard Biener
On Mon, Apr 29, 2024 at 1:27 AM Peter0x44 wrote: > > 29 Apr 2024 12:16:26 am Peter Damianov : > > > This commit adds a new option to the driver that truncates one file > > after > > linking. > > > > Tested likeso: > > > > $ gcc hello.c -c > > $ du -h hello.o > > 4.0K hello.o > > $ gcc hello.o -tr

RE: [PATCH] PR middle-end/111701: signbit(x*x) vs -fsignaling-nans

2024-05-02 Thread Roger Sayle
> From: Richard Biener > On Fri, Apr 26, 2024 at 10:19 AM Roger Sayle > wrote: > > > > This patch addresses PR middle-end/111701 where optimization of > > signbit(x*x) using tree_nonnegative_p incorrectly eliminates a > > floating point multiplication when the operands may potentially be signal

Re: [C PATCH] PR c/109618: ICE-after-error from error_mark_node.

2024-05-02 Thread Richard Biener
On Tue, Apr 30, 2024 at 5:14 PM Roger Sayle wrote: > > > On Tue, Apr 30, 2024 at 10:23 AM Roger Sayle > > wrote: > > > Hi Richard, > > > Thanks for looking into this. > > > > > > It’s not the call to size_binop_loc (for CEIL_DIV_EXPR) that's > > > problematic, but the call to fold_convert_loc (lo

[committed] libgomp: Add gfx90c, 1036 and 1103 declare variant tests

2024-05-02 Thread Jakub Jelinek
Hi! Recently -march=gfx{90c,1036,1103} support has been added, but corresponding changes weren't done in the testsuite. The following patch adds that. Tested on x86_64-linux (with fiji and gfx1103 devices; had to use OMP_DEFAULT_DEVICE=1 there, fiji doesn't really work due to LLVM dropping suppo

Re: [PATCH] PR middle-end/111701: signbit(x*x) vs -fsignaling-nans

2024-05-02 Thread Richard Biener
On Thu, May 2, 2024 at 11:34 AM Roger Sayle wrote: > > > > From: Richard Biener > > On Fri, Apr 26, 2024 at 10:19 AM Roger Sayle > > wrote: > > > > > > This patch addresses PR middle-end/111701 where optimization of > > > signbit(x*x) using tree_nonnegative_p incorrectly eliminates a > > > float

[PATCH] fix single argument static_assert

2024-05-02 Thread Marc Poulhiès
Single argument static_assert is C++17 only. gcc/ChangeLog: * value-range.h: fix static_assert to use 2 arguments. --- Ok for master? gcc/value-range.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/value-range.h b/gcc/value-range.h index f1c638f8cd0..934eec9e3

Re: [PATCH] fix single argument static_assert

2024-05-02 Thread Jakub Jelinek
On Thu, May 02, 2024 at 12:28:29PM +0200, Marc Poulhiès wrote: > Single argument static_assert is C++17 only. > > gcc/ChangeLog: > > * value-range.h: fix static_assert to use 2 arguments. > --- > > Ok for master? Yes. Jakub

Re: [PATCH] Silence two instances of -Wcalloc-transposed-args

2024-05-02 Thread Richard Biener
On Mon, Apr 29, 2024 at 1:48 AM Peter Damianov wrote: > > Signed-off-by: Peter Damianov > --- > > Fixes these warnings: > > ../../gcc/gcc/../libgcc/libgcov-util.c: In function 'void > tag_counters(unsigned int, int)': > ../../gcc/gcc/../libgcc/libgcov-util.c:214:59: warning: 'void* calloc(size_t

[PATCH v2] testsuite: Verify r0-r3 are extended with CMSE

2024-05-02 Thread Torbjörn SVENSSON
Add regression test to the existing zero/sign extend tests for CMSE to verify that r0, r1, r2 and r3 are properly extended, not just r0. boolCharShortEnumSecureFunc test is done using -O0 to ensure the instructions are in a predictable order. gcc/testsuite/ChangeLog: * gcc.target/arm/cms

RE: [PATCH v3] Internal-fn: Introduce new internal function SAT_ADD

2024-05-02 Thread Li, Pan2
> So he was responding for how to do it for the vectorizer and scalar parts. > Remember that the goal is not to introduce new gimple IL that can block other > optimizations. > The vectorizer already introduces new IL (various IFN) but this is fine as we > don't track things like ranges for > vect

Re: [COMMITTED] Reduce startup costs for Value_Range.

2024-05-02 Thread Ian Lance Taylor
On Wed, May 1, 2024 at 7:50 PM Andrew Pinski wrote: > > On Wed, May 1, 2024 at 7:40 PM Ian Lance Taylor wrote: > > > > On Wed, May 1, 2024 at 12:43 AM Aldy Hernandez wrote: > > > > > > gcc/ChangeLog: > > > > > > * ipa-fnsummary.cc (evaluate_properties_for_edge): Initialize > > > Value_R

[PATCH] libstdc++: Fix std::chrono::tzdb to work with vanguard format

2024-05-02 Thread Jonathan Wakely
I found some issues in the std::chrono::tzdb parser by testing the tzdata "vanguard" format, which uses new features that aren't enabled in the "main" and "rearguard" data formats. Since 2024a the keyword "minimum" is no longer valid for the FROM and TO fields in a Rule line, which means that "m"

Re: [PATCH] libstdc++: Fix std::chrono::tzdb to work with vanguard format

2024-05-02 Thread Jonathan Wakely
On Thu, 2 May 2024 at 12:24, Jonathan Wakely wrote: > > I found some issues in the std::chrono::tzdb parser by testing the > tzdata "vanguard" format, which uses new features that aren't enabled in > the "main" and "rearguard" data formats. > > Since 2024a the keyword "minimum" is no longer valid

[PATCH] libstdc++: Fix for -std=c++23 -ffreestanding [PR114866]

2024-05-02 Thread Jonathan Wakely
Tested x86_64-linux. It would also be possible to fix this with: #if ! _GLIBCXX_HOSTED template inline constexpr __is_shared_ptr = false; #endif But we would still need to guard the partial specializations that use shared_ptr and __shared_ptr. It seemed cleaner to just guard all uses of anythi

[PATCH] tree-optimization/114921 - _Float16 -> __bf16 isn't noop

2024-05-02 Thread Richard Biener
The vectorizer handles a _Float16 to __bf16 conversion through vectorizable_assignment, thinking it's a noop. The following fixes this by making the same-size check stricter, requiring the same vector component mode. Bootstrap & regtest running on x86_64-unknown-linux-gnu. I couldn't manage to p

Re: [PATCH] tree-optimization/114921 - _Float16 -> __bf16 isn't noop

2024-05-02 Thread Richard Biener
On Thu, 2 May 2024, Richard Biener wrote: > The vectorizer handles a _Float16 to __bf16 conversion through > vectorizable_assignment, thinking it's a noop. The following > fixes this by making the same-size check stricter, requiring > the same vector component mode. > > Bootstrap & regtest runni

[PATCH] tree-optimization/114921 - _Float16 -> __bf16 isn't noop

2024-05-02 Thread Richard Biener
The vectorizer handles a _Float16 to __bf16 conversion through vectorizable_assignment, thinking it's a noop. The following fixes this by making the same-size check stricter, requiring the same vector component mode. Posted again for the arm CI PR tree-optimization/114921 * tree-

[Backport] tree-optimization/114672 - WIDEN_MULT_PLUS_EXPR type mismatch

2024-05-02 Thread Richard Ball
Hi, Requesting permission to backport: https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=912753cc5f18d786e334dd425469fa7f93155661 to fix the issue listed here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114672 in gcc-12 and gcc-13. Thanks, Richard

Re: [Backport] tree-optimization/114672 - WIDEN_MULT_PLUS_EXPR type mismatch

2024-05-02 Thread Richard Biener
On Thu, 2 May 2024, Richard Ball wrote: > Hi, > > Requesting permission to backport: > https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=912753cc5f18d786e334dd425469fa7f93155661 > to fix the issue listed here: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114672 > in gcc-12 and gcc-13. I'm fine w

[pushed] Objective-C, NeXT, v2: Correct a regression in code-gen.

2024-05-02 Thread Iain Sandoe
My testing of the GCC-14 release branch revealed an Objective-C regression in code-gen, the fix has been tested on x86_64, i686 and powerpc darwin, pushed to trunk. I will shortly apply this to the open branches, since they are affected too. Given that this is completely local to Darwin and Objec

Re: [PATCH] rust: Add rust.install-dvi and rust.install-html rules

2024-05-02 Thread Arthur Cohen
On 4/29/24 15:30, Christophe Lyon wrote: On Mon, 29 Apr 2024 at 15:24, Arthur Cohen wrote: Thanks Christophe! I've added your patch as part of a documentation pull-request I'm adding to our dev repo: https://github.com/Rust-GCC/gccrs/pull/2966 It'll be upstreamed with the next batch of co

RE: [PATCH v3] Internal-fn: Introduce new internal function SAT_ADD

2024-05-02 Thread Tamar Christina
> > So he was responding for how to do it for the vectorizer and scalar parts. > > Remember that the goal is not to introduce new gimple IL that can block > > other > optimizations. > > The vectorizer already introduces new IL (various IFN) but this is fine as > > we don't > track things like ran

Re: [PATCH] MATCH: Maybe expand (T)(A + C1) * C2 and (T)(A + C1) * C2 + C3 [PR109393]

2024-05-02 Thread Richard Biener
On Tue, 23 Apr 2024, Manolis Tsamis wrote: > The original motivation for this pattern was that the following function does > not fold to 'return 1': > > int foo(int *a, int j) > { > int k = j - 1; > return a[j - 1] == a[k]; > } > > The expression ((unsigned long) (X +- C1) * C2) appears freq

Re: [pushed] Objective-C, NeXT, v2: Correct a regression in code-gen.

2024-05-02 Thread Jakub Jelinek
On Thu, May 02, 2024 at 01:53:21PM +0100, Iain Sandoe wrote: > My testing of the GCC-14 release branch revealed an Objective-C > regression in code-gen, the fix has been tested on x86_64, i686 > and powerpc darwin, pushed to trunk. > > I will shortly apply this to the open branches, since they are

Re: [PATCH] MATCH: Maybe expand (T)(A + C1) * C2 and (T)(A + C1) * C2 + C3 [PR109393]

2024-05-02 Thread Manolis Tsamis
On Thu, May 2, 2024 at 4:00 PM Richard Biener wrote: > > On Tue, 23 Apr 2024, Manolis Tsamis wrote: > > > The original motivation for this pattern was that the following function > > does > > not fold to 'return 1': > > > > int foo(int *a, int j) > > { > > int k = j - 1; > > return a[j - 1] =

[PATCH] Improve SLP dump and graph

2024-05-02 Thread Richard Biener
The following notes which lanes are considered live and adds an overload to produce a graphviz graph for multiple entries into an SLP graph. Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. * tree-vect-slp.cc (vect_print_slp_tree): Mark live lanes. (dot_slp_tree): Ne

[PATCH][v3] tree-optimization/114921 - _Float16 -> __bf16 isn't noop

2024-05-02 Thread Richard Biener
The vectorizer handles a _Float16 to __bf16 conversion through vectorizable_assignment, thinking it's a noop. The following fixes this by requiring the same vector component mode when checking for CONVERT_EXPR_CODE_P, being stricter than for VIEW_CONVERT_EXPR. This variant splits the check for VI

Re: [PATCH] MATCH: Maybe expand (T)(A + C1) * C2 and (T)(A + C1) * C2 + C3 [PR109393]

2024-05-02 Thread Richard Biener
On Thu, 2 May 2024, Manolis Tsamis wrote: > On Thu, May 2, 2024 at 4:00 PM Richard Biener wrote: > > > > On Tue, 23 Apr 2024, Manolis Tsamis wrote: > > > > > The original motivation for this pattern was that the following function > > > does > > > not fold to 'return 1': > > > > > > int foo(int

cfgrtl: Fix MEM_EXPR update in duplicate_insn_chain [PR114924]

2024-05-02 Thread Alex Coplan
Hi, The PR shows that when cfgrtl.cc:duplicate_insn_chain attempts to update the MR_DEPENDENCE_CLIQUE information for a MEM_EXPR we can end up accidentally dropping (e.g.) an ARRAY_REF from the MEM_EXPR and end up replacing it with the underlying MEM_REF. This leads to an inconsistency in the MEM

Re: [PATCH] fixincludes: add AC_CONFIG_MACRO_DIRS to configure.ac

2024-05-02 Thread Christophe Lyon
On Tue, 30 Apr 2024 at 17:47, Simon Marchi wrote: > > On 4/30/24 4:54 AM, Christophe Lyon wrote: > > On Tue, 30 Apr 2024 at 04:25, Simon Marchi wrote: > >> > >> Add an "AC_CONFIG_MACRO_DIRS" call in configure.ac, with the same > >> directories as specified in "ACLOCAL_AMFLAGS", in Makefile.in. >

Re: [PATCH] c++: Clear is_unbraced_* when parsing declaration_seq_opt [PR114917]

2024-05-02 Thread Jason Merrill
On 5/2/24 01:19, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? OK. -- >8 -- Currently we incorrectly retain "in_unbraced_linkage_specification_p" and "in_unbraced_export_declaration_p" when parsing a (braced) declaration-seq. This patch ensures that

Re: [PATCH] libgm2: re-generate with autoreconf

2024-05-02 Thread Gaius Mulley
Simon Marchi writes: > > I don't have access to the gcc repo, so could you please push the patch > on my behalf? all done - many thanks for the patch! regards, Gaius

RE: [PATCH] PR middle-end/111701: signbit(x*x) vs -fsignaling-nans

2024-05-02 Thread Roger Sayle
> From: Richard Biener > On Thu, May 2, 2024 at 11:34 AM Roger Sayle > wrote: > > > > > > > From: Richard Biener On Fri, Apr 26, > > > 2024 at 10:19 AM Roger Sayle > > > wrote: > > > > > > > > This patch addresses PR middle-end/111701 where optimization of > > > > signbit(x*x) using tree_nonn

[PATCH RFA (cgraph)] c++: pragma target and static init [PR109753]

2024-05-02 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, OK for trunk? 14.2? This two-year-old thread seems relevant: https://gcc.gnu.org/pipermail/gcc-patches/2022-April/593410.html -- 8< -- #pragma target and optimize should also apply to implicitly-generated functions like static initialization functions and defaulted

[COMMITTED] Remove obsolete Solaris 11.3 support

2024-05-02 Thread Rainer Orth
Support for Solaris 11.3 had already been obsoleted in GCC 13. However, since the only Solaris system in the cfarm was running 11.3, I've kept it in tree until now when both Solaris 11.4/SPARC and x86 systems have been added. This patch actually removes the Solaris 11.3 support. Apart from sever

Re: [PATCH v2] c++/modules: Fix dangling pointer with imported_temploid_friends

2024-05-02 Thread Patrick Palka
On Wed, May 1, 2024 at 9:35 PM Nathaniel Shead wrote: > > On Thu, May 02, 2024 at 12:15:44AM +1000, Nathaniel Shead wrote: > > On Wed, May 01, 2024 at 09:57:38AM -0400, Patrick Palka wrote: > > > > > > On Wed, 1 May 2024, Nathaniel Shead wrote: > > > > > > > Bootstrapped and regtested on x86_64-pc

Re: [PATCH v2] gcc-14: Mention that some warnings are now errors

2024-05-02 Thread Sebastian Huber
On 24.04.24 14:28, Sebastian Huber wrote: - Am 15. Apr 2024 um 8:05 schrieb Sebastian Huber sebastian.hu...@embedded-brains.de: --- v2: Remove listing of options. htdocs/gcc-14/changes.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/gcc-14/changes.html b/htdocs/gcc-14/cha

Re: [PATCH] c++/modules: Stream unmergeable temporaries by value again [PR114856]

2024-05-02 Thread Patrick Palka
On Thu, 2 May 2024, Nathaniel Shead wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk/14.2? > > Another alternative would be to stream such !DECL_NAME temporaries with > a merge key of MK_unique rather than attempting to find the matching > (nonexistant) field of the class

[committed] [RISC-V] Don't run new rounding tests on newlib risc-v targets

2024-05-02 Thread Jeff Law
The new round_32.c and round_64.c tests depend on the optimizers to recognize the conversions feeding the floor/ceil calls and convert them into ceilf, floorf and the like. Those transformations only occur when the target indicates the C library has the appropriate routines (fnclass == funct

Re: [PATCH v14 21/26] c++: Implement __rank built-in trait

2024-05-02 Thread Ken Matsui
On Tue, Apr 30, 2024 at 2:08 PM Jason Merrill wrote: > > On 2/28/24 11:26, Ken Matsui wrote: > > This patch implements built-in trait for std::rank. > > __rank seems too short, maybe __array_rank? > > Actually, it occurs to me that perhaps we should have been adding > __builtin to all of these rat

Re: [PATCH v14 21/26] c++: Implement __rank built-in trait

2024-05-02 Thread Patrick Palka
On Tue, 30 Apr 2024, Jason Merrill wrote: > On 2/28/24 11:26, Ken Matsui wrote: > > This patch implements built-in trait for std::rank. > > __rank seems too short, maybe __array_rank? > > Actually, it occurs to me that perhaps we should have been adding __builtin to > all of these rather than ju

Re: [PATCH v14 21/26] c++: Implement __rank built-in trait

2024-05-02 Thread Ken Matsui
On Thu, May 2, 2024 at 8:16 AM Patrick Palka wrote: > > On Tue, 30 Apr 2024, Jason Merrill wrote: > > > On 2/28/24 11:26, Ken Matsui wrote: > > > This patch implements built-in trait for std::rank. > > > > __rank seems too short, maybe __array_rank? > > > > Actually, it occurs to me that perhaps w

Re: [PATCH 3/6] ctf: use pointers instead of IDs internally

2024-05-02 Thread David Faust
On 5/1/24 12:15, David Faust wrote: > This patch replaces all inter-type references in the ctfc internal data > structures with pointers, rather than the references-by-ID which were > used previously. > > A couple of small updates in the BPF backend are included to make it > compatible with the

[PATCH v16 04/26] libstdc++: Optimize std::is_volatile compilation performance

2024-05-02 Thread Ken Matsui
This patch optimizes the compilation performance of std::is_volatile by dispatching to the new __builtin_is_volatile trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_volatile): Use __builtin_is_volatile trait. (is_volatile_v): Likewise. Signed-off-by: Ken Mats

[PATCH v16 18/26] libstdc++: Optimize std::add_rvalue_reference compilation performance

2024-05-02 Thread Ken Matsui
This patch optimizes the compilation performance of std::add_rvalue_reference by dispatching to the new __builtin_add_rvalue_reference trait. libstdc++-v3/ChangeLog: * include/std/type_traits (add_rvalue_reference): Use __builtin_add_rvalue_reference trait. (__add_rvalue_r

[PATCH v16 02/26] libstdc++: Optimize std::is_const compilation performance

2024-05-02 Thread Ken Matsui
This patch optimizes the compilation performance of std::is_const by dispatching to the new __builtin_is_const trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_const): Use __builtin_is_const trait. (is_const_v): Likewise. Signed-off-by: Ken Matsui --- libstd

[PATCH v16 03/26] c++: Implement __builtin_is_volatile trait

2024-05-02 Thread Ken Matsui
This patch implements built-in trait for std::is_volatile. gcc/cp/ChangeLog: * cp-trait.def: Define __builtin_is_volatile. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_VOLATILE. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. g

[PATCH v16 22/26] libstdc++: Optimize std::rank compilation performance

2024-05-02 Thread Ken Matsui
This patch optimizes the compilation performance of std::rank by dispatching to the new __builtin_rank trait. libstdc++-v3/ChangeLog: * include/std/type_traits (rank): Use __builtin_rank trait. (rank_v): Likewise. Signed-off-by: Ken Matsui --- libstdc++-v3/include/std/type_trai

[PATCH v16 07/26] c++: Implement __builtin_is_unbounded_array trait

2024-05-02 Thread Ken Matsui
This patch implements built-in trait for std::is_unbounded_array. gcc/cp/ChangeLog: * cp-trait.def: Define __builtin_is_unbounded_array. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_UNBOUNDED_ARRAY. * semantics.cc (trait_expr_value): Likewise. (fin

[PATCH v16 21/26] c++: Implement __builtin_rank trait

2024-05-02 Thread Ken Matsui
This patch implements built-in trait for std::rank. gcc/cp/ChangeLog: * cp-trait.def: Define __builtin_rank. * constraint.cc (diagnose_trait_expr): Handle CPTK_RANK. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/testsuite/ChangeLo

[PATCH v16 06/26] libstdc++: Optimize std::is_pointer compilation performance

2024-05-02 Thread Ken Matsui
This patch optimizes the compilation performance of std::is_pointer by dispatching to the new __builtin_is_pointer trait. libstdc++-v3/ChangeLog: * include/bits/cpp_type_traits.h (__is_pointer): Use __builtin_is_pointer trait. Optimize its implementation. * include/std/ty

[PATCH v16 15/26] c++: Implement __builtin_add_lvalue_reference trait

2024-05-02 Thread Ken Matsui
This patch implements built-in trait for std::add_lvalue_reference. gcc/cp/ChangeLog: * cp-trait.def: Define __builtin_add_lvalue_reference. * semantics.cc (finish_trait_type): Handle CPTK_ADD_LVALUE_REFERENCE. gcc/testsuite/ChangeLog: * g++.dg/ext/has-builtin-1.

[PATCH v16 08/26] libstdc++: Optimize std::is_unbounded_array compilation performance

2024-05-02 Thread Ken Matsui
This patch optimizes the compilation performance of std::is_unbounded_array by dispatching to the new __builtin_is_unbounded_array trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_unbounded_array_v): Use __builtin_is_unbounded_array trait. Signed-off-by: Ken Matsui -

[PATCH v16 09/26] c++: Implement __builtin_add_pointer trait

2024-05-02 Thread Ken Matsui
This patch implements built-in trait for std::add_pointer. gcc/cp/ChangeLog: * cp-trait.def: Define __builtin_add_pointer. * semantics.cc (finish_trait_type): Handle CPTK_ADD_POINTER. (object_type_p): New function. (referenceable_type_p): Likewise. (trait_e

[PATCH v16 11/26] c++: Implement __builtin_remove_extent trait

2024-05-02 Thread Ken Matsui
This patch implements built-in trait for std::remove_extent. gcc/cp/ChangeLog: * cp-trait.def: Define __builtin_remove_extent. * semantics.cc (finish_trait_type): Handle CPTK_REMOVE_EXTENT. gcc/testsuite/ChangeLog: * g++.dg/ext/has-builtin-1.C: Test existence of

[PATCH v16 26/26] libstdc++: Optimize std::is_nothrow_invocable compilation performance

2024-05-02 Thread Ken Matsui
This patch optimizes the compilation performance of std::is_nothrow_invocable by dispatching to the new __builtin_is_nothrow_invocable trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_nothrow_invocable): Use __builtin_is_nothrow_invocable trait. * testsuite/20_

[PATCH v16 23/26] c++: Implement __builtin_is_invocable trait

2024-05-02 Thread Ken Matsui
This patch implements built-in trait for std::is_invocable. gcc/cp/ChangeLog: * cp-trait.def: Define __builtin_is_invocable. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_INVOCABLE. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise.

[PATCH v16 01/26] c++: Implement __builtin_is_const trait

2024-05-02 Thread Ken Matsui
This patch implements built-in trait for std::is_const. gcc/cp/ChangeLog: * cp-trait.def: Define __builtin_is_const. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_CONST. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/testsu

[PATCH v16 13/26] c++: Implement __builtin_remove_all_extents trait

2024-05-02 Thread Ken Matsui
This patch implements built-in trait for std::remove_all_extents. gcc/cp/ChangeLog: * cp-trait.def: Define __builtin_remove_all_extents. * semantics.cc (finish_trait_type): Handle CPTK_REMOVE_ALL_EXTENTS. gcc/testsuite/ChangeLog: * g++.dg/ext/has-builtin-1.C: Tes

[PATCH v16 20/26] libstdc++: Optimize std::decay compilation performance

2024-05-02 Thread Ken Matsui
This patch optimizes the compilation performance of std::decay by dispatching to the new __builtin_decay trait. libstdc++-v3/ChangeLog: * include/std/type_traits (decay): Use __builtin_decay trait. Signed-off-by: Ken Matsui --- libstdc++-v3/include/std/type_traits | 6 ++ 1 file ch

[PATCH v16 25/26] c++: Implement __builtin_is_nothrow_invocable trait

2024-05-02 Thread Ken Matsui
This patch implements built-in trait for std::is_nothrow_invocable. gcc/cp/ChangeLog: * cp-trait.def: Define __builtin_is_nothrow_invocable. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_NOTHROW_INVOCABLE. * semantics.cc (trait_expr_value): Likewise.

[PATCH v16 12/26] libstdc++: Optimize std::remove_extent compilation performance

2024-05-02 Thread Ken Matsui
This patch optimizes the compilation performance of std::remove_extent by dispatching to the new __builtin_remove_extent trait. libstdc++-v3/ChangeLog: * include/std/type_traits (remove_extent): Use __builtin_remove_extent trait. Signed-off-by: Ken Matsui --- libstdc++-v3/inclu

[PATCH v16 05/26] c++: Implement __builtin_is_pointer trait

2024-05-02 Thread Ken Matsui
This patch implements built-in trait for std::is_pointer. gcc/cp/ChangeLog: * cp-trait.def: Define __builtin_is_pointer. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_POINTER. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/

[PATCH v16 24/26] libstdc++: Optimize std::is_invocable compilation performance

2024-05-02 Thread Ken Matsui
This patch optimizes the compilation performance of std::is_invocable by dispatching to the new __builtin_is_invocable trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_invocable): Use __builtin_is_invocable trait. * testsuite/20_util/is_invocable/incomplete_arg

[PATCH v16 17/26] c++: Implement __builtin_add_rvalue_reference trait

2024-05-02 Thread Ken Matsui
This patch implements built-in trait for std::add_rvalue_reference. gcc/cp/ChangeLog: * cp-trait.def: Define __builtin_add_rvalue_reference. * semantics.cc (finish_trait_type): Handle CPTK_ADD_RVALUE_REFERENCE. gcc/testsuite/ChangeLog: * g++.dg/ext/has-builtin-1.

[PATCH v16 00/26] Optimize more type traits

2024-05-02 Thread Ken Matsui
Changes from v15: * Rebased on top of trunk * Fixed build_invoke * Implemented object_type_p & referenceable_type_p * Prefixed all built-in traits with __builtin instead of __ -- This patch series implements __is_const, __is_volatile, __is_pointer, and __is_unbounded_array built-in traits, which

[Committed] RISC-V: Add testcase for pr114734

2024-05-02 Thread Patrick O'Neill
On 4/30/24 15:03, Jeff Law wrote: On 4/30/24 2:36 PM, Patrick O'Neill wrote: gcc/testsuite/ChangeLog: PR middle-end/114734 * gcc.target/riscv/rvv/autovec/pr114734.c: New test. OK jeff Committed. Patrick

[PATCH v16 10/26] libstdc++: Optimize std::add_pointer compilation performance

2024-05-02 Thread Ken Matsui
This patch optimizes the compilation performance of std::add_pointer by dispatching to the new __builtin_add_pointer trait. libstdc++-v3/ChangeLog: * include/std/type_traits (add_pointer): Use __builtin_add_pointer trait. Signed-off-by: Ken Matsui --- libstdc++-v3/include/std/t

[PATCH v16 14/26] libstdc++: Optimize std::remove_all_extents compilation performance

2024-05-02 Thread Ken Matsui
This patch optimizes the compilation performance of std::remove_all_extents by dispatching to the new __builtin_remove_all_extents trait. libstdc++-v3/ChangeLog: * include/std/type_traits (remove_all_extents): Use __builtin_remove_all_extents trait. Signed-off-by: Ken Matsui ---

[PATCH v16 16/26] libstdc++: Optimize std::add_lvalue_reference compilation performance

2024-05-02 Thread Ken Matsui
This patch optimizes the compilation performance of std::add_lvalue_reference by dispatching to the new __builtin_add_lvalue_reference trait. libstdc++-v3/ChangeLog: * include/std/type_traits (add_lvalue_reference): Use __builtin_add_lvalue_reference trait. (__add_lvalue_r

Re: [PATCH v14 21/26] c++: Implement __rank built-in trait

2024-05-02 Thread Ken Matsui
On Thu, May 2, 2024 at 8:34 AM Ken Matsui wrote: > > On Thu, May 2, 2024 at 8:16 AM Patrick Palka wrote: > > > > On Tue, 30 Apr 2024, Jason Merrill wrote: > > > > > On 2/28/24 11:26, Ken Matsui wrote: > > > > This patch implements built-in trait for std::rank. > > > > > > __rank seems too short,

[PATCH v16 19/26] c++: Implement __builtin_decay trait

2024-05-02 Thread Ken Matsui
This patch implements built-in trait for std::decay. gcc/cp/ChangeLog: * cp-trait.def: Define __builtin_decay. * semantics.cc (finish_trait_type): Handle CPTK_DECAY. gcc/testsuite/ChangeLog: * g++.dg/ext/has-builtin-1.C: Test existence of __builtin_decay. * g++.d

Re: [PATCH v14 21/26] c++: Implement __rank built-in trait

2024-05-02 Thread Jason Merrill
On 5/2/24 12:20, Ken Matsui wrote: On Thu, May 2, 2024 at 8:34 AM Ken Matsui wrote: On Thu, May 2, 2024 at 8:16 AM Patrick Palka wrote: On Tue, 30 Apr 2024, Jason Merrill wrote: On 2/28/24 11:26, Ken Matsui wrote: This patch implements built-in trait for std::rank. __rank seems too sho

Re: [PATCH v14 21/26] c++: Implement __rank built-in trait

2024-05-02 Thread Ken Matsui
On Thu, May 2, 2024 at 9:45 AM Jason Merrill wrote: > > On 5/2/24 12:20, Ken Matsui wrote: > > On Thu, May 2, 2024 at 8:34 AM Ken Matsui wrote: > >> > >> On Thu, May 2, 2024 at 8:16 AM Patrick Palka wrote: > >>> > >>> On Tue, 30 Apr 2024, Jason Merrill wrote: > >>> > On 2/28/24 11:26, Ken M

[PATCH v2 1/6] ctf, btf: restructure CTF/BTF emission

2024-05-02 Thread David Faust
This commit makes some structural changes to the CTF/BTF debug info emission. In particular: a) CTF is new always fully generated and emitted before any BTF-related procedures are run. This means that BTF-related functions can change, even irreversibly, the shared in-memory represen

[PATCH v2 0/6] btf: refactor and add pruning option

2024-05-02 Thread David Faust
[Changes from v1: Fix missing btfout.cc changes in patch 3 which prevent the patch from building as reported by Linaro CI. Those changes are then removed/overwritten in patch 4, so the resulting code before patch 3 and after patch 4 is identical to v1. ] This patch series signficantly refactor

[PATCH v2 3/6] ctf: use pointers instead of IDs internally

2024-05-02 Thread David Faust
This patch replaces all inter-type references in the ctfc internal data structures with pointers, rather than the references-by-ID which were used previously. A couple of small updates in the BPF backend are included to make it compatible with the change. This change is only to the in-memory repr

[PATCH v2 2/6] opts: allow any combination of DWARF, CTF, BTF

2024-05-02 Thread David Faust
Previously it was not supported to generate both CTF and BTF debug info in the same compiler run, as both formats made incompatible changes to the same internal data structures. With the structural change in the prior patch, in particular the guarantee that CTF will always be fully emitted before

[PATCH v2 5/6] btf: add -fprune-btf option

2024-05-02 Thread David Faust
This patch adds a new option, -fprune-btf, to control BTF debug info generation. As the name implies, this option enables a kind of "pruning" of the BTF information before it is emitted. When enabled, rather than emitting all type information translated from DWARF, only information for types dire

[PATCH v2 4/6] btf: refactor and simplify implementation

2024-05-02 Thread David Faust
This patch heavily refactors btfout.cc to take advantage of the structural changes in the prior commits. Now that inter-type references are internally stored as simply pointers, all the painful, brittle, confusing infrastructure that was used in the process of converting CTF type IDs to BTF type I

[PATCH v2 6/6] bpf,btf: enable BTF pruning by default for BPF

2024-05-02 Thread David Faust
This patch enables -fprune-btf by default in the BPF backend when generating BTF information, and fixes BPF CO-RE generation when using -fprune-btf. When generating BPF CO-RE information, we must ensure that types used in CO-RE relocations always have sufficient BTF information emited so that the

Trait built-in naming convention

2024-05-02 Thread Jason Merrill
On 5/2/24 12:45, Jason Merrill wrote: On 5/2/24 12:20, Ken Matsui wrote: On Thu, May 2, 2024 at 8:34 AM Ken Matsui wrote: On Thu, May 2, 2024 at 8:16 AM Patrick Palka wrote: On Tue, 30 Apr 2024, Jason Merrill wrote: On 2/28/24 11:26, Ken Matsui wrote: This patch implements built-in trai

Re: Trait built-in naming convention

2024-05-02 Thread Ken Matsui
On Thu, May 2, 2024 at 10:12 AM Jason Merrill wrote: > > On 5/2/24 12:45, Jason Merrill wrote: > > On 5/2/24 12:20, Ken Matsui wrote: > >> On Thu, May 2, 2024 at 8:34 AM Ken Matsui > >> wrote: > >>> > >>> On Thu, May 2, 2024 at 8:16 AM Patrick Palka wrote: > > On Tue, 30 Apr 2024, Jaso

Re: Trait built-in naming convention

2024-05-02 Thread Ville Voutilainen
On Thu, 2 May 2024 at 20:25, Ken Matsui wrote: > > There was some discussion of how to name the built-ins back in > > https://gcc.gnu.org/pipermail/gcc-patches/2007-March/thread.html#212171 > > but __builtin wasn't discussed. > > > > Apparently this naming convention follows the MSVC precedent: >

Re: [PATCH 2/2] c++: remove lookup_template_class's entering_scope flag

2024-05-02 Thread Patrick Palka
On Wed, 1 May 2024, Jason Merrill wrote: > On 5/1/24 13:40, Patrick Palka wrote: > > On Wed, 1 May 2024, Jason Merrill wrote: > > > > > On 5/1/24 12:41, Patrick Palka wrote: > > > > On Fri, 2 Feb 2024, Patrick Palka wrote: > > > > > > > > > Bootstrapped and regtested on x86_64-pc-linux, does thi

Re: [PATCH] c++/modules: Stream unmergeable temporaries by value again [PR114856]

2024-05-02 Thread Jason Merrill
On 5/2/24 10:40, Patrick Palka wrote: On Thu, 2 May 2024, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk/14.2? Another alternative would be to stream such !DECL_NAME temporaries with a merge key of MK_unique rather than attempting to find the matching (n

Re: [PATCHv2 wwwdocs 1/1] gcc-14: document P1689R5 scanning output support

2024-05-02 Thread Ben Boeckel
On Tue, Apr 30, 2024 at 10:24:44 +0100, Jonathan Wakely wrote: > On 20/11/23 11:22 -0500, Ben Boeckel wrote: > >--- > > htdocs/gcc-14/changes.html | 11 +++ > > 1 file changed, 11 insertions(+) > > > >diff --git a/htdocs/gcc-14/changes.html b/htdocs/gcc-14/changes.html > >index 7278f753..b50

Re: [PATCH v2] c++/modules: Fix dangling pointer with imported_temploid_friends

2024-05-02 Thread Jason Merrill
On 5/1/24 21:34, Nathaniel Shead wrote: On Thu, May 02, 2024 at 12:15:44AM +1000, Nathaniel Shead wrote: On Wed, May 01, 2024 at 09:57:38AM -0400, Patrick Palka wrote: On Wed, 1 May 2024, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk (and later 14.2)?

Re: [PATCH 2/2] c++: remove lookup_template_class's entering_scope flag

2024-05-02 Thread Jason Merrill
On 5/2/24 13:49, Patrick Palka wrote: On Wed, 1 May 2024, Jason Merrill wrote: On 5/1/24 13:40, Patrick Palka wrote: On Wed, 1 May 2024, Jason Merrill wrote: On 5/1/24 12:41, Patrick Palka wrote: On Fri, 2 Feb 2024, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux, does

[PATCH v17 14/26] libstdc++: Optimize std::remove_all_extents compilation performance

2024-05-02 Thread Ken Matsui
This patch optimizes the compilation performance of std::remove_all_extents by dispatching to the new __remove_all_extents built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (remove_all_extents): Use __remove_all_extents built-in trait. Signed-off-by: Ken Matsui -

[PATCH v17 16/26] libstdc++: Optimize std::add_lvalue_reference compilation performance

2024-05-02 Thread Ken Matsui
This patch optimizes the compilation performance of std::add_lvalue_reference by dispatching to the new __add_lvalue_reference built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (add_lvalue_reference): Use __add_lvalue_reference built-in trait. (__add_lvalue

[PATCH v17 05/26] c++: Implement __is_pointer built-in trait

2024-05-02 Thread Ken Matsui
This patch implements built-in trait for std::is_pointer. gcc/cp/ChangeLog: * cp-trait.def: Define __is_pointer. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_POINTER. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/testsuit

[PATCH v17 11/26] c++: Implement __remove_extent built-in trait

2024-05-02 Thread Ken Matsui
This patch implements built-in trait for std::remove_extent. gcc/cp/ChangeLog: * cp-trait.def: Define __remove_extent. * semantics.cc (finish_trait_type): Handle CPTK_REMOVE_EXTENT. gcc/testsuite/ChangeLog: * g++.dg/ext/has-builtin-1.C: Test existence of __remove_extent.

[PATCH v17 04/26] libstdc++: Optimize std::is_volatile compilation performance

2024-05-02 Thread Ken Matsui
This patch optimizes the compilation performance of std::is_volatile by dispatching to the new __is_volatile built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_volatile): Use __is_volatile built-in trait. (is_volatile_v): Likewise. Signed-off-by: Ken Ma

[PATCH v17 09/26] c++: Implement __add_pointer built-in trait

2024-05-02 Thread Ken Matsui
This patch implements built-in trait for std::add_pointer. gcc/cp/ChangeLog: * cp-trait.def: Define __add_pointer. * semantics.cc (finish_trait_type): Handle CPTK_ADD_POINTER. (object_type_p): New function. (referenceable_type_p): Likewise. (trait_expr_valu

[PATCH v17 07/26] c++: Implement __builtin_is_unbounded_array trait

2024-05-02 Thread Ken Matsui
This patch implements built-in trait for std::is_unbounded_array. gcc/cp/ChangeLog: * cp-trait.def: Define __builtin_is_unbounded_array. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_UNBOUNDED_ARRAY. * semantics.cc (trait_expr_value): Likewise. (fin

  1   2   >