Re: Remove stale Autoconf checks for Perl

2023-10-20 Thread Alexandre Oliva
On May 16, 2023, Thomas Schwinge wrote: > OK to push the attached "Remove stale Autoconf checks for Perl"? LGTM, thanks, -- Alexandre Oliva, happy hackerhttps://FSFLA.org/blogs/lxo/ Free Software Activist GNU Toolchain Engineer Disinformation fl

[PATCH] RISC-V: Prohibit combination of 'E' and 'H'

2023-10-20 Thread Tsukasa OI
From: Tsukasa OI According to the ratified privileged specification (version 20211203), it says: > The hypervisor extension depends on an "I" base integer ISA with 32 x > registers (RV32I or RV64I), not RV32E, which has only 16 x registers. Also in the latest draft, it also prohibits RV64E with

[PATCH] RISC-V: 'Zfa' extension is now ratified

2023-10-20 Thread Tsukasa OI
From: Tsukasa OI Since this extension is ratified, it now has the version number 1.0. Reference: gcc/ChangeLog: * common/config/riscv/riscv-common.cc (riscv_ext_version_table): Change version number of the 'Zfa' extension to

Re: [PATCH RESEND] libatomic: drop redundant all-multi command

2023-10-20 Thread Alexandre Oliva
On Aug 1, 2023, Jan Beulich via Gcc-patches wrote: > * Makefile.am (all-multi): Drop commands. > * Makefile.in: Update accordingly. LGTM, thanks, -- Alexandre Oliva, happy hackerhttps://FSFLA.org/blogs/lxo/ Free Software Activist GN

Re: Darwin: Replace environment runpath with embedded [PR88590]

2023-10-20 Thread Alexandre Oliva
On Aug 29, 2023, FX Coudert wrote: >> I think a build machinery review is needed. > Thanks. CC’ing the relevant maintainers for review of the build part. > The driver part and the darwin-specific part are already okayed. The build machinery bits look reasonable to me. I have no specific knowled

RE: [PATCH v2] RISC-V: Support partial VLS mode when preference fixed-vlmax [PR111857]

2023-10-20 Thread Li, Pan2
Committed, thanks Juzhe. Pan

Re: [PATCH] c++: Implement C++26 P2361R6 - Unevaluated strings [PR110342]

2023-10-20 Thread Jason Merrill
On 10/20/23 17:59, Jakub Jelinek wrote: On Fri, Oct 20, 2023 at 04:12:48PM -0400, Jason Merrill wrote: On 8/24/23 09:58, Jakub Jelinek wrote: The following patch implements C++26 unevaluated-string. As it seems to me just extra pedanticity, it is implemented only for -std=c++26 or -std=gnu++26

Re: [PATCH v9 4/4] ree: Improve ree pass for rs6000 target using defined ABI interfaces

2023-10-20 Thread Vineet Gupta
On 10/19/23 23:50, Ajit Agarwal wrote: Hello All: This version 9 of the patch uses abi interfaces to remove zero and sign extension elimination. Bootstrapped and regtested on powerpc-linux-gnu. In this version (version 9) of the patch following review comments are incorporated. a) Removal of

Re: [PATCH] c++: Implement C++26 P2361R6 - Unevaluated strings [PR110342]

2023-10-20 Thread Jakub Jelinek
On Fri, Oct 20, 2023 at 04:12:48PM -0400, Jason Merrill wrote: > On 8/24/23 09:58, Jakub Jelinek wrote: > > The following patch implements C++26 unevaluated-string. > > As it seems to me just extra pedanticity, it is implemented only for > > -std=c++26 or -std=gnu++26 and later and only if -pedanti

[pushed] c++: abstract class and overload resolution

2023-10-20 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- In my implementation of P0929 I treated a conversion to an rvalue of abstract class type as a bad conversion, but that's still too soon to check it; we need to wait until we're done with overload resolution. gcc/cp/ChangeLog: * cal

Re: [PATCH v23 32/33] c++: Implement __is_invocable built-in trait

2023-10-20 Thread Patrick Palka
On Fri, 20 Oct 2023, Patrick Palka wrote: > On Fri, 20 Oct 2023, Patrick Palka wrote: > > > On Fri, 20 Oct 2023, Ken Matsui wrote: > > > > > This patch implements built-in trait for std::is_invocable. > > > > Nice! My email client unfortunately ate my first review attempt, so > > apologies for

Re: [PATCH v23 32/33] c++: Implement __is_invocable built-in trait

2023-10-20 Thread Patrick Palka
On Fri, 20 Oct 2023, Patrick Palka wrote: > On Fri, 20 Oct 2023, Ken Matsui wrote: > > > This patch implements built-in trait for std::is_invocable. > > Nice! My email client unfortunately ate my first review attempt, so > apologies for my brevity this time around. > > > gcc/cp/ChangeLog: > >

Re: [PATCH v23 32/33] c++: Implement __is_invocable built-in trait

2023-10-20 Thread Patrick Palka
On Fri, 20 Oct 2023, Ken Matsui wrote: > This patch implements built-in trait for std::is_invocable. Nice! My email client unfortunately ate my first review attempt, so apologies for my brevity this time around. > gcc/cp/ChangeLog: > > * cp-trait.def: Define __is_invocable. > * con

ping: [PATCH] libcpp: Improve the diagnostic for poisoned identifiers [PR36887]

2023-10-20 Thread Lewis Hyatt
Hello- May I please ping this one? Thanks... https://gcc.gnu.org/pipermail/gcc-patches/2023-September/630967.html -Lewis On Wed, Sep 20, 2023 at 12:12 AM Lewis Hyatt wrote: > > Hello- > > This patch implements the PR's request to add more information to the > diagnostic issued for using a poiso

Re: [PATCH] libstdc++ Add cstdarg to freestanding

2023-10-20 Thread Paul M. Bendixen
Updated patch, added the requested files, hopefully wrote the commit better. Den tors. 7. sep. 2023 kl. 18.28 skrev Jonathan Wakely : > On Fri, 18 Aug 2023 at 20:14, Paul M. Bendixen > wrote: > > > > Hi > > Jonathan, I just went over the proposal again as well as [compliance], > which Arsen me

Re: HELP: Will the reordering happen? Re: [V3][PATCH 0/3] New attribute "counted_by" to annotate bounds for C99 FAM(PR108896)

2023-10-20 Thread Qing Zhao
> On Oct 20, 2023, at 3:10 PM, Siddhesh Poyarekar wrote: > > On 2023-10-20 14:38, Qing Zhao wrote: >> How about the following: >> Add one more parameter to __builtin_dynamic_object_size(), i.e >> __builtin_dynamic_object_size (_1,1,array_annotated->foo)? >> When we see the structure field has

Re: [PATCH] C99 testsuite readiness: Compile more tests with -std=gnu89

2023-10-20 Thread Joseph Myers
OK. -- Joseph S. Myers jos...@codesourcery.com

[pushed] testsuite: constexpr-diag1.C and implicit constexpr

2023-10-20 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- This test doesn't break as expected with implicit constexpr. gcc/testsuite/ChangeLog: * g++.dg/cpp1y/constexpr-diag1.C: Add -fno-implicit-constexpr. --- gcc/testsuite/g++.dg/cpp1y/constexpr-diag1.C | 2 +- 1 file changed, 1 insert

[pushed] c++: fix tourney logic

2023-10-20 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. Patrick, sorry I didn't apply this sooner. -- 8< -- In r13-3766 I changed the logic at the end of tourney to avoid redundant comparisons, but the change also meant skipping any less-good matches between the champ_compared_to_predecessor candidate an

Re: [PATCH] c++: Implement C++26 P2361R6 - Unevaluated strings [PR110342]

2023-10-20 Thread Jason Merrill
On 8/24/23 09:58, Jakub Jelinek wrote: Hi! The following patch implements C++26 unevaluated-string. As it seems to me just extra pedanticity, it is implemented only for -std=c++26 or -std=gnu++26 and later and only if -pedantic/-pedantic-errors. Hmm, I assumed it was accepted as a DR, but appa

Re: [PATCH v23 02/33] c-family, c++: Look up built-in traits via identifier node

2023-10-20 Thread Ken Matsui
On Fri, Oct 20, 2023 at 12:12 PM Patrick Palka wrote: > > On Fri, Oct 20, 2023 at 10:02 AM Ken Matsui wrote: > > > > Since RID_MAX soon reaches 255 and all built-in traits are used > > approximately > > once in a C++ translation unit, this patch removes all RID values for > > built-in > > trait

Re: [PATCH v3] Control flow redundancy hardening

2023-10-20 Thread David Edelsohn
SPARC target header requires memmodel.h. David * gimple-harden-control-flow.cc: Include memmodel.h. *diff --git a/gcc/gimple-harden-control-flow.cc b/gcc/gimple-harden-control-flow.cc* *index 1b345dab766..441df5ac21c 100644* *--- a/gcc/gimple-harden-control-flow.cc* *+++ b/gcc/gimp

Re: [V3][PATCH 0/3] New attribute "counted_by" to annotate bounds for C99 FAM(PR108896)

2023-10-20 Thread Martin Uecker
Am Freitag, dem 20.10.2023 um 18:48 + schrieb Qing Zhao: > > > On Oct 20, 2023, at 2:34 PM, Kees Cook wrote: > > > > On Fri, Oct 20, 2023 at 11:50:11AM +0200, Martin Uecker wrote: > > > Am Donnerstag, dem 19.10.2023 um 16:33 -0700 schrieb Kees Cook: > > > > On Wed, Oct 18, 2023 at 09:11:43PM

Re: [PATCH] c++/modules: ICE with lambda initializing local var [PR105322]

2023-10-20 Thread Patrick Palka
On Fri, 20 Oct 2023, Nathan Sidwell wrote: > Thanks for looking at this, but your patch is essentially papering over the > problem. > > It took me a while to figure out, but the clue was that things like > 'decltype(f()).m' worked, but 'decltype(f()){0}' did not. The CONSTRUCTOR > node is the ex

Re: [PATCH v23 02/33] c-family, c++: Look up built-in traits via identifier node

2023-10-20 Thread Patrick Palka
On Fri, Oct 20, 2023 at 10:02 AM Ken Matsui wrote: > > Since RID_MAX soon reaches 255 and all built-in traits are used approximately > once in a C++ translation unit, this patch removes all RID values for built-in > traits and uses the identifier node to look up the specific trait. Rather > than

Re: HELP: Will the reordering happen? Re: [V3][PATCH 0/3] New attribute "counted_by" to annotate bounds for C99 FAM(PR108896)

2023-10-20 Thread Siddhesh Poyarekar
On 2023-10-20 14:38, Qing Zhao wrote: How about the following: Add one more parameter to __builtin_dynamic_object_size(), i.e __builtin_dynamic_object_size (_1,1,array_annotated->foo)? When we see the structure field has counted_by attribute. Or maybe add a barrier preventing any assignme

Re: [PATCH] c-family: char8_t and aliasing in C vs C++ [PR111884]

2023-10-20 Thread Jason Merrill
On 10/20/23 12:31, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? OK. -- >8 -- In the PR, Joseph says that in C char8_t is not a distinct type. So we should behave as if it can alias anything, like ordinary char. In C, unsigned_char_type_node == char8_type_

Re: [PATCH] c: -Wincompatible-pointer-types should cover mismatches in ?:

2023-10-20 Thread Joseph Myers
On Fri, 20 Oct 2023, Florian Weimer wrote: > gcc/c/ > > PR c/109826 > PR other/44209 > * c-typeck.cc (build_conditional_expr): Use > OPT_Wincompatible_pointer_types for pointer mismatches. > Emit location information for the operand. > > gcc/testsuite/ > > *

Re: [PATCH] c: -Wint-conversion should cover pointer/integer mismatches in ?:

2023-10-20 Thread Joseph Myers
On Fri, 20 Oct 2023, Florian Weimer wrote: > gcc/c/ > > PR c/109827 > PR other/44209 > * c-typeck.cc (build_conditional_expr): Use OPT_Wint_conversion > for pointer/integer mismatch warnings. > > gcc/testsuite/ > > * gcc.dg/Wint-conversion-3.c: New. OK. -- Josep

[PATCH] C99 testsuite readiness: Compile more tests with -std=gnu89

2023-10-20 Thread Florian Weimer
gcc/testsuite/ * gcc.c-torture/compile/2403-1.c: Compile with -std=gnu89. * gcc.c-torture/compile/2511-1.c: Likewise. * gcc.c-torture/compile/2804-1.c: Likewise. * gcc.c-torture/compile/20020418-1.c: Likewise. * gcc.c-torture/compile/20020927-1.c

[PATCH] C99 testsuite readiness: Some unverified test case reductions

2023-10-20 Thread Florian Weimer
gcc/testsuite/ * gcc.c-torture/compile/2412-2.c (f): Call __builtin_strleninstead of strlen. * gcc.c-torture/compile/2427-1.c (FindNearestPowerOf2): Declare. * gcc.c-torture/compile/2802-1.c (bar): Call __builtin_memcpyins

Re: [V3][PATCH 0/3] New attribute "counted_by" to annotate bounds for C99 FAM(PR108896)

2023-10-20 Thread Qing Zhao
> On Oct 20, 2023, at 2:34 PM, Kees Cook wrote: > > On Fri, Oct 20, 2023 at 11:50:11AM +0200, Martin Uecker wrote: >> Am Donnerstag, dem 19.10.2023 um 16:33 -0700 schrieb Kees Cook: >>> On Wed, Oct 18, 2023 at 09:11:43PM +, Qing Zhao wrote: As I replied to Martin in another email, I pl

Re: HELP: Will the reordering happen? Re: [V3][PATCH 0/3] New attribute "counted_by" to annotate bounds for C99 FAM(PR108896)

2023-10-20 Thread Qing Zhao
> On Oct 20, 2023, at 2:22 PM, Richard Biener > wrote: > > > >> Am 20.10.2023 um 19:09 schrieb Qing Zhao : >> >> Sid, >> >> (Richard, can you please help me to make sure this? Thanks a lot) >> >> I studied a little bit more on the following question you raised during the >> review proce

Re: [V3][PATCH 0/3] New attribute "counted_by" to annotate bounds for C99 FAM(PR108896)

2023-10-20 Thread Kees Cook
On Fri, Oct 20, 2023 at 11:50:11AM +0200, Martin Uecker wrote: > Am Donnerstag, dem 19.10.2023 um 16:33 -0700 schrieb Kees Cook: > > On Wed, Oct 18, 2023 at 09:11:43PM +, Qing Zhao wrote: > > > As I replied to Martin in another email, I plan to do the following to > > > resolve this issue: > >

Re: [PATCH] libstdc++: Workaround for LLVM-61763 in ranges

2023-10-20 Thread Benjamin Brock
> I don't think this patch counts as legally significant, but if you contribute > again in future you should be aware of > https://gcc.gnu.org/contribute.html#legal and either complete the copyright > assignment paperwork, or add a DCO sign-off to the commit message. Thanks for the reminder. I

Re: HELP: Will the reordering happen? Re: [V3][PATCH 0/3] New attribute "counted_by" to annotate bounds for C99 FAM(PR108896)

2023-10-20 Thread Richard Biener
> Am 20.10.2023 um 19:09 schrieb Qing Zhao : > > Sid, > > (Richard, can you please help me to make sure this? Thanks a lot) > > I studied a little bit more on the following question you raised during the > review process: > > For the following small testing case: > > 1 struct annotated

Re: [PATCH v3] Control flow redundancy hardening

2023-10-20 Thread David Edelsohn
This patch broke bootstrap on AIX because ASM_GENERATE_INTERNAL_LABEL can embed target-specific functions. Fixed by including tm_p.h. Thanks, David * gimple-harden-control-flow.cc: Include tm_p.h. *diff --git a/gcc/gimple-harden-control-flow.cc b/gcc/gimple-harden-control-flow.cc* *

Re: [PATCH v2 0/2] riscv: Adding support for XTHead(F)MemIdx

2023-10-20 Thread Christoph Müllner
On Fri, Oct 20, 2023 at 4:33 PM Jeff Law wrote: > > > > On 10/20/23 03:53, Christoph Muellner wrote: > > From: Christoph Müllner > > > > This two patches add support for the XTheadMemIdx > > and XTheadFMemIdx ISA extensions, that support additional > > addressing modes. The extensions are impleme

[PATCH] rust: build failure after NON_DEPENDENT_EXPR removal [PR111899]

2023-10-20 Thread Patrick Palka
Built on x86_64-pc-linux-gnu, pushed to trunk as obvious (hopefully). -- >8 -- This patch removes stray NON_DEPENDENT_EXPR checks following the removal of this tree code from the C++ FE. (Since this restores the build I supppose it means the Rust FE never creates NON_DEPENDENT_EXPR trees in the

PR111754

2023-10-20 Thread Prathamesh Kulkarni
Hi, For the following test-case: typedef float __attribute__((__vector_size__ (16))) F; F foo (F a, F b) { F v = (F) { 9 }; return __builtin_shufflevector (v, v, 1, 0, 1, 2); } Compiling with -O2 results in following ICE: foo.c: In function ‘foo’: foo.c:6:10: internal compiler error: in decom

HELP: Will the reordering happen? Re: [V3][PATCH 0/3] New attribute "counted_by" to annotate bounds for C99 FAM(PR108896)

2023-10-20 Thread Qing Zhao
Sid, (Richard, can you please help me to make sure this? Thanks a lot) I studied a little bit more on the following question you raised during the review process: For the following small testing case: 1 struct annotated { 2 int foo; 3 char array[] __attribute__((counted_by (foo)));

[Patch] OpenMP: Add C++ support for 'omp allocate' with stack variables

2023-10-20 Thread Tobias Burnus
This patch adds C++ support for OpenMP's 'omp allocate' for stack/automatic arrays. Comments and suggestions? — I bet there are given my little knowledge about the C++ FE... Tobias PS: I think I should write some additional C++-specific code, I bet some corner cases are missed. The question is

Re: [PATCH v2] ARM: Block predication on atomics [PR111235]

2023-10-20 Thread Richard Earnshaw
On 02/10/2023 18:12, Wilco Dijkstra wrote: Hi Ramana, I used --target=arm-none-linux-gnueabihf --host=arm-none-linux-gnueabihf --build=arm-none-linux-gnueabihf --with-float=hard. However it seems that the default armhf settings are incorrect. I shouldn't need the --with-float=hard since tha

[pushed] libstdc++: add casts to from_chars in [PR111883]

2023-10-20 Thread Marek Polacek
Tested x86_64-pc-linux-gnu, applying to trunk. -- >8 -- This fixes .../charconv: In function 'std::from_chars_result std::from_chars(const char*, const char*, _Float16&, chars_format)': .../charconv:687:17: warning: converting to '_Float16' from 'float' with greater conversion rank 687 |

[PATCH] c-family: char8_t and aliasing in C vs C++ [PR111884]

2023-10-20 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- In the PR, Joseph says that in C char8_t is not a distinct type. So we should behave as if it can alias anything, like ordinary char. In C, unsigned_char_type_node == char8_type_node, so with this patch we return 0 instead of -

Re: [PATCH] c++/modules: ICE with lambda initializing local var [PR105322]

2023-10-20 Thread Nathan Sidwell
Thanks for looking at this, but your patch is essentially papering over the problem. It took me a while to figure out, but the clue was that things like 'decltype(f()).m' worked, but 'decltype(f()){0}' did not. The CONSTRUCTOR node is the exception to the rule that required an expression node

Re: [patch] libgomp.texi: Update "Enabling OpenMP"

2023-10-20 Thread Jakub Jelinek
On Sat, Oct 14, 2023 at 11:57:39PM +0200, Jakub Jelinek wrote: > On Sat, Oct 14, 2023 at 03:46:52PM -0600, Sandra Loosemore wrote: > > On 10/14/23 13:43, Tobias Burnus wrote: > > > When browsing libgomp doc, I came across > > > https://gcc.gnu.org/onlinedocs/libgomp/Enabling-OpenMP.html>> First, I

[PATCH v24 00/33] Optimize type traits performance

2023-10-20 Thread Ken Matsui
This patch series optimizes type traits performance by implementing built-in type traits and using them in libstdc++. Changes in v24: * Fixed the way to handle an incomplete type error from __is_invocable in the test cases so that we can correctly test both the use of buil

[PATCH v24 33/33] libstdc++: Optimize std::is_invocable compilation performance

2023-10-20 Thread Ken Matsui
This patch optimizes the compilation performance of std::is_invocable by dispatching to the new __is_invocable built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_invocable): Use __is_invocable built-in trait. * testsuite/20_util/is_invocable/incomplete_a

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

2023-10-20 Thread Jason Merrill
On 10/20/23 00:34, waffl3x wrote: Based on what you've said, I assume that OFFSET_REF handles static member functions that are overloaded. But as I've said this seems to contradict the comments I'm reading, so I'm not sure that I'm understanding you correctly. That's right. For instance, str

Re: [PATCH 2/2] c++: remove NON_DEPENDENT_EXPR, part 2

2023-10-20 Thread Andrew Pinski
On Mon, Sep 25, 2023 at 1:43 PM Patrick Palka wrote: > > This much more mechanical patch removes build_non_dependent_expr > (and make_args_non_dependent) and adjusts callers accordingly, > no functional change. This broke the RUST front-end which decided to copy/reuse the C++ code for constexpr

[PATCH] vect: Don't set excess bits in unform masks

2023-10-20 Thread Andrew Stubbs
This patch fixes a wrong-code bug on amdgcn in which the excess "ones" in the mask enable extra lanes that were supposed to be unused and are therefore undefined. Richi suggested an alternative approach involving narrower types and then a zero-extend to the actual mask type. This solved the p

Re: [PATCH] ifcvt: Don't lower bitfields with non-constant offsets [PR 111882]

2023-10-20 Thread Richard Biener
> Am 20.10.2023 um 15:47 schrieb Andre Vieira (lists) > : > >  > >> On 20/10/2023 14:41, Richard Biener wrote: >>> On Fri, 20 Oct 2023, Andre Vieira (lists) wrote: >>> Hi, >>> >>> This patch stops lowering of bitfields by ifcvt when they have non-constant >>> offsets as we are not likely to

Re: [PATCH v2 0/2] riscv: Adding support for XTHead(F)MemIdx

2023-10-20 Thread Jeff Law
On 10/20/23 03:53, Christoph Muellner wrote: From: Christoph Müllner This two patches add support for the XTheadMemIdx and XTheadFMemIdx ISA extensions, that support additional addressing modes. The extensions are implemented in a range of T-Head cores (e.g. C906, C910, C920) and are availab

[PATCH v23 29/33] libstdc++: Optimize std::remove_pointer compilation performance

2023-10-20 Thread Ken Matsui
This patch optimizes the compilation performance of std::remove_pointer by dispatching to the new remove_pointer built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (remove_pointer): Use __remove_pointer built-in trait. Signed-off-by: Ken Matsui --- libstdc++-v3/i

[PATCH v23 32/33] c++: Implement __is_invocable built-in trait

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

[PATCH v23 23/33] libstdc++: Optimize std::is_reference compilation performance

2023-10-20 Thread Ken Matsui
This patch optimizes the compilation performance of std::is_reference by dispatching to the new __is_reference built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_reference): Use __is_reference built-in trait. (is_reference_v): Likewise. Signed-off-by: K

[PATCH v23 33/33] libstdc++: Optimize std::is_invocable compilation performance

2023-10-20 Thread Ken Matsui
This patch optimizes the compilation performance of std::is_invocable by dispatching to the new __is_invocable built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_invocable): Use __is_invocable built-in trait. * testsuite/20_util/is_invocable/incomplete_a

[PATCH v23 27/33] libstdc++: Optimize std::is_object compilation performance

2023-10-20 Thread Ken Matsui
This patch optimizes the compilation performance of std::is_object by dispatching to the new __is_object built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_object): Use __is_object built-in trait. (is_object_v): Likewise. Signed-off-by: Ken Matsui --- libstdc+

[PATCH v23 31/33] libstdc++: Optimize std::is_pointer compilation performance

2023-10-20 Thread Ken Matsui
This patch optimizes the compilation performance of std::is_pointer by dispatching to the new __is_pointer built-in trait. libstdc++-v3/ChangeLog: * include/bits/cpp_type_traits.h (__is_pointer): Use __is_pointer built-in trait. * include/std/type_traits (is_pointer): Like

[PATCH v23 14/33] c++: Implement __is_scoped_enum built-in trait

2023-10-20 Thread Ken Matsui
This patch implements built-in trait for std::is_scoped_enum. gcc/cp/ChangeLog: * cp-trait.def: Define __is_scoped_enum. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_SCOPED_ENUM. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise.

[PATCH v23 08/33] c++: Implement __is_array built-in trait

2023-10-20 Thread Ken Matsui
This patch implements built-in trait for std::is_array. gcc/cp/ChangeLog: * cp-trait.def: Define __is_array. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_ARRAY. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/testsuite/Chan

[PATCH v23 20/33] c++: Implement __is_member_object_pointer built-in trait

2023-10-20 Thread Ken Matsui
This patch implements built-in trait for std::is_member_object_pointer. gcc/cp/ChangeLog: * cp-trait.def: Define __is_member_object_pointer. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_MEMBER_OBJECT_POINTER. * semantics.cc (trait_expr_value): Likewise.

[PATCH v23 16/33] c++: Implement __is_member_pointer built-in trait

2023-10-20 Thread Ken Matsui
This patch implements built-in trait for std::is_member_pointer. gcc/cp/ChangeLog: * cp-trait.def: Define __is_member_pointer. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_MEMBER_POINTER. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Li

[PATCH v23 18/33] c++: Implement __is_member_function_pointer built-in trait

2023-10-20 Thread Ken Matsui
This patch implements built-in trait for std::is_member_function_pointer. gcc/cp/ChangeLog: * cp-trait.def: Define __is_member_function_pointer. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_MEMBER_FUNCTION_POINTER. * semantics.cc (trait_expr_value): Likewi

[PATCH v23 06/33] c++: Implement __is_volatile built-in trait

2023-10-20 Thread Ken Matsui
This patch implements built-in trait for std::is_volatile. gcc/cp/ChangeLog: * cp-trait.def: Define __is_volatile. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_VOLATILE. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/tests

[PATCH v23 24/33] c++: Implement __is_function built-in trait

2023-10-20 Thread Ken Matsui
This patch implements built-in trait for std::is_function. gcc/cp/ChangeLog: * cp-trait.def: Define __is_function. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_FUNCTION. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/tests

[PATCH v23 26/33] c++: Implement __is_object built-in trait

2023-10-20 Thread Ken Matsui
This patch implements built-in trait for std::is_object. gcc/cp/ChangeLog: * cp-trait.def: Define __is_object. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_OBJECT. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/testsuite/C

[PATCH v23 12/33] c++: Implement __is_bounded_array built-in trait

2023-10-20 Thread Ken Matsui
This patch implements built-in trait for std::is_bounded_array. gcc/cp/ChangeLog: * cp-trait.def: Define __is_bounded_array. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_BOUNDED_ARRAY. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likew

[PATCH v23 28/33] c++: Implement __remove_pointer built-in trait

2023-10-20 Thread Ken Matsui
This patch implements built-in trait for std::remove_pointer. gcc/cp/ChangeLog: * cp-trait.def: Define __remove_pointer. * semantics.cc (finish_trait_type): Handle CPTK_REMOVE_POINTER. gcc/testsuite/ChangeLog: * g++.dg/ext/has-builtin-1.C: Test existence of __remove_poin

[PATCH v23 07/33] libstdc++: Optimize std::is_volatile compilation performance

2023-10-20 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 v23 21/33] libstdc++: Optimize std::is_member_object_pointer compilation performance

2023-10-20 Thread Ken Matsui
This patch optimizes the compilation performance of std::is_member_object_pointer by dispatching to the new __is_member_object_pointer built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_member_object_pointer): Use __is_member_object_pointer built-in trait.

[PATCH v23 30/33] c++: Implement __is_pointer built-in trait

2023-10-20 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 v23 19/33] libstdc++: Optimize std::is_member_function_pointer compilation performance

2023-10-20 Thread Ken Matsui
This patch optimizes the compilation performance of std::is_member_function_pointer 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 trai

[PATCH v23 22/33] c++: Implement __is_reference built-in trait

2023-10-20 Thread Ken Matsui
This patch implements built-in trait for std::is_reference. gcc/cp/ChangeLog: * cp-trait.def: Define __is_reference. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_REFERENCE. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/te

[PATCH v23 05/33] libstdc++: Optimize std::is_const compilation performance

2023-10-20 Thread Ken Matsui
This patch optimizes the compilation performance of std::is_const by dispatching to the new __is_const built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_const): Use __is_const built-in trait. (is_const_v): Likewise. Signed-off-by: Ken Matsui --- libstdc++-v3

[PATCH v23 13/33] libstdc++: Optimize std::is_bounded_array compilation performance

2023-10-20 Thread Ken Matsui
This patch optimizes the compilation performance of std::is_bounded_array by dispatching to the new __is_bounded_array built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_bounded_array_v): Use __is_bounded_array built-in trait. Signed-off-by: Ken Matsui --- li

[PATCH v23 17/33] libstdc++: Optimize std::is_member_pointer compilation performance

2023-10-20 Thread Ken Matsui
This patch optimizes the compilation performance of std::is_member_pointer by dispatching to the new __is_member_pointer built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_member_pointer): Use __is_member_pointer built-in trait. (is_member_pointer_v): Li

[PATCH v23 11/33] libstdc++: Optimize std::is_unbounded_array compilation performance

2023-10-20 Thread Ken Matsui
This patch optimizes the compilation performance of std::is_unbounded_array 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

[PATCH v23 10/33] c++: Implement __is_unbounded_array built-in trait

2023-10-20 Thread Ken Matsui
This patch implements built-in trait for std::is_unbounded_array. gcc/cp/ChangeLog: * cp-trait.def: Define __is_unbounded_array. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_UNBOUNDED_ARRAY. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr):

[PATCH v23 09/33] libstdc++: Optimize std::is_array compilation performance

2023-10-20 Thread Ken Matsui
This patch optimizes the compilation performance of std::is_array by dispatching to the new __is_array built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_array): Use __is_array built-in trait. (is_array_v): Likewise. Signed-off-by: Ken Matsui --- libstdc++-v3

[PATCH v23 25/33] libstdc++: Optimize std::is_function compilation performance

2023-10-20 Thread Ken Matsui
This patch optimizes the compilation performance of std::is_function by dispatching to the new __is_function built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_function): Use __is_function built-in trait. (is_function_v): Likewise. Optimize its implement

[PATCH v23 15/33] libstdc++: Optimize std::is_scoped_enum compilation performance

2023-10-20 Thread Ken Matsui
This patch optimizes the compilation performance of std::is_scoped_enum by dispatching to the new __is_scoped_enum built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_scoped_enum): Use __is_scoped_enum built-in trait. (is_scoped_enum_v): Likewise. Signed

[PATCH v23 04/33] c++: Implement __is_const built-in trait

2023-10-20 Thread Ken Matsui
This patch implements built-in trait for std::is_const. gcc/cp/ChangeLog: * cp-trait.def: Define __is_const. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_CONST. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc/testsuite/Chan

[PATCH v23 03/33] c++: Accept the use of built-in trait identifiers

2023-10-20 Thread Ken Matsui
This patch accepts the use of built-in trait identifiers when they are actually not used as traits. Specifically, we check if the subsequent token is '(' for ordinary built-in traits or is '<' only for the special __type_pack_element built-in trait. If those identifiers are used differently, the

[PATCH] Fortran: Fix incompatible types between INTEGER(8) and TYPE(c_ptr)

2023-10-20 Thread Paul-Antoine Arras
Hi all, The attached patch fixes a bug that causes valid OpenMP declare variant directive and functions to be rejected with the following error (see testcase): c_ptr.f90:41:37: 41 | !$omp declare variant(foo_variant) & | 1 Error: vari

[PATCH v23 02/33] c-family, c++: Look up built-in traits via identifier node

2023-10-20 Thread Ken Matsui
Since RID_MAX soon reaches 255 and all built-in traits are used approximately once in a C++ translation unit, this patch removes all RID values for built-in traits and uses the identifier node to look up the specific trait. Rather than holding traits as keywords, we set all trait identifiers as ci

[PATCH v23 01/33] c++: Sort built-in traits alphabetically

2023-10-20 Thread Ken Matsui
This patch sorts built-in traits alphabetically for better code readability. gcc/cp/ChangeLog: * constraint.cc (diagnose_trait_expr): Sort built-in traits alphabetically. * cp-trait.def: Likewise. * semantics.cc (trait_expr_value): Likewise. (finish_trait_e

[PATCH v23 00/33] Optimize type traits performance

2023-10-20 Thread Ken Matsui
This patch series optimizes type traits performance by implementing built-in type traits and using them in libstdc++. Changes in v23: * Improved the comment in cp-tree.h. * Moved the definition of cp_traits to lex.cc from parser.cc. * Implemented __is_invocable built-in tr

[PATCH] middle-end: don't keep .MEM guard nodes for PHI nodes who dominate loop [PR111860]

2023-10-20 Thread Tamar Christina
Hi All, The previous patch tried to remove PHI nodes that dominated the first loop, however the correct fix is to only remove .MEM nodes. This patch thus makes the condition a bit stricter and only tries to remove MEM phi nodes. I couldn't figure out a way to easily determine if a particular PHI

[PATCH] tree-optimization/111383 - testcase for fixed PR

2023-10-20 Thread Richard Biener
Pushed. PR tree-optimization/111383 PR tree-optimization/110243 gcc/testsuite/ * gcc.dg/torture/pr111383.c: New testcase. --- gcc/testsuite/gcc.dg/torture/pr111383.c | 29 + 1 file changed, 29 insertions(+) create mode 100644 gcc/testsuite/gcc.dg

Re: [PATCH] A new copy propagation and PHI elimination pass

2023-10-20 Thread Filip Kastl
On Fri 2023-10-20 15:50:25, Filip Kastl wrote: > Bootstraped and tested* on x86_64-pc-linux-gnu. > > * One testcase (pr79691.c) did regress. However that is because the test is > dependent on a certain variable not being copy propagated. I will go into more > detail about this in a reply to this m

[PATCH] A new copy propagation and PHI elimination pass

2023-10-20 Thread Filip Kastl
Hi, this is a patch that I submitted two months ago as an RFC ([RFC] gimple ssa: SCCP - A new PHI optimization pass). I added some polish since. It is a new lightweight pass that removes redundant PHI functions and as a bonus does basic copy propagation. With Jan Hubička we measured that it is ab

Re: [PATCH] ifcvt: Don't lower bitfields with non-constant offsets [PR 111882]

2023-10-20 Thread Andre Vieira (lists)
On 20/10/2023 14:41, Richard Biener wrote: On Fri, 20 Oct 2023, Andre Vieira (lists) wrote: Hi, This patch stops lowering of bitfields by ifcvt when they have non-constant offsets as we are not likely to be able to do anything useful with those during vectorization. That also fixes the iss

Re: [PATCH] aarch64: [PR110986] Emit csinv again for `a ? ~b : b`

2023-10-20 Thread Richard Sandiford
Richard Earnshaw writes: > On 20/10/2023 13:13, Richard Sandiford wrote: >>> +(define_insn_and_split "*cmov_insn_insv" >>> + [(set (match_operand:GPI 0 "register_operand" "=r") >>> +(xor:GPI >>> +(neg:GPI >>> + (match_operator:GPI 1 "aarch64_comparison_operator" >>> + [(match

Re: [PATCH] ifcvt: Don't lower bitfields with non-constant offsets [PR 111882]

2023-10-20 Thread Richard Biener
On Fri, 20 Oct 2023, Andre Vieira (lists) wrote: > Hi, > > This patch stops lowering of bitfields by ifcvt when they have non-constant > offsets as we are not likely to be able to do anything useful with those > during > vectorization. That also fixes the issue reported in PR 111882, which was >

[PATCH] ifcvt: Don't lower bitfields with non-constant offsets [PR 111882]

2023-10-20 Thread Andre Vieira (lists)
Hi, This patch stops lowering of bitfields by ifcvt when they have non-constant offsets as we are not likely to be able to do anything useful with those during vectorization. That also fixes the issue reported in PR 111882, which was being caused by an offset with a side-effect being lowered,

Re: [PATCH]middle-end: don't pass loop_vinfo to vect_set_loop_condition during prolog peeling [PR111866]

2023-10-20 Thread Richard Biener
On Fri, 20 Oct 2023, Tamar Christina wrote: > Hi All, > > During the refactoring I had passed loop_vinfo on to vect_set_loop_condition > during prolog peeling. This parameter is unused in most cases except for in > vect_set_loop_condition_partial_vectors where it's behaviour depends on > whethe

[PATCH] tree-optimization/111445 - simple_iv simplification fault

2023-10-20 Thread Richard Biener
The following fixes a missed check in the simple_iv attempt to simplify (signed T)((unsigned T) base + step) where it allows a truncating inner conversion leading to wrong code. Bootstrap and regtest running on x86_64-unknown-linux-gnu. PR tree-optimization/111445 * tree-scalar-ev

Re: [PATCH] aarch64: [PR110986] Emit csinv again for `a ? ~b : b`

2023-10-20 Thread Richard Earnshaw
On 20/10/2023 13:13, Richard Sandiford wrote: +(define_insn_and_split "*cmov_insn_insv" + [(set (match_operand:GPI 0 "register_operand" "=r") +(xor:GPI +(neg:GPI + (match_operator:GPI 1 "aarch64_comparison_operator" + [(match_operand 2 "cc_register" "") (const

  1   2   >