Re: [PATCH v3 1/4] ifcvt: handle sequences that clobber flags in noce_convert_multiple_sets

2023-10-20 Thread Robin Dapp
> Sorry for the slow review. TBH I was hoping someone else would pick > it up, since (a) I'm not very familiar with this code, and (b) I don't > really agree with the way that the current code works. I'm not sure the > current dependency checking is safe, so I'm nervous about adding even > more c

[PATCH] LoongArch: Define macro CLEAR_INSN_CACHE.

2023-10-20 Thread Lulu Cheng
LoongArch's microstructure ensures cache consistency by hardware. Due to out-of-order execution, ibar is required to ensure the visibility of the store (invalidated icache) executed by this CPU before ibar (to the instance). ibar will not invalidate the icache, so the start and end parameters are n

[PATCH-1v4, expand] Enable vector mode for compare_by_pieces [PR111449]

2023-10-20 Thread HAO CHEN GUI
Hi, Vector mode instructions are efficient for compare on some targets. This patch enables vector mode for compare_by_pieces. Two help functions are added to check if vector mode is available for certain by pieces operations and if if optabs exists for the mode and certain by pieces operations. O

[PATCH] Fixup vect_get_and_check_slp_defs for gathers and .MASK_LOAD

2023-10-20 Thread Richard Biener
I went a little bit too simple with implementing SLP gather support for emulated and builtin based gathers. The following fixes the conflict that appears when running into .MASK_LOAD where we rely on vect_get_operand_map and the bolted-on STMT_VINFO_GATHER_SCATTER_P checking wrecks that. The foll

Re: [PATCH] Fixup vect_get_and_check_slp_defs for gathers and .MASK_LOAD

2023-10-20 Thread Lehua Ding
Hi Richard, I recompile the testcase with the fixup patch and still get the same ICE. On 2023/10/20 15:37, Richard Biener wrote: I went a little bit too simple with implementing SLP gather support for emulated and builtin based gathers. The following fixes the conflict that appears when runnin

Re: [PATCH] [x86] Remove unused mmx_pinsrw.

2023-10-20 Thread Uros Bizjak
On Fri, Oct 20, 2023 at 8:54 AM liuhongt wrote: > > When I'm working on enable more 32/64-bit vectorization for _Float16, > I notice there's 1 redundant define_expand, the patch removed the expander. > > Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. > Ok for trunk? > > gcc/ChangeLog: >

[PATCH] RISC-V: Rename some variables of vector_block_info[NFC]

2023-10-20 Thread Juzhe-Zhong
1. Remove "m_" prefix as they are not private members. 2. Rename infos -> local_infos, info -> global_info to clarify their meaning. Pushed as it is obvious. gcc/ChangeLog: * config/riscv/riscv-vsetvl.cc (pre_vsetvl::fuse_local_vsetvl_info): Rename variables. (pre_vsetvl::pre_gl

Re: [PATCH] Fixup vect_get_and_check_slp_defs for gathers and .MASK_LOAD

2023-10-20 Thread Richard Biener
On Fri, 20 Oct 2023, Lehua Ding wrote: > Hi Richard, > > I recompile the testcase with the fixup patch and still get the same ICE. The following fixes it. >From 377e911b1b64298def75ba9d9c46fdd22fe4cf84 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Fri, 20 Oct 2023 10:25:31 +0200 Subject:

Re: [PATCH] RISC-V: Rename some variables of vector_block_info[NFC]

2023-10-20 Thread Kito Cheng
> 1. Remove "m_" prefix as they are not private members. Actually it's not only for private members[1], but I think it's not mandatory, anyway it's not objection, and I am OK with that, just share the doc [1] "When structs and/or classes have member functions, prefer to name data members with a l

Re: [PATCH] Fixup vect_get_and_check_slp_defs for gathers and .MASK_LOAD

2023-10-20 Thread Lehua Ding
Hi Richard, On 2023/10/20 16:28, Richard Biener wrote: On Fri, 20 Oct 2023, Lehua Ding wrote: Hi Richard, I recompile the testcase with the fixup patch and still get the same ICE. The following fixes it. Using this patch did fix it, thank you very much. From 377e911b1b64298def75ba9d9c

RE: [PATCH v1] RISC-V: Remove the type size restriction of vectorizer

2023-10-20 Thread Li, Pan2
Hi Richard Biener, The CI of linaro-toolch...@lists.linaro.org reports some aarch64 regression of this change, I will double check about it soon. FAIL: 12 regressions regressions.sum: === gcc tests === Running gcc:gcc.target/aarch64/sve/aarch64-sve.exp ... FAIL: gcc.target/aarc

Re: [PATCH-1v4, expand] Enable vector mode for compare_by_pieces [PR111449]

2023-10-20 Thread Richard Sandiford
HAO CHEN GUI writes: > Hi, > Vector mode instructions are efficient for compare on some targets. > This patch enables vector mode for compare_by_pieces. Two help > functions are added to check if vector mode is available for certain > by pieces operations and if if optabs exists for the mode and

Re: RE: [PATCH v1] RISC-V: Remove the type size restriction of vectorizer

2023-10-20 Thread juzhe.zh...@rivai.ai
 /* We only enable VLS modes for VLA vectorization since fixed length VLMAX mode -   is the highest priority choice and should not conflict with VLS modes.  */ -#define TARGET_VECTOR_VLS                                                       \ -  (TARGET_VECTOR && riscv_autovec_preference == RVV_SCA

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

2023-10-20 Thread Florian Weimer
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/ * gcc.dg/Wincompatible-pointer-types-4.c: New. *

Re: [PATCH] Fixup vect_get_and_check_slp_defs for gathers and .MASK_LOAD

2023-10-20 Thread Richard Biener
On Fri, 20 Oct 2023, Richard Biener wrote: > I went a little bit too simple with implementing SLP gather support > for emulated and builtin based gathers. The following fixes the > conflict that appears when running into .MASK_LOAD where we rely > on vect_get_operand_map and the bolted-on STMT_VI

Re: [PATCH v3 1/4] ifcvt: handle sequences that clobber flags in noce_convert_multiple_sets

2023-10-20 Thread Richard Sandiford
Thanks for the context. Robin Dapp writes: >> Sorry for the slow review. TBH I was hoping someone else would pick >> it up, since (a) I'm not very familiar with this code, and (b) I don't >> really agree with the way that the current code works. I'm not sure the >> current dependency checking i

[PATCH] Rewrite more refs for epilogue vectorization

2023-10-20 Thread Richard Biener
The following makes sure to rewrite all gather/scatter detected by dataref analysis plus stmts classified as VMAT_GATHER_SCATTER. Maybe we need to rewrite all refs, the following covers the cases I've run into now. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. * tree-vect-

[PATCH] rtl-ssa: Don't leave NOTE_INSN_DELETED around

2023-10-20 Thread Alex Coplan
Hi, This patch tweaks change_insns to also call ::remove_insn to ensure the underlying RTL insn gets removed from the insn chain in the case of a deletion. This avoids leaving NOTE_INSN_DELETED around after deleting insns. For movement, the RTL insn chain is updated earlier in change_insns with

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

2023-10-20 Thread Martin Uecker
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: > > > > 1. No specification for signed or unsigned for counted_by field.

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

2023-10-20 Thread Christoph Muellner
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 available on the market for quite some time. The ISA spe

[PATCH v2 2/2] riscv: thead: Add support for the XTheadFMemIdx ISA extension

2023-10-20 Thread Christoph Muellner
From: Christoph Müllner The XTheadFMemIdx ISA extension provides additional load and store instructions for floating-point registers with new addressing modes. The following memory accesses types are supported: * load/store: [w,d] (single-precision FP, double-precision FP) The following address

[PATCH v2 1/2] riscv: thead: Add support for the XTheadMemIdx ISA extension

2023-10-20 Thread Christoph Muellner
From: Christoph Müllner The XTheadMemIdx ISA extension provides a additional load and store instructions with new addressing modes. The following memory accesses types are supported: * load: b,bu,h,hu,w,wu,d * store: b,h,w,d The following addressing modes are supported: * immediate offset with

[PATCH] Document {L,R}ROTATE_EXPR

2023-10-20 Thread Richard Biener
The following amends the {L,R}SHIFT_EXPR documentation with documentation about the {L,R}ROTATE_EXPR case. Build on x86_64-unknown-linux-gnu, pushed. * doc/generic.texi ({L,R}ROTATE_EXPR): Document. --- gcc/doc/generic.texi | 18 +++--- 1 file changed, 11 insertions(+), 7 del

Re: [PATCH] rtl-ssa: Don't leave NOTE_INSN_DELETED around

2023-10-20 Thread Richard Sandiford
Alex Coplan writes: > Hi, > > This patch tweaks change_insns to also call ::remove_insn to ensure the > underlying RTL insn gets removed from the insn chain in the case of a > deletion. > > This avoids leaving NOTE_INSN_DELETED around after deleting insns. > > For movement, the RTL insn chain is u

[SH][committed] Fix PR 101177

2023-10-20 Thread Oleg Endo
The attached patch fixes PR 101177. Committed to master, cherry-picked to GCC-13, GCC-12 and GCC-11. Sanity tested with 'make all-gcc'. Cheers, Oleg gcc/ChangeLog: PR target/101177 * config/sh/sh.md (unnamed split pattern): Fix comparison of find_regno_note result. From

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

2023-10-20 Thread Tamar Christina
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 whether loop_vinfo is NULL or not. Apparently this code expect

Re: [PATCH v3] Control flow redundancy hardening

2023-10-20 Thread Alexandre Oliva
Thanks. On Oct 20, 2023, Richard Biener wrote: >> for gcc/ada/ChangeLog >> >> * gcc-interface/trans.cc (gigi): Mark __gnat_reraise_zcx with >> ECF_XTHROW. >> (build_raise_check): Likewise for all rcheck subprograms. >> * gcc-interface/utils.cc (handle_expected_throw_attribute): >> New. >> (gna

[PATCH] tree-optimization/111000 - restrict invariant motion of shifts

2023-10-20 Thread Richard Biener
The following restricts moving variable shifts to when they are always executed in the loop as we currently do not have an efficient way to rewrite them to something that is unconditionally well-defined and value range analysis will otherwise compute invalid ranges for the shift operand. Bootstrap

[committed] amdgcn: add -march=gfx1030 EXPERIMENTAL

2023-10-20 Thread Andrew Stubbs
I've committed this patch that allows building binaries for AMD gfx1030 GPUs. I can't actually test it, however, so somebody else will have to debug it (or wait for me to get my hands on a device). Richi reports that it does not execute correctly, as is. This is an experimental broken feature,

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

2023-10-20 Thread Richard Sandiford
Andrew Pinski writes: > After r14-3110-g7fb65f10285, the canonical form for > `a ? ~b : b` changed to be `-(a) ^ b` that means > for aarch64 we need to add a few new insn patterns > to be able to catch this and change it to be > what is the canonical form for the aarch64 backend. > A secondary pat

[PATCH] tree-optimization/111891 - fix assert in vectorizable_simd_clone_call

2023-10-20 Thread Richard Biener
The following fixes the assert in vectorizable_simd_clone_call to assert we have a vector type during transform. Whether we have one during analysis depends on whether another SLP user decided on the type of a constant/external already. When we end up with a mismatch in desire the updating will f

Re: [PATCH] wwwdocs: gcc-14: mark amdgcn fiji deprecated

2023-10-20 Thread Andrew Stubbs
On 19/10/2023 11:07, Tobias Burnus wrote: On 19.10.23 11:49, Andrew Stubbs wrote: OK to commit? (I think as maintainer you don't need approval - but of course comments by others can be helpful; I hope mine are. Additionally, Gerald (CCed) helps with keeping the webpages in good shape (thanks!)

Re: [PATCH] AArch64: Improve immediate generation

2023-10-20 Thread Richard Earnshaw
On 19/10/2023 13:43, Wilco Dijkstra wrote: Further improve immediate generation by adding support for 2-instruction MOV/EOR bitmask immediates. This reduces the number of 3/4-instruction immediates in SPECCPU2017 by ~2%. Passes regress, OK for commit? gcc/ChangeLog: * config/aarch64

Re: [PATCH] wwwdocs: gcc-14: mark amdgcn fiji deprecated

2023-10-20 Thread Tobias Burnus
On 20.10.23 14:58, Andrew Stubbs wrote: Fair enough, how's this version? (I like the comma, even if it is optional.) LGTM – for what it is worth. Thanks! Tobias - Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschrän

[PATCH] tree-optimization/110243 - IVOPTs introducing undefined overflow

2023-10-20 Thread Richard Biener
The following addresses IVOPTs rewriting expressions in its strip_offset without caring for definedness of overflow. Rather than the earlier attempt of just using the proper split_constant_offset from data-ref analysis the following adjusts IVOPTs helper trying to minimize changes from this fix, p

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

[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]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] 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] 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 >

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 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

[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] 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] 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

[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 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 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 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] 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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

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

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

[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 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

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

[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

[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

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

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

[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 -

[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 |

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

[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

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)));

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

[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

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

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: 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

  1   2   >