[PATCH] RISC-V: Enable full coverage vect tests

2023-10-10 Thread Juzhe-Zhong
I have analyzed all existing FAILs. Except these following FAILs need to be addressed: FAIL: gcc.dg/vect/slp-reduc-7.c -flto -ffat-lto-objects execution test FAIL: gcc.dg/vect/slp-reduc-7.c execution test FAIL: gcc.dg/vect/vect-cond-arith-2.c -flto -ffat-lto-objects scan-tree-dump optimized " =

[Bug target/111745] [14 Regression] ICE: in extract_insn, at recog.cc:2791 (unrecognizable insn) with -ffloat-store -mavx512fp16 -mavx512vl

2023-10-10 Thread crazylht at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111745 --- Comment #3 from Hongtao.liu --- Fixed.

[Bug target/111745] [14 Regression] ICE: in extract_insn, at recog.cc:2791 (unrecognizable insn) with -ffloat-store -mavx512fp16 -mavx512vl

2023-10-10 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111745 --- Comment #2 from CVS Commits --- The master branch has been updated by hongtao Liu : https://gcc.gnu.org/g:4efe9085d087a8d94261e4c38dd2ba840f3419ac commit r14-4549-g4efe9085d087a8d94261e4c38dd2ba840f3419ac Author: liuhongt Date: Tue Oct

Re: [PATCH] Fix coroutine tests for libstdc++ gnu-version-namespace mode

2023-10-10 Thread François Dumont via Gcc
On 08/10/2023 15:59, Iain Sandoe wrote: Hi François, On 23 Sep 2023, at 21:10, François Dumont wrote: I'm eventually fixing those tests the same way we manage this problem in libstdc++ testsuite. testsuite: Add optional libstdc++ version namespace in expected diagnostic When

Re: [PATCH] Fix coroutine tests for libstdc++ gnu-version-namespace mode

2023-10-10 Thread François Dumont
On 08/10/2023 15:59, Iain Sandoe wrote: Hi François, On 23 Sep 2023, at 21:10, François Dumont wrote: I'm eventually fixing those tests the same way we manage this problem in libstdc++ testsuite. testsuite: Add optional libstdc++ version namespace in expected diagnostic When

Re: committed [RISC-V]: Harden test scan patterns

2023-10-10 Thread Joern Rennecke
On Sat, 30 Sept 2023 at 22:12, Joern Rennecke wrote: > Also, we might have different directives for not scanning in LTO sections - > or just ignoring .ascii . Or maybe the other way round - you have to do > something special if you want to scan inside strings, and by default we > don't look

Re: [committed] [PR target/93062] RISC-V: Handle long conditional branches for RISC-V

2023-10-10 Thread Jeff Law
On 10/10/23 18:24, Andrew Waterman wrote: I remembered another concern since we discussed this patch privately. Using ra for long calls results in a sequence that will corrupt the return-address stack. Yup. We've actually got data on that internally, it's not showing up in a significant way

[PATCH] RISC-V: Remove XFAIL of ssa-dom-cse-2.c

2023-10-10 Thread Juzhe-Zhong
Confirm RISC-V is able to CSE this case no matter whether we enable RVV or not. Remove XFAIL, to fix: XPASS: gcc.dg/tree-ssa/ssa-dom-cse-2.c scan-tree-dump optimized "return 28;" gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/ssa-dom-cse-2.c: Remove riscv. ---

RE: [PATCH] x86: set spincount 1 for x86 hybrid platform [PR109812]

2023-10-10 Thread Zhang, Jun
> -Original Message- > From: Jakub Jelinek > Sent: Tuesday, October 10, 2023 3:57 PM > To: Zhang, Jun > Cc: gcc-patches@gcc.gnu.org; ubiz...@gmail.com; Liu, Hongtao > > Subject: Re: [PATCH] x86: set spincount 1 for x86 hybrid platform [PR109812] > > On Tue, Oct 10, 2023 at 12:59:52PM

[Bug tree-optimization/111765] RISC-V: Faild to vectorize gen-vect-34.c

2023-10-10 Thread juzhe.zhong at rivai dot ai via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111765 --- Comment #3 from JuzheZhong --- If we specify the vector length to RVV and SVE: https://godbolt.org/z/njvsqYWhn Both can vectorize. ARM SVE: -msve-vector-bits=128 RVV: --param=riscv-autovec-preference=fixed-vlmax

[Bug tree-optimization/111765] RISC-V: Faild to vectorize gen-vect-34.c

2023-10-10 Thread juzhe.zhong at rivai dot ai via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111765 --- Comment #2 from JuzheZhong --- (In reply to Andrew Pinski from comment #1) > For SVE: > /app/example.cpp:6:18: missed: missing target support for reduction on > variable-length vectors. > > I assume it is the same issue for RVV. Yeah.

[Bug tree-optimization/111765] RISC-V: Faild to vectorize gen-vect-34.c

2023-10-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111765 --- Comment #1 from Andrew Pinski --- For SVE: /app/example.cpp:6:18: missed: missing target support for reduction on variable-length vectors. I assume it is the same issue for RVV.

[Bug tree-optimization/111766] New: Missed optimization with __builtin_unreachable and ands

2023-10-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111766 Bug ID: 111766 Summary: Missed optimization with __builtin_unreachable and ands Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: missed-optimization

[PATCH] early outs for functions in rs6000.cc

2023-10-10 Thread Jiufu Guo
Hi, There are some piece of code like below in rs6000.cc: ... if (xx) return x; else if (yy) return y; ... //else if chain else return d; Using early outs would be more preferable for this kind of code. The whole function rs6000_emit_set_long_const and num_insns_constant_gpr are

RE: [PATCH] RISC-V Regression: Make pattern match more accurate of vect-live-2.c

2023-10-10 Thread Li, Pan2
Committed, thanks Jeff. Pan -Original Message- From: Jeff Law Sent: Tuesday, October 10, 2023 11:26 PM To: Juzhe-Zhong ; gcc-patches@gcc.gnu.org Cc: rguent...@suse.de Subject: Re: [PATCH] RISC-V Regression: Make pattern match more accurate of vect-live-2.c On 10/10/23 08:57,

RE: [PATCH] RISC-V Regression: Fix FAIL of vect-multitypes-16.c for RVV

2023-10-10 Thread Li, Pan2
Committed, thanks Jeff. Pan -Original Message- From: Jeff Law Sent: Tuesday, October 10, 2023 11:29 PM To: Juzhe-Zhong ; gcc-patches@gcc.gnu.org Cc: rguent...@suse.de Subject: Re: [PATCH] RISC-V Regression: Fix FAIL of vect-multitypes-16.c for RVV On 10/10/23 08:49, Juzhe-Zhong

[Bug tree-optimization/111282] `a & (b ^ ~a)` (or `a & ~(a ^ b)`) not optimized to `a & b` in gimple

2023-10-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111282 Andrew Pinski changed: What|Removed |Added Keywords||patch URL|

[PATCH] MATCH: [PR111282] Simplify `a & (b ^ ~a)` to `a & b`

2023-10-10 Thread Andrew Pinski
While `a & (b ^ ~a)` is optimized to `a & b` on the rtl level, it is always good to optimize this at the gimple level and allows us to match a few extra things including where a is a comparison. Note I had to update/change the testcase and-1.c to avoid matching this case as we can match -2 and 1

[PATCH V1] use more get_range_query

2023-10-10 Thread Jiufu Guo
Hi, For "get_global_range_query" SSA_NAME_RANGE_INFO can be queried. For "get_range_query", it could get more context-aware range info. And look at the implementation of "get_range_query", it returns global range if no local fun info. So, if not quering for SSA_NAME and not chaning the IL, it

Re: [committed] [PR target/93062] RISC-V: Handle long conditional branches for RISC-V

2023-10-10 Thread Andrew Waterman
I remembered another concern since we discussed this patch privately. Using ra for long calls results in a sequence that will corrupt the return-address stack. Corrupting the RAS is potentially more costly than mispredicting a branch, since it can result in a cascading sequence of mispredictions

[PATCH v2] c++: Improve diagnostics for constexpr cast from void*

2023-10-10 Thread Nathaniel Shead
On Mon, Oct 09, 2023 at 04:10:20PM -0400, Jason Merrill wrote: > On 10/9/23 06:03, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu with > > GXX_TESTSUITE_STDS=98,11,14,17,20,23,26,impcx. > > > > -- >8 -- > > > > This patch improves the errors given when casting from

[PATCH v16 39/39] libstdc++: Optimize is_scalar trait performance

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

[PATCH v16 38/39] c++, libstdc++: Implement __is_scalar built-in trait

2023-10-10 Thread Ken Matsui
This patch implements built-in trait for std::is_scalar. The existent __is_scalar codes were replaced with __is_scalar_type to avoid unintentional macro replacement by the new built-in. gcc/cp/ChangeLog: * cp-trait.def: Define __is_scalar. * cp-trait.gperf: Reflect cp-trait.def

[PATCH v16 33/39] libstdc++: Optimize is_compound trait performance

2023-10-10 Thread Ken Matsui
This patch optimizes the performance of the is_compound trait by dispatching to the new __is_arithmetic built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_compound): Do not use __not_. (is_compound_v): Use is_fundamental_v instead. Signed-off-by: Ken Matsui

[PATCH v16 37/39] libstdc++: Optimize is_signed trait performance

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

[PATCH v16 36/39] c++, libstdc++: Implement __is_signed built-in trait

2023-10-10 Thread Ken Matsui
This patch implements built-in trait for std::is_signed. gcc/cp/ChangeLog: * cp-trait.def: Define __is_signed. * cp-trait.gperf: Reflect cp-trait.def change. * cp-trait.h: Likewise. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_SIGNED. *

[PATCH v16 34/39] c++: Implement __is_unsigned built-in trait

2023-10-10 Thread Ken Matsui
This patch implements built-in trait for std::is_unsigned. gcc/cp/ChangeLog: * cp-trait.def: Define __is_unsigned. * cp-trait.gperf: Reflect cp-trait.def change. * cp-trait.h: Likewise. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_UNSIGNED. *

[PATCH v16 35/39] libstdc++: Optimize is_unsigned trait performance

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

[Bug c/111765] New: RISC-V: Faild to vectorize gen-vect-34.c

2023-10-10 Thread juzhe.zhong at rivai dot ai via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111765 Bug ID: 111765 Summary: RISC-V: Faild to vectorize gen-vect-34.c Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c

[PATCH v16 31/39] libstdc++: Optimize is_arithmetic trait performance

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

[PATCH v16 32/39] libstdc++: Optimize is_fundamental trait performance

2023-10-10 Thread Ken Matsui
This patch optimizes the performance of the is_fundamental trait by dispatching to the new __is_arithmetic built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_fundamental_v): Use __is_arithmetic built-in trait. (is_fundamental): Likewise. Optimize the

[PATCH v16 22/39] libstdc++: Optimize is_reference trait performance

2023-10-10 Thread Ken Matsui
This patch optimizes the performance of the is_reference trait 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: Ken

[PATCH v16 28/39] c++, libstdc++: Implement __is_pointer built-in trait

2023-10-10 Thread Ken Matsui
This patch implements built-in trait for std::is_pointer. gcc/cp/ChangeLog: * cp-trait.def: Define __is_pointer. * cp-trait.gperf: Reflect cp-trait.def change. * cp-trait.h: Likewise. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_POINTER. *

[PATCH v16 30/39] c++, libstdc++: Implement __is_arithmetic built-in trait

2023-10-10 Thread Ken Matsui
This patch implements built-in trait for std::is_arithmetic. gcc/cp/ChangeLog: * cp-trait.def: Define __is_arithmetic. * cp-trait.gperf: Reflect cp-trait.def change. * cp-trait.h: Likewise. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_ARITHMETIC.

[PATCH v16 27/39] libstdc++: Optimize remove_pointer trait performance

2023-10-10 Thread Ken Matsui
This patch optimizes the performance of the remove_pointer trait 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 ---

[PATCH v16 29/39] libstdc++: Optimize is_pointer trait performance

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

[PATCH v16 21/39] c++: Implement __is_reference built-in trait

2023-10-10 Thread Ken Matsui
This patch implements built-in trait for std::is_reference. gcc/cp/ChangeLog: * cp-trait.def: Define __is_reference. * cp-trait.gperf: Reflect cp-trait.def change. * cp-trait.h: Likewise. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_REFERENCE. *

[PATCH v16 25/39] libstdc++: Optimize is_object trait performance

2023-10-10 Thread Ken Matsui
This patch optimizes the performance of the is_object trait by dispatching to the new __is_function and __is_reference built-in traits. libstdc++-v3/ChangeLog: * include/std/type_traits (is_object): Use __is_function and __is_reference built-in traits. (is_object_v):

[PATCH v16 26/39] c++: Implement __remove_pointer built-in trait

2023-10-10 Thread Ken Matsui
This patch implements built-in trait for std::remove_pointer. gcc/cp/ChangeLog: * cp-trait.def: Define __remove_pointer. * cp-trait.gperf: Reflect cp-trait.def change. * cp-trait.h: Likewise. * semantics.cc (finish_trait_type): Handle CPTK_REMOVE_POINTER.

[PATCH v16 20/39] libstdc++: Optimize is_member_object_pointer trait performance

2023-10-10 Thread Ken Matsui
This patch optimizes the performance of the is_member_object_pointer trait 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 v16 23/39] c++: Implement __is_function built-in trait

2023-10-10 Thread Ken Matsui
This patch implements built-in trait for std::is_function. gcc/cp/ChangeLog: * cp-trait.def: Define __is_function. * cp-trait.gperf: Reflect cp-trait.def change. * cp-trait.h: Likewise. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_FUNCTION. *

[PATCH v16 24/39] libstdc++: Optimize is_function trait performance

2023-10-10 Thread Ken Matsui
This patch optimizes the performance of the is_function trait 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 implementation.

[PATCH v16 18/39] libstdc++: Optimize is_member_function_pointer trait performance

2023-10-10 Thread Ken Matsui
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 v16 19/39] c++: Implement __is_member_object_pointer built-in trait

2023-10-10 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. * cp-trait.gperf: Reflect cp-trait.def change. * cp-trait.h: Likewise. * constraint.cc (diagnose_trait_expr): Handle

[PATCH v16 16/39] libstdc++: Optimize is_member_pointer trait performance

2023-10-10 Thread Ken Matsui
This patch optimizes the performance of the is_member_pointer trait 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):

[PATCH v16 17/39] c++: Implement __is_member_function_pointer built-in trait

2023-10-10 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. * cp-trait.gperf: Reflect cp-trait.def change. * cp-trait.h: Likewise. * constraint.cc (diagnose_trait_expr): Handle

[PATCH v16 15/39] c++: Implement __is_member_pointer built-in trait

2023-10-10 Thread Ken Matsui
This patch implements built-in trait for std::is_member_pointer. gcc/cp/ChangeLog: * cp-trait.def: Define __is_member_pointer. * cp-trait.gperf: Reflect cp-trait.def change. * cp-trait.h: Likewise. * constraint.cc (diagnose_trait_expr): Handle

[PATCH v16 14/39] libstdc++: Optimize is_scoped_enum trait performance

2023-10-10 Thread Ken Matsui
This patch optimizes the performance of the is_scoped_enum trait 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.

[PATCH v16 12/39] libstdc++: Optimize is_bounded_array trait performance

2023-10-10 Thread Ken Matsui
This patch optimizes the performance of the is_bounded_array trait 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 ---

[PATCH v16 13/39] c++: Implement __is_scoped_enum built-in trait

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

[PATCH v16 11/39] c++: Implement __is_bounded_array built-in trait

2023-10-10 Thread Ken Matsui
This patch implements built-in trait for std::is_bounded_array. gcc/cp/ChangeLog: * cp-trait.def: Define __is_bounded_array. * cp-trait.gperf: Reflect cp-trait.def change. * cp-trait.h: Likewise. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_BOUNDED_ARRAY.

[PATCH v16 10/39] libstdc++: Optimize is_unbounded_array trait performance

2023-10-10 Thread Ken Matsui
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 ---

[PATCH v16 09/39] c++: Implement __is_unbounded_array built-in trait

2023-10-10 Thread Ken Matsui
This patch implements built-in trait for std::is_unbounded_array. gcc/cp/ChangeLog: * cp-trait.def: Define __is_unbounded_array. * cp-trait.gperf: Reflect cp-trait.def change. * cp-trait.h: Likewise. * constraint.cc (diagnose_trait_expr): Handle

[PATCH v16 08/39] libstdc++: Optimize is_array trait performance

2023-10-10 Thread Ken Matsui
This patch optimizes the performance of the is_array trait 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 ---

[PATCH v16 07/39] c++: Implement __is_array built-in trait

2023-10-10 Thread Ken Matsui
This patch implements built-in trait for std::is_array. gcc/cp/ChangeLog: * cp-trait.def: Define __is_array. * cp-trait.gperf: Reflect cp-trait.def change. * cp-trait.h: Likewise. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_ARRAY. * semantics.cc

[PATCH v16 06/39] libstdc++: Optimize is_volatile trait performance

2023-10-10 Thread Ken Matsui
This patch optimizes the performance of the is_volatile trait 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 Matsui

[PATCH v16 05/39] c++: Implement __is_volatile built-in trait

2023-10-10 Thread Ken Matsui
This patch implements built-in trait for std::is_volatile. gcc/cp/ChangeLog: * cp-trait.def: Define __is_volatile. * cp-trait.gperf: Reflect cp-trait.def change. * cp-trait.h: Likewise. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_VOLATILE. *

[PATCH v16 04/39] libstdc++: Optimize is_const trait performance

2023-10-10 Thread Ken Matsui
This patch optimizes the performance of the is_const trait 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 ---

[PATCH v16 03/39] c++: Implement __is_const built-in trait

2023-10-10 Thread Ken Matsui
This patch implements built-in trait for std::is_const. gcc/cp/ChangeLog: * Make-lang.in: Update key positions for gperf, based on automatically computed values. * cp-trait.def: Define __is_const. * cp-trait.gperf: Reflect cp-trait.def change. *

[PATCH v16 02/39] c-family, c++: Look up built-in traits through gperf

2023-10-10 Thread Ken Matsui
Since RID_MAX soon reaches 255 and all traits are used approximately once in a C++ translation unit, this patch instead uses only RID_TRAIT_EXPR and RID_TRAIT_TYPE for all traits and uses gperf to look up the specific trait. gcc/c-family/ChangeLog: * c-common.cc (c_common_reswords): Map

[PATCH v16 01/39] c++: Sort built-in identifiers alphabetically

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

[PATCH v16 00/39] Optimize type traits performance

2023-10-10 Thread Ken Matsui
This patch series optimizes type traits performance by implementing built-in type traits and using them in libstdc++. Changes in v16: * Rebased on top of trunk * Improved clarity of the commit message * Simplified Make-lang.in and gperf struct Changes in v15: *

[Bug target/93062] Failed to generate indirect branch for long branches on riscv

2023-10-10 Thread law at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93062 Jeffrey A. Law changed: What|Removed |Added Resolution|--- |FIXED Status|NEW

[committed] [PR target/93062] RISC-V: Handle long conditional branches for RISC-V

2023-10-10 Thread Jeff Law
Ventana has had a variant of this patch from Andrew W. in its tree for at least a year. I'm dusting it off and submitting it on Andrew's behalf. There's multiple approaches we could be using here. First we could make $ra fixed and use it as the scratch register for the long branch

[Bug tree-optimization/111760] risc-v regression: COND_LEN_* incorrect fold/simplify in middle-end

2023-10-10 Thread juzhe.zhong at rivai dot ai via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111760 --- Comment #5 from JuzheZhong --- (In reply to Robin Dapp from comment #2) > https://gcc.gnu.org/pipermail/gcc-patches/2023-September/629904.html > > prevents the wrong code but still leaves us with a redundant negation (and > it is not the

[Bug tree-optimization/111760] risc-v regression: COND_LEN_* incorrect fold/simplify in middle-end

2023-10-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111760 --- Comment #4 from Andrew Pinski --- (In reply to JuzheZhong from comment #3) > (In reply to Andrew Pinski from comment #1) > > *** Bug 111761 has been marked as a duplicate of this bug. *** > > Oh. So sorry about that. I don't know why I

Re: Re: [PATCH] RISC-V/testsuite: Enable `vect_pack_trunc'

2023-10-10 Thread 钟居哲
Thanks for investigation. I think the number 145 is reasonable. Even though it is more than my number. I guess the reason you still have more FAILs than me because you are using QEMU (I am using SPIKE), also you need to specify miasligned option to the simulator. For example, for SPIKE, we

[Bug tree-optimization/111760] risc-v regression: COND_LEN_* incorrect fold/simplify in middle-end

2023-10-10 Thread juzhe.zhong at rivai dot ai via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111760 --- Comment #3 from JuzheZhong --- (In reply to Andrew Pinski from comment #1) > *** Bug 111761 has been marked as a duplicate of this bug. *** Oh. So sorry about that. I don't know why I file 2 consecutive bugs here. Really sorry for my

[Bug analyzer/111537] ICE: in set_cell_span, at text-art/table.cc:148 with D front-end and -fanalyzer

2023-10-10 Thread dmalcolm at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111537 --- Comment #1 from David Malcolm --- Am trying to reproduce locally, but when I run this in my BUILDDIR/gcc: ./gdc -B. -S -fanalyzer oob.d I get: d21: error: cannot find source code for runtime library file 'object.d' Possibly a silly

[Bug tree-optimization/111432] `bool & (a|1)` is not optimized to just `bool`

2023-10-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111432 Andrew Pinski changed: What|Removed |Added Assignee|unassigned at gcc dot gnu.org |pinskia at gcc dot gnu.org

Re: Re: [PATCH] RISC-V/testsuite: Enable `vect_pack_trunc'

2023-10-10 Thread Maciej W. Rozycki
On Tue, 10 Oct 2023, juzhe.zh...@rivai.ai wrote: > It's weird. Could you give me the FAILs report? I keep forgetting that I have a piece of code in my board description files that makes the testsuite leave output files in place, which helps much when debugging failures (although it's not a

[Bug c++/109422] wrong depth used for template parameter mangling for lambdas in function signatures

2023-10-10 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109422 --- Comment #2 from CVS Commits --- The trunk branch has been updated by Jason Merrill : https://gcc.gnu.org/g:bd5719bd7f7cb23e5ed96a1f1a28efbb3dec4a31 commit r14-4544-gbd5719bd7f7cb23e5ed96a1f1a28efbb3dec4a31 Author: Jason Merrill Date:

[pushed] c++: mangle multiple levels of template parms [PR109422]

2023-10-10 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- This becomes be more important with concepts, but can also be seen with generic lambdas. PR c++/109422 gcc/cp/ChangeLog: * mangle.cc (write_template_param): Also mangle level. gcc/testsuite/ChangeLog: *

Re: [RFC] RISC-V: Handle new types in scheduling descriptions

2023-10-10 Thread Edwin Lu
On 10/10/2023 10:11 AM, Jeff Law wrote: On 10/9/23 15:02, Edwin Lu wrote: Now that every insn is guaranteed a type, we want to ensure the types are handled by the existing scheduling descriptions. There are 2 approaches I see: 1. Create a new pipeline intended to eventually abort

[Bug c/111758] #pragma region/endregion fails between if/else

2023-10-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111758 Andrew Pinski changed: What|Removed |Added See Also||https://gcc.gnu.org/bugzill

[Bug tree-optimization/111760] risc-v regression: COND_LEN_* incorrect fold/simplify in middle-end

2023-10-10 Thread rdapp at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111760 Robin Dapp changed: What|Removed |Added CC||rdapp at gcc dot gnu.org,

[Bug fortran/104351] ICE in gfc_generate_initializer, at fortran/expr.cc:5140

2023-10-10 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104351 anlauf at gcc dot gnu.org changed: What|Removed |Added Keywords||accepts-invalid

[Bug tree-optimization/111764] [11/12/13/14 Regression] Wrong code at -O3 on x86_64-linux-gnu

2023-10-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111764 --- Comment #2 from Andrew Pinski --- (In reply to Andrew Pinski from comment #1) > Note r11-5965-g04bff1bbfc1 just exposed the issue, you can reproduce the > issue before that with `-fno-vector-cost-model` added and it worked with > that

[Bug tree-optimization/111764] [11/12/13/14 Regression] Wrong code at -O3 on x86_64-linux-gnu

2023-10-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111764 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|

[Bug tree-optimization/111764] New: Wrong code at -O3 on x86_64-linux-gnu since r11-5965-g04bff1bbfc1

2023-10-10 Thread shaohua.li at inf dot ethz.ch via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111764 Bug ID: 111764 Summary: Wrong code at -O3 on x86_64-linux-gnu since r11-5965-g04bff1bbfc1 Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: wrong-code

[Bug c++/71283] Inconsistent location for C++ warning options in the manual

2023-10-10 Thread egallager at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71283 Eric Gallager changed: What|Removed |Added CC||fw at gcc dot gnu.org --- Comment #18

[Bug tree-optimization/111282] `a & (b ^ ~a)` (or `a & ~(a ^ b)`) not optimized to `a & b` in gimple

2023-10-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111282 --- Comment #4 from Andrew Pinski --- Created attachment 56090 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56090=edit Patch under testing

[Bug libstdc++/111747] Problem with large float list initialization

2023-10-10 Thread oplata.kes1 at mail dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111747 --- Comment #2 from oplata.kes1 at mail dot ru --- (In reply to Andrew Pinski from comment #1) > > 32bit floating point has the following characteristics: > Sign bit: 1 bit > Exponent width: 8 bits > Significand precision: 24 bits (23

[Bug target/111763] New: `(a & ~1) | 2` could be done as `(a & ~(1 | 2)) + 2` which allows to use leal

2023-10-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111763 Bug ID: 111763 Summary: `(a & ~1) | 2` could be done as `(a & ~(1 | 2)) + 2` which allows to use leal Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords:

[Bug tree-optimization/111762] New: `(a | 3) ^ 1` and `(a & ~1) | 2` should produce the same code

2023-10-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111762 Bug ID: 111762 Summary: `(a | 3) ^ 1` and `(a & ~1) | 2` should produce the same code Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords:

Re: Register allocation cost question

2023-10-10 Thread Segher Boessenkool
Hi Andrew, On Tue, Oct 10, 2023 at 04:11:18PM +0100, Andrew Stubbs wrote: > I'm also seeing wrong-code bugs when I allow more than 32 new registers, > but that might be an unrelated problem. Or the allocation is broken? I'm > still analyzing this. It could be connected. both things should not

[Bug target/111428] RISC-V vector: Flaky segfault in {min|max}val_char_{1|2}.f90

2023-10-10 Thread rdapp at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111428 --- Comment #3 from Robin Dapp --- Still difficult to track down. The following is a smaller reproducer: program main implicit none integer, parameter :: n=5, m=3 integer, dimension(n,m) :: v real, dimension(n,m) :: r do call

[Bug middle-end/17886] variable rotate and unsigned long long rotate should be better optimized

2023-10-10 Thread roger at nextmovesoftware dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=17886 Roger Sayle changed: What|Removed |Added CC||roger at nextmovesoftware dot com

Re: [PATCH] wide-int: Allow up to 16320 bits wide_int and change widest_int precision to 32640 bits [PR102989]

2023-10-10 Thread Jakub Jelinek
On Tue, Oct 10, 2023 at 06:41:50PM +0100, Richard Sandiford wrote: > > On the wide_int side, I see > > 155291 576 > > (supposedly because of bound_wide_int, where we create wide_int_ref from > > the 576-bit precision bound_wide_int and then create 576-bit wide_int when > > using unary or binary

Re: [PATCH] RFC: Add late-combine pass [PR106594]

2023-10-10 Thread Jeff Law
On 10/7/23 06:58, Richard Sandiford wrote: Yeah, that'd probably be best. I need to split the patch up into a proper submission sequence, do more testing, and make it RFA quality. Jeff has also found a couple of regressions that I need to look at. When you've got updates, just let me know.

[Bug c++/111544] [14 regression] assignment of read-only location after r14-4111-g6e92a6a2a72d3b

2023-10-10 Thread seurer at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111544 seurer at gcc dot gnu.org changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED

[Bug middle-end/111732] genmatch missed optimization

2023-10-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111732 Andrew Pinski changed: What|Removed |Added Keywords||internal-improvement Last

[Bug c/111761] risc-v regression: COND_LEN_* incorrect fold/simplify in middle-end

2023-10-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111761 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c/111760] risc-v regression: COND_LEN_* incorrect fold/simplify in middle-end

2023-10-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111760 --- Comment #1 from Andrew Pinski --- *** Bug 111761 has been marked as a duplicate of this bug. ***

Re: [PATCH] wide-int: Allow up to 16320 bits wide_int and change widest_int precision to 32640 bits [PR102989]

2023-10-10 Thread Richard Sandiford
Jakub Jelinek writes: > On Mon, Oct 09, 2023 at 03:44:10PM +0200, Jakub Jelinek wrote: >> Thanks, just quick answers, will work on patch adjustments after trying to >> get rid of rwide_int (seems dwarf2out has very limited needs from it, just >> some routine to construct it in GCed memory (and

Re: C89 question: Do we need to accept -Wint-conversion warnings

2023-10-10 Thread Joel Sherrill
On Tue, Oct 10, 2023 at 12:09 PM Florian Weimer via Gcc wrote: > * Jakub Jelinek: > > > On Tue, Oct 10, 2023 at 12:30:52PM -0400, Jason Merrill via Gcc wrote: > >> On Tue, Oct 10, 2023 at 7:30 AM Florian Weimer via Gcc > > >> wrote: > >> > >> > Are these code fragments valid C89 code? > >> > >

[Bug target/106101] [12 Regression] ICE in reg_bitfield_target_p since r12-4428-g147ed0184f403b

2023-10-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106101 --- Comment #30 from Andrew Pinski --- (In reply to Andrew Pinski from comment #29) > (In reply to Florian Weimer from comment #28) > > (In reply to Richard Biener from comment #1) > > > Created attachment 53207 [details] > > > reduced testcase

[Bug target/106101] [12 Regression] ICE in reg_bitfield_target_p since r12-4428-g147ed0184f403b

2023-10-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106101 --- Comment #29 from Andrew Pinski --- (In reply to Florian Weimer from comment #28) > (In reply to Richard Biener from comment #1) > > Created attachment 53207 [details] > > reduced testcase > > Do you happen to have the unreduced test case

Function multiversioning ABI issues

2023-10-10 Thread Andrew Carlotti via Gcc
Hi, I've been looking into existing function multiversioning implementations (while working to add support for fmv in GCC on aarch64). It seems there are various inconsistencies among current implementations, and it's unclear to me which (if any) of these differences could be problematic.

[Bug tree-optimization/111679] `(~a) | (a ^ b)` is not simplified to `~(a & b)`

2023-10-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111679 Andrew Pinski changed: What|Removed |Added Target Milestone|--- |14.0 Status|ASSIGNED

  1   2   3   >