[PATCH] MATCH: Add simplifications for `(a * zero_one) ==/!= CST`

2023-09-15 Thread Andrew Pinski via Gcc-patches
Transforming `(a * b@[0,1]) != 0` into `((cast)b) & a != 0` will produce better code as a lot of the time b is defined by a comparison. Also since canonicalize `a & -zero_one` into `a * zero_one` we start to lose information when doing comparisons against 0. In the case of PR 110992, we lose that

[PATCH] internal-fn: Convert uninitialized SSA_NAME into SCRATCH rtx[PR110751]

2023-09-15 Thread Juzhe-Zhong
According to PR: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110751 As Richard and Richi suggested, we recognize uninitialized SSA_NAME and convert it into SCRATCH rtx if the target predicate allows SCRATCH. It can help to reduce redundant data move instructions of targets like RISC-V. Here

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

2023-09-15 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111432 Bug ID: 111432 Summary: `bool & (a|1)` is not optimized to just `bool` Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: missed-optimization Severity:

[Bug tree-optimization/111431] a & (a == 0) is not optimized to 0

2023-09-15 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111431 --- Comment #5 from Andrew Pinski --- Created attachment 55907 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55907=edit Patch which I am testing I should note that LLVM does NOT do this simple pattern matching either.

[Bug tree-optimization/111431] a & (a == 0) is not optimized to 0

2023-09-15 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111431 --- Comment #4 from Andrew Pinski --- Note I found this while looking into the patch that was originally posted for PR 57755 which removed the xfail for binop-notand1a.c/binop-notand4a.c but found this was a better way of fixing this rather

[Bug tree-optimization/111431] a & (a == 0) is not optimized to 0

2023-09-15 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111431 --- Comment #3 from Andrew Pinski --- Note this is an extension of the pattern: /* X & !X -> 0. */ (simplify (bit_and:c @0 (logical_inverted_value @0)) Which was moved to match via r5-4683-g5609420fbab5ca .

[Bug tree-optimization/111431] a & (a == 0) is not optimized to 0

2023-09-15 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111431 --- Comment #2 from Andrew Pinski --- The pattern should be: (simplify (bit_and:c (convert@2 (eq @0 INTEGER_CST@1)) (convert? @0)) (if ((wi::to_wide (@1) & 1) != 0) @2 { build_zero_cst (type); })) Since 0/1 of the eq, the convert on the

[Bug tree-optimization/111431] a & (a == 0) is not optimized to 0

2023-09-15 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111431 Andrew Pinski changed: What|Removed |Added Last reconfirmed||2023-09-16

[Bug tree-optimization/111431] New: a & (a == 0) is not optimized to 0

2023-09-15 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111431 Bug ID: 111431 Summary: a & (a == 0) is not optimized to 0 Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: missed-optimization, xfail Severity: normal

[Bug tree-optimization/57755] Improve fold_binary_op_with_conditional_arg

2023-09-15 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57755 Andrew Pinski changed: What|Removed |Added Status|NEW |ASSIGNED Severity|normal

[Bug c++/90670] const& template parameter in a header trips -Wsubobject-linkage

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

[Bug c++/90670] const& template parameter in a header trips -Wsubobject-linkage

2023-09-15 Thread adam1.byrd at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90670 --- Comment #3 from Adam Byrd --- Hmm, I reckon that makes sense. Though the wording is confusing. Why is it "uses the anonymous namespace" instead of something like "has internal linkage". I'm not aware of an anonymous namespace being involved

[Bug ipa/111430] IPA read only variable analysis should handle the case where the storing was the same as the initialization

2023-09-15 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111430 --- Comment #1 from Andrew Pinski --- Note LLVM does this optimization ...

[Bug ipa/111430] IPA read only variable analysis should handle the case where the storing was the same as the initialization

2023-09-15 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111430 Andrew Pinski changed: What|Removed |Added Severity|normal |enhancement

[Bug ipa/111430] New: IPA read only variable analysis should handle the case where the storing was the same as the initialization

2023-09-15 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111430 Bug ID: 111430 Summary: IPA read only variable analysis should handle the case where the storing was the same as the initialization Product: gcc Version: 14.0 Status:

RE: [PATCH v1] RISC-V: Support FP SGNJX autovec for VLS mode

2023-09-15 Thread Li, Pan2 via Gcc-patches
Committed, thanks Juzhe. Pan From: 钟居哲 Sent: Saturday, September 16, 2023 7:21 AM To: Li, Pan2 ; gcc-patches Cc: Li, Pan2 ; Wang, Yanzhang ; kito.cheng Subject: Re: [PATCH v1] RISC-V: Support FP SGNJX autovec for VLS mode lgtm

[PATCH] libcpp: Fix ICE on #include after a line marker directive [PR61474]

2023-09-15 Thread Lewis Hyatt via Gcc-patches
Hello- This fixes an old PR, bootstrap + regtest on x86-64 Linux. Please let me know if it's ok? Thanks! -Lewis -- >8 -- As noted in the PR, GCC will segfault if a file name is first seen in a linemarker directive, and then later seen in a normal #include. This is because the fake include

[Bug middle-end/111429] New: NO_COLOR env should disable color

2023-09-15 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111429 Bug ID: 111429 Summary: NO_COLOR env should disable color Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3

[PATCH v14 19/40] libstdc++: Optimize is_member_function_pointer trait performance

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

[PATCH v14 01/40] c++: Sort built-in identifiers alphabetically

2023-09-15 Thread Ken Matsui via Gcc-patches
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 v14 28/40] libstdc++: Optimize remove_pointer trait performance

2023-09-15 Thread Ken Matsui via Gcc-patches
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 v14 06/40] c++: Implement __is_array built-in trait

2023-09-15 Thread Ken Matsui via Gcc-patches
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.

[PATCH v14 35/40] c++: Implement __is_unsigned built-in trait

2023-09-15 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_unsigned. gcc/cp/ChangeLog: * cp-trait.def: Define __is_unsigned. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_UNSIGNED. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise.

[PATCH v14 03/40] libstdc++: Optimize is_const trait performance

2023-09-15 Thread Ken Matsui via Gcc-patches
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 v14 07/40] libstdc++: Optimize is_array trait performance

2023-09-15 Thread Ken Matsui via Gcc-patches
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 v14 18/40] c++: Implement __is_member_function_pointer built-in trait

2023-09-15 Thread Ken Matsui via Gcc-patches
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):

[PATCH v14 34/40] libstdc++: Optimize is_compound trait performance

2023-09-15 Thread Ken Matsui via Gcc-patches
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 v14 30/40] libstdc++: Optimize is_pointer trait performance

2023-09-15 Thread Ken Matsui via Gcc-patches
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 v14 10/40] c++: Implement __is_bounded_array built-in trait

2023-09-15 Thread Ken Matsui via Gcc-patches
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):

[PATCH v14 00/40] Optimize type traits performance

2023-09-15 Thread Ken Matsui via Gcc-patches
This patch series optimizes type traits performance by implementing built-in type traits and using them in libstdc++. Changes in v14: * Attached the benchmark results of the enum rid change Changes in v13: * Fixed ambiguous commit message and comment Changes in v12: *

[PATCH v14 20/40] c++: Implement __is_member_object_pointer built-in trait

2023-09-15 Thread Ken Matsui via Gcc-patches
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 v14 27/40] c++: Implement __remove_pointer built-in trait

2023-09-15 Thread Ken Matsui via Gcc-patches
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

[PATCH v14 14/40] c++: Implement __is_member_pointer built-in trait

2023-09-15 Thread Ken Matsui via Gcc-patches
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):

[PATCH v14 38/40] libstdc++: Optimize is_signed trait performance

2023-09-15 Thread Ken Matsui via Gcc-patches
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 v14 09/40] libstdc++: Optimize is_unbounded_array trait performance

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

[PATCH v14 11/40] libstdc++: Optimize is_bounded_array trait performance

2023-09-15 Thread Ken Matsui via Gcc-patches
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 v14 39/40] c++, libstdc++: Implement __is_scalar built-in trait

2023-09-15 Thread Ken Matsui via Gcc-patches
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. * constraint.cc (diagnose_trait_expr):

[PATCH v14 29/40] c++, libstdc++: Implement __is_pointer built-in trait

2023-09-15 Thread Ken Matsui via Gcc-patches
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.

[PATCH v14 31/40] c++, libstdc++: Implement __is_arithmetic built-in trait

2023-09-15 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_arithmetic. gcc/cp/ChangeLog: * cp-trait.def: Define __is_arithmetic. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_ARITHMETIC. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise.

[PATCH v14 33/40] libstdc++: Optimize is_fundamental trait performance

2023-09-15 Thread Ken Matsui via Gcc-patches
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 v14 21/40] libstdc++: Optimize is_member_object_pointer trait performance

2023-09-15 Thread Ken Matsui via Gcc-patches
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 v14 15/40] libstdc++: Optimize is_member_pointer trait performance

2023-09-15 Thread Ken Matsui via Gcc-patches
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 v14 22/40] c++: Implement __is_reference built-in trait

2023-09-15 Thread Ken Matsui via Gcc-patches
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.

[PATCH v14 36/40] libstdc++: Optimize is_unsigned trait performance

2023-09-15 Thread Ken Matsui via Gcc-patches
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

[PATCH v14 40/40] libstdc++: Optimize is_scalar trait performance

2023-09-15 Thread Ken Matsui via Gcc-patches
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 v14 02/40] c++: Implement __is_const built-in trait

2023-09-15 Thread Ken Matsui via Gcc-patches
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.

[PATCH v14 13/40] libstdc++: Optimize is_scoped_enum trait performance

2023-09-15 Thread Ken Matsui via Gcc-patches
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 v14 32/40] libstdc++: Optimize is_arithmetic trait performance

2023-09-15 Thread Ken Matsui via Gcc-patches
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 v14 24/40] c++: Implement __is_function built-in trait

2023-09-15 Thread Ken Matsui via Gcc-patches
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.

[PATCH v14 37/40] c++, libstdc++: Implement __is_signed built-in trait

2023-09-15 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_signed. gcc/cp/ChangeLog: * cp-trait.def: Define __is_signed. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_SIGNED. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise.

[PATCH v14 26/40] libstdc++: Optimize is_object trait performance

2023-09-15 Thread Ken Matsui via Gcc-patches
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 v14 25/40] libstdc++: Optimize is_function trait performance

2023-09-15 Thread Ken Matsui via Gcc-patches
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 v14 08/40] c++: Implement __is_unbounded_array built-in trait

2023-09-15 Thread Ken Matsui via Gcc-patches
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.

[PATCH v14 23/40] libstdc++: Optimize is_reference trait performance

2023-09-15 Thread Ken Matsui via Gcc-patches
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 v14 16/40] c, c++: Use 16 bits for all use of enum rid for more keyword space

2023-09-15 Thread Ken Matsui via Gcc-patches
Now that RID_MAX has reached 255, we need to update the bit sizes of every use of the enum rid from 8 to 16 to support more keywords. For struct token_indent_info, the 8-bit increase does not change the overall struct size because the 8-bit just consumes 1 byte from 2 bytes of external

[PATCH v14 05/40] libstdc++: Optimize is_volatile trait performance

2023-09-15 Thread Ken Matsui via Gcc-patches
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 v14 12/40] c++: Implement __is_scoped_enum built-in trait

2023-09-15 Thread Ken Matsui via Gcc-patches
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 v14 17/40] c-family: Fix C_SET_RID_CODE to handle 16-bit rid code correctly

2023-09-15 Thread Ken Matsui via Gcc-patches
This patch fixes incorrect handling for the new 16-bit rid code. Unsigned char was previously used for the 8-bit rid code, but unsigned short is now required. gcc/c-family/ChangeLog: * c-common.h (C_SET_RID_CODE): Use unsigned short instead of unsigned char. Ref: Initial

[PATCH v14 04/40] c++: Implement __is_volatile built-in trait

2023-09-15 Thread Ken Matsui via Gcc-patches
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.

Re: [PATCH v11 16/40] c, c++: Use 16 bits for all use of enum rid for more keyword space

2023-09-15 Thread Ken Matsui via Gcc-patches
On Thu, Sep 14, 2023 at 10:54 AM Joseph Myers wrote: > > On Wed, 13 Sep 2023, Ken Matsui via Gcc-patches wrote: > > > diff --git a/gcc/c/c-parser.h b/gcc/c/c-parser.h > > index 545f0f4d9eb..eed6deaf0f8 100644 > > --- a/gcc/c/c-parser.h > > +++ b/gcc/c/c-parser.h > > @@ -51,14 +51,14 @@ enum

Re: [PATCH v1] RISC-V: Support FP SGNJX autovec for VLS mode

2023-09-15 Thread 钟居哲
lgtm juzhe.zh...@rivai.ai From: pan2.li Date: 2023-09-15 21:23 To: gcc-patches CC: juzhe.zhong; pan2.li; yanzhang.wang; kito.cheng Subject: [PATCH v1] RISC-V: Support FP SGNJX autovec for VLS mode From: Pan Li This patch would like to allow the VLS mode autovec for the floating-point

[committed 08/11] libstdc++: Remove dg-options "-std=gnu++20" from 27_io tests

2023-09-15 Thread Jonathan Wakely via Gcc-patches
Tested aarch64-linux. Pushed to trunk. -- >8 -- The testsuite will automatically select C++20 for these tests now, and removing the hardcoded -std option allows them to be tested for C++23 and C++26 as well. libstdc++-v3/ChangeLog: *

[committed 11/11] libstdc++: Do not require effective target pthread for some tests

2023-09-15 Thread Jonathan Wakely via Gcc-patches
Tested aarch64-linux. Pushed to trunk. -- >8 -- We can remove { dg-require-effective-target pthread } and allow these tests non-pthread targets and conditionally adding -pthread only for pthread targets. Also remove the { dg-options "-std=gnu++20" } that is no longer needed.

[committed 10/11] libstdc++: Remove dg-options "-std=gnu++20" from remaining tests

2023-09-15 Thread Jonathan Wakely via Gcc-patches
Tested aarch64-linux. Pushed to trunk. -- >8 -- The testsuite will automatically select C++20 for these tests now, and removing the hardcoded -std option allows them to be tested for C++23 and C++26 as well. libstdc++-v3/ChangeLog: * testsuite/18_support/coroutines/95917.cc: Remove

[committed 05/11] libstdc++: Remove dg-options "-std=gnu++20" from 23_containers tests

2023-09-15 Thread Jonathan Wakely via Gcc-patches
Tested aarch64-linux. Pushed to trunk. -- >8 -- The testsuite will automatically select C++20 for these tests now, and removing the hardcoded -std option allows them to be tested for C++23 and C++26 as well. libstdc++-v3/ChangeLog: *

[committed 07/11] libstdc++: Remove dg-options "-std=gnu++20" from 26_numerics tests

2023-09-15 Thread Jonathan Wakely via Gcc-patches
Tested aarch64-linux. Pushed to trunk. -- >8 -- The testsuite will automatically select C++20 for these tests now, and removing the hardcoded -std option allows them to be tested for C++23 and C++26 as well. libstdc++-v3/ChangeLog: * testsuite/26_numerics/accumulate/constexpr.cc:

[committed 09/11] libstdc++: Remove dg-options "-std=gnu++20" from 30_threads tests

2023-09-15 Thread Jonathan Wakely via Gcc-patches
Tested aarch64-linux. Pushed to trunk. -- >8 -- The testsuite will automatically select C++20 for these tests now, and removing the hardcoded -std option allows them to be tested for C++23 and C++26 as well. libstdc++-v3/ChangeLog: * testsuite/30_threads/barrier/1.cc: Remove dg-options

[committed 04/11] libstdc++: Remove dg-options "-std=gnu++20" from 21_strings tests

2023-09-15 Thread Jonathan Wakely via Gcc-patches
Tested aarch64-linux. Pushed to trunk. -- >8 -- The testsuite will automatically select C++20 for these tests now, and removing the hardcoded -std option allows them to be tested for C++23 and C++26 as well. libstdc++-v3/ChangeLog: *

[committed 06/11] libstdc++: Remove dg-options "-std=gnu++20" from 24_iterators tests

2023-09-15 Thread Jonathan Wakely via Gcc-patches
Tested aarch64-linux. Pushed to trunk. -- >8 -- The testsuite will automatically select C++20 for these tests now, and removing the hardcoded -std option allows them to be tested for C++23 and C++26 as well. libstdc++-v3/ChangeLog: * testsuite/24_iterators/aliases.cc: Remove dg-options

[committed 01/11] libstdc++: Remove dg-options "-std=gnu++20" from tests

2023-09-15 Thread Jonathan Wakely via Gcc-patches
Tested aarch64-linux. Pushed to trunk. -- >8 -- The testsuite will automatically select C++20 for these tests now, and removing the hardcoded -std option allows them to be tested for C++23 and C++26 as well. libstdc++-v3/ChangeLog: *

[committed 03/11] libstdc++: Remove dg-options "-std=gnu++20" from 20_utils tests

2023-09-15 Thread Jonathan Wakely via Gcc-patches
Tested aarch64-linux. Pushed to trunk. -- >8 -- The testsuite will automatically select C++20 for these tests now, and removing the hardcoded -std option allows them to be tested for C++23 and C++26 as well. libstdc++-v3/ChangeLog: * testsuite/20_util/allocator/105975.cc: Remove

[committed 02/11] libstdc++: Remove dg-options "-std=gnu++20" from tests

2023-09-15 Thread Jonathan Wakely via Gcc-patches
Tested aarch64-linux. Pushed to trunk. -- >8 -- The testsuite will automatically select C++20 for these tests now, and removing the hardcoded -std option allows them to be tested for C++23 and C++26 as well. libstdc++-v3/ChangeLog: *

[committed] libstdc++: Add missing tests for std::basic_filebuf::native_handle()

2023-09-15 Thread Jonathan Wakely via Gcc-patches
Tested aarch64-linux. Pushed to trunk. -- >8 -- I forgot to 'git add' these files in the commit that added the new member function to basic_filebuf. libstdc++-v3/ChangeLog: * testsuite/27_io/basic_filebuf/native_handle/char/1.cc: New test. *

[committed] libstdc++: Implement C++26 native handles for file streams (P1759R6)

2023-09-15 Thread Jonathan Wakely via Gcc-patches
Tested aarch64-linux. Pushed to trunk. -- >8 -- The new __basic_file::native_handle() function can be added for C++11 and above, because the names "native_handle" and "native_handle_type" are already reserved since C++11. Exporting those symbols from the shared library does no harm, even if the

[committed] libstdc++: Add log line to testsuite output

2023-09-15 Thread Jonathan Wakely via Gcc-patches
Tested aarch64-linux. Pushed to trunk. This makes it easier to debug the problem when a test isn't running because there's a testsuite_files that doesn't include it. -- >8 -- Write a line to the log when using a testsuite_files file. libstdc++-v3/ChangeLog: *

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

2023-09-15 Thread Jonathan Wakely via Gcc-patches
On Mon, 11 Sept 2023 at 17:37, Jonathan Wakely via Libstdc++ wrote: > > This patch series replicates the behaviour of the g++ testsuite, so that > libstdc++ tests can easily be run for multiple different -std options in > a single testsuite run. As described in the updated docs, the -std >

[committed] libstdc++: Fix 29_atomics/headers/atomic/types_std_c++2a_neg.cc for C++23

2023-09-15 Thread Jonathan Wakely via Gcc-patches
Tested aarch64-linux. Pushed to trunk. -- >8 -- This test fails when run as C++23 because the PCH includes which declares ::memory_order, invalidating the test's assumptions. Disable PCH so that the test verifies that doesn't declare ::memory_order, as originally intended. Also fix the

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

2023-09-15 Thread Edwin Lu
On 9/11/2023 5:49 PM, Jeff Law via Gcc-patches wrote: On 9/11/23 16:52, Edwin Lu wrote: Updates autovec instruction that was added after last patch and turns on the assert statement to ensure all new instructions have a type. * config/riscv/autovec-opt.md: Update type *

[Bug tree-optimization/110992] [13/14 Regression] missed VRP optimization due to transformation of `a & -zero_one_valued_p` into `a * zero_one_valued_p`

2023-09-15 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110992 --- Comment #10 from Andrew Pinski --- This is what I came up with in the end: /* (a * b@[0,1]) == CST -> CST == 0 ? (a == CST | b == 0) : (a == CST & b != 0) (a * b@[0,1]) != CST -> CST != 0 ? (a != CST | b == 0) :

gcc-12-20230915 is now available

2023-09-15 Thread GCC Administrator via Gcc
Snapshot gcc-12-20230915 is now available on https://gcc.gnu.org/pub/gcc/snapshots/12-20230915/ and on various mirrors, see http://gcc.gnu.org/mirrors.html for details. This snapshot has been generated from the GCC 12 git branch with the following options: git://gcc.gnu.org/git/gcc.git branch

[Bug analyzer/111312] Should the analyzer run earlier?

2023-09-15 Thread dmalcolm at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111312 --- Comment #3 from David Malcolm --- Another example can be seen here: https://gcc.gnu.org/pipermail/gcc-patches/2023-August/628759.html in: gcc/testsuite/c-c++-common/analyzer/overlapping-buffers.c where -Wanalyzer-overlapping-buffers

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

2023-09-15 Thread Jonathan Wakely via Gcc-patches
This is v2 of patch 6/13, because I missed three files in the first patch. Tested aarch64-linux. I intend to push this (and the rest of the series) soon. -- >8 -- The testsuite will automatically select C++20 for these tests now, and removing the hardcoded -std option allows them to be tested

Re: [PATCH] libstdc++: Reduce integer std::to/from_chars symbol sizes

2023-09-15 Thread Jonathan Wakely via Gcc-patches
On Wed, 13 Sept 2023 at 23:52, Patrick Palka via Libstdc++ wrote: > > Tested on x86_64-pc-linux-gnu, does this look OK for trunk? OK, thanks. > > -- >8 -- > > For std::to_chars: > > The constrained alias __integer_to_chars_result_type seems unnecessary > ever since r10-3080-g28f0075742ed58 got

[Committed] [RISC-V] fix PR 111259 invalid zcmp mov predicate.

2023-09-15 Thread Patrick O'Neill
Committed - Thanks! Patrick On 9/15/23 13:06, Palmer Dabbelt wrote: On Fri, 15 Sep 2023 09:37:48 PDT (-0700), Patrick O'Neill wrote: On 9/15/23 01:49, Kito Cheng via Gcc-patches wrote: I guess another solution is using reg_or_subregno instead of REGNO, but that should not catch more cases,

[Bug target/111259] [14 Regression] ICE: RTL check: expected code 'reg', have 'subreg' in rhs_regno, at rtl.h:1934 during riscv64 build

2023-09-15 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111259 --- Comment #1 from CVS Commits --- The master branch has been updated by Patrick O'Neill : https://gcc.gnu.org/g:d7b6020276a843e97f6135259b4ab3b53a5850e2 commit r14-4044-gd7b6020276a843e97f6135259b4ab3b53a5850e2 Author: Fei Gao Date: Fri

[Bug tree-optimization/57755] Improve fold_binary_op_with_conditional_arg

2023-09-15 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57755 --- Comment #6 from Andrew Pinski --- (In reply to Andrew Pinski from comment #4) > I think we should optimize this testcases slightly different from > "improving" fold_binary_op_with_conditional_arg (I think >

[PATCH v6] c++: Move consteval folding to cp_fold_r

2023-09-15 Thread Marek Polacek via Gcc-patches
On Fri, Sep 15, 2023 at 02:08:46PM -0400, Jason Merrill wrote: > On 9/13/23 20:02, Marek Polacek wrote: > > On Wed, Sep 13, 2023 at 05:57:47PM -0400, Jason Merrill wrote: > > > On 9/13/23 16:56, Marek Polacek wrote: > > > > On Tue, Sep 12, 2023 at 05:26:25PM -0400, Jason Merrill wrote: > > > > >

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

2023-09-15 Thread patrick at rivosinc dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111428 Bug ID: 111428 Summary: RISC-V vector: Flaky segfault in {min|max}val_char_{1|2}.f90 Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal

[Bug other/111427] New: [14 regression] gfortran.dg/vect/pr60510.f fails after r14-3999-g3c834d85f2ec42

2023-09-15 Thread seurer at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111427 Bug ID: 111427 Summary: [14 regression] gfortran.dg/vect/pr60510.f fails after r14-3999-g3c834d85f2ec42 Product: gcc Version: 14.0 Status: UNCONFIRMED

Re: [PATCH] [RISC-V] fix PR 111259 invalid zcmp mov predicate.

2023-09-15 Thread Palmer Dabbelt
On Fri, 15 Sep 2023 09:37:48 PDT (-0700), Patrick O'Neill wrote: On 9/15/23 01:49, Kito Cheng via Gcc-patches wrote: I guess another solution is using reg_or_subregno instead of REGNO, but that should not catch more cases, and just more run-time check, so this version is LGTM. I tested an

[Bug tree-optimization/110131] [12/13/14 Regression] Missed Dead Code Elimination when using __builtin_unreachable since r12-6924-gc2b610e7c6c

2023-09-15 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110131 --- Comment #10 from Andrew Pinski --- (In reply to Andrew Pinski from comment #8) > With https://gcc.gnu.org/pipermail/gcc-patches/2023-September/629128.html we > get: > _34 = (int) _13; > _30 = (unsigned int) _13; > _22 = _30 ==

[Bug other/111406] libiberty build produces errors with CC=clang, unsupported option '-print-multi-os-directory'

2023-09-15 Thread dilfridge at gentoo dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111406 --- Comment #4 from Andreas K. Huettel --- (In reply to Richard Biener from comment #3) > > So I think this isn't an issue unless you try to build libiberty stand-alone > or as part of binutils and also install it? > We have a binutils-libs

[Bug fortran/93485] ICE in gfc_trans_array_ctor_element, at fortran/trans-array.c:1682

2023-09-15 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93485 anlauf at gcc dot gnu.org changed: What|Removed |Added Resolution|--- |FIXED Known to work|

[Bug driver/86030] specs file processing does not create response files for input directories

2023-09-15 Thread john.soo+gcc-bugzilla at arista dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86030 --- Comment #16 from John Soo --- It is actually somewhat likely that ARG_MAX will be hit when running on linux because it is hit when the stack can't contain enough pointers to contain argv and environ (see exec.c in the kernel

Re: [PATCH] Fortran: improve bounds-checking for array sections [PR30802]

2023-09-15 Thread Harald Anlauf via Gcc-patches
Hi Paul, On 9/15/23 11:13, Paul Richard Thomas via Gcc-patches wrote: Hi Harald, The statement, in array_bound_check_elemental is redundant since the call is determined by a more restrictive condition. + if (!(gfc_option.rtcheck & GFC_RTCHECK_BOUNDS)) +return; yeah, this was left over

[Bug fortran/37802] Improve wording for matmul bound checking

2023-09-15 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37802 Bug 37802 depends on bug 30802, which changed state. Bug 30802 Summary: out of bounds error array I/O not picked up with -fbounds-check https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30802 What|Removed |Added

[Bug fortran/27766] [meta-bug] -fbounds-check related bugs

2023-09-15 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=27766 Bug 27766 depends on bug 30802, which changed state. Bug 30802 Summary: out of bounds error array I/O not picked up with -fbounds-check https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30802 What|Removed |Added

[Bug fortran/30802] out of bounds error array I/O not picked up with -fbounds-check

2023-09-15 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30802 anlauf at gcc dot gnu.org changed: What|Removed |Added Resolution|--- |FIXED

Re: Question on -fwrapv and -fwrapv-pointer

2023-09-15 Thread Kees Cook via Gcc-patches
On Fri, Sep 15, 2023 at 05:47:08PM +, Qing Zhao wrote: > > > > On Sep 15, 2023, at 1:26 PM, Richard Biener > > wrote: > > > > > > > >> Am 15.09.2023 um 17:37 schrieb Qing Zhao : > >> > >>  > >> > On Sep 15, 2023, at 11:29 AM, Richard Biener > wrote: > > >

Re: Question on -fwrapv and -fwrapv-pointer

2023-09-15 Thread Kees Cook via Gcc-patches
On Fri, Sep 15, 2023 at 08:18:28AM -0700, Andrew Pinski wrote: > On Fri, Sep 15, 2023 at 8:12 AM Qing Zhao wrote: > > > > > > > > > On Sep 15, 2023, at 3:43 AM, Xi Ruoyao wrote: > > > > > > On Thu, 2023-09-14 at 21:41 +, Qing Zhao wrote: > > CLANG already provided

  1   2   3   >