Re: [WIP] Re-introduce 'TREE_USED' in tree streaming

2023-09-15 Thread Richard Biener via Gcc-patches
On Fri, Sep 15, 2023 at 3:05 PM Richard Biener wrote: > > On Fri, Sep 15, 2023 at 3:01 PM Thomas Schwinge > wrote: > > > > Hi! > > > > On 2023-09-15T12:11:44+0200, Richard Biener via Gcc-patches > > wrote: > > > On Fri, Sep 15, 2023 at 11:20 AM Thomas Schwinge > > > wrote: > > >> Now, that

[PATCH] c++: visibility wrt template and ptrmem targs [PR70413]

2023-09-15 Thread Patrick Palka via Gcc-patches
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- When constraining the visibility of an instantiation, we weren't properly considering the visibility of PTRMEM_CST and TEMPLATE_DECL template arguments. PR c++/70413 gcc/cp/ChangeLog: *

RE: [PATCH] test: Block SLP check of slp-34.c for vect_strided5

2023-09-15 Thread Li, Pan2 via Gcc-patches
Committed, thanks Richard. Pan -Original Message- From: Gcc-patches On Behalf Of Richard Biener via Gcc-patches Sent: Friday, September 15, 2023 6:07 PM To: Juzhe-Zhong Cc: gcc-patches@gcc.gnu.org; jeffreya...@gmail.com Subject: Re: [PATCH] test: Block SLP check of slp-34.c for

RE: [PATCH] test: Block SLP check of slp-35.c for vect_strided5

2023-09-15 Thread Li, Pan2 via Gcc-patches
Committed, thanks Richard. Pan -Original Message- From: Gcc-patches On Behalf Of Richard Biener via Gcc-patches Sent: Friday, September 15, 2023 6:07 PM To: Juzhe-Zhong Cc: gcc-patches@gcc.gnu.org; jeffreya...@gmail.com Subject: Re: [PATCH] test: Block SLP check of slp-35.c for

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

2023-09-15 Thread Pan Li via Gcc-patches
From: Pan Li This patch would like to allow the VLS mode autovec for the floating-point binary operation SGNJX. Give sample code as below: void test (float * restrict out, float * restrict in1, float * restrict in2) { for (int i = 0; i < 128; i++) out[i] = in1[i] * copysignf (1.0,

[COMMITTED] ada: Do not perform local-exception-to-goto optimization on barrier functions

2023-09-15 Thread Marc Poulhiès via Gcc-patches
From: Patrick Bernardi The local-exception-to-goto optimization is no longer applied to entry barrier functions as entry barriers cannot contain exception handlers and this optimization interferes with another optimization that occurs for simple barrier functions. In particular, the simple

[COMMITTED] ada: Fix internal error on expression function with Refined_Post aspect

2023-09-15 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This occurs when the expression function calls a protected function and the -gnata switch is specified, because the compiler wrongly freezes the called function when analyzing the expression function, a fallout of the wrapping scheme used for the Post and Refined_Post

[COMMITTED] ada: Generate runtime restrictions list when the standard library is suppressed

2023-09-15 Thread Marc Poulhiès via Gcc-patches
From: Patrick Bernardi With the introduction of Jorvik support into the light-tasking runtime comes the requirement to detect voliations of runtime restrictions (for example Max_Entry_Queue_Length) where previously they could be hard coded in the runtime. This means we now need the binder to

Re: [PATCH] ira: Consider save/restore costs of callee-save registers [PR110071]

2023-09-15 Thread Vladimir Makarov via Gcc-patches
On 9/14/23 06:45, Surya Kumari Jangala wrote: ira: Consider save/restore costs of callee-save registers [PR110071] In improve_allocation() routine, IRA checks for each allocno if spilling any conflicting allocnos can improve the allocation of this allocno. This routine computes the cost

Re: Question on -fwrapv and -fwrapv-pointer

2023-09-15 Thread Qing Zhao via Gcc-patches
> On Sep 15, 2023, at 8:41 AM, Arsen Arsenović wrote: > > > Qing Zhao writes: > >> Even though unsigned integer overflow is well defined, it might be >> unintentional, shall we warn user about this? > > This would be better addressed by providing operators or functions that > do overflow

Re: Question on -fwrapv and -fwrapv-pointer

2023-09-15 Thread Qing Zhao via Gcc-patches
> On Sep 15, 2023, at 11:29 AM, Richard Biener > wrote: > > > >> Am 15.09.2023 um 17:25 schrieb Qing Zhao : >> >>  >> >>> On Sep 15, 2023, at 8:41 AM, Arsen Arsenović wrote: >>> >>> >>> Qing Zhao writes: >>> Even though unsigned integer overflow is well defined, it might be

RE: [PATCH] test: Block vect_strided5 for slp-34-big-array.c SLP check

2023-09-15 Thread Li, Pan2 via Gcc-patches
Committed, thanks Richard. Pan -Original Message- From: Gcc-patches On Behalf Of Richard Biener via Gcc-patches Sent: Friday, September 15, 2023 6:07 PM To: Juzhe-Zhong Cc: gcc-patches@gcc.gnu.org; jeffreya...@gmail.com Subject: Re: [PATCH] test: Block vect_strided5 for

[COMMITTED 1/2] Fix indentation in range_of_phi.

2023-09-15 Thread Andrew MacLeod via Gcc-patches
Somewhere along the way a large sequence of code in range_of_phi() ended up with the same indentation of the preceeding loop.. this simply fixes it. committed as obvious. Andrew From e35c3b5335879afb616c6ead0f41bf6c275ee941 Mon Sep 17 00:00:00 2001 From: Andrew MacLeod Date: Wed, 13 Sep 2023

Re: RFC: Introduce -fhardened to enable security-related flags

2023-09-15 Thread Marek Polacek via Gcc-patches
On Wed, Aug 30, 2023 at 03:08:46PM +0200, Richard Biener wrote: > On Wed, Aug 30, 2023 at 12:51 PM Jakub Jelinek via Gcc-patches > wrote: > > > > On Tue, Aug 29, 2023 at 03:42:27PM -0400, Marek Polacek via Gcc-patches > > wrote: > > > + if (UNLIKELY (flag_hardened) > > > + &&

Re: [WIP] Re-introduce 'TREE_USED' in tree streaming

2023-09-15 Thread Richard Biener via Gcc-patches
On Fri, Sep 15, 2023 at 3:01 PM Thomas Schwinge wrote: > > Hi! > > On 2023-09-15T12:11:44+0200, Richard Biener via Gcc-patches > wrote: > > On Fri, Sep 15, 2023 at 11:20 AM Thomas Schwinge > > wrote: > >> Now, that was another quirky debug session: in > >>

Re: Question on -fwrapv and -fwrapv-pointer

2023-09-15 Thread Qing Zhao via Gcc-patches
> 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 -fsanitize=unsigned-integer-overflow. GCC might need to do the same. >>> >>> NO. There is no such thing as unsigned integer overflow. That option >>> is

Re: RFC: Introduce -fhardened to enable security-related flags

2023-09-15 Thread Marek Polacek via Gcc-patches
On Wed, Aug 30, 2023 at 05:06:57PM +0800, Xi Ruoyao via Gcc-patches wrote: > On Tue, 2023-08-29 at 15:42 -0400, Marek Polacek via Gcc-patches wrote: > > + if (UNLIKELY (flag_hardened) > > + && (opt->code == OPT_D || opt->code == OPT_U)) > > +   { > > + if

RE: [PATCH] test: Isolate slp-1.c check of target supports vect_strided5

2023-09-15 Thread Li, Pan2 via Gcc-patches
Committed, thanks Richard. Pan -Original Message- From: Gcc-patches On Behalf Of Richard Biener via Gcc-patches Sent: Friday, September 15, 2023 5:38 PM To: Juzhe-Zhong Cc: gcc-patches@gcc.gnu.org; jeffreya...@gmail.com; richard.sandif...@arm.com Subject: Re: [PATCH] test: Isolate

Re: Question on -fwrapv and -fwrapv-pointer

2023-09-15 Thread Arsen Arsenović via Gcc-patches
Qing Zhao writes: > Even though unsigned integer overflow is well defined, it might be > unintentional, shall we warn user about this? This would be better addressed by providing operators or functions that do overflow checking in the language, so that they can be explicitly used where

Re: [PATCH] tree optimization/111407--SSA corruption due to widening_mul opt

2023-09-15 Thread Qing Zhao via Gcc-patches
thanks. Committed as https://gcc.gnu.org/pipermail/gcc-cvs/2023-September/389614.html Qing > On Sep 15, 2023, at 2:12 AM, Richard Biener > wrote: > > On Thu, Sep 14, 2023 at 3:25 PM Qing Zhao via Gcc-patches > wrote: >> >> on conflict across an abnormal edge >> >> This is a bug in

[COMMITTED] ada: Fix internal error on misaligned component with variable nominal size

2023-09-15 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou The back-end cannot handle this kind of components even when they are small. gcc/ada/ * exp_util.adb (Component_May_Be_Bit_Aligned): Do not return false for a small component of a record type with a variant part. Tested on x86_64-pc-linux-gnu, committed on

[COMMITTED] ada: Remove GNAT Pro details regarding mold

2023-09-15 Thread Marc Poulhiès via Gcc-patches
From: Kévin Le Gouguec gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Remove extended discussion regarding mold run-time dependencies; packaging changes in GNAT Pro have made them obsolete. Tested on x86_64-pc-linux-gnu, committed on master. ---

[COMMITTED] ada: Fix wrong optimization of extended return for discriminated record type

2023-09-15 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This happens when the discriminants of the record type have default values. gcc/ada/ChangeLog: * inline.adb (Expand_Inlined_Call): In the case of a function call that returns an unconstrained type and initializes an object, set the No_Initialization

[PATCH] [RFC] New early __builtin_unreachable processing.

2023-09-15 Thread Andrew MacLeod via Gcc-patches
Ive been looking at __builtin_unreachable () regressions.  The fundamental problem seems to be  a lack of consistent expectation for when we remove it earlier than the final pass of VRP.    After looking through them, I think this provides a sensible approach. Ranger is pretty good at

Re: RFC: Introduce -fhardened to enable security-related flags

2023-09-15 Thread Marek Polacek via Gcc-patches
On Wed, Aug 30, 2023 at 12:50:40PM +0200, Jakub Jelinek wrote: > On Tue, Aug 29, 2023 at 03:42:27PM -0400, Marek Polacek via Gcc-patches wrote: > > + if (UNLIKELY (flag_hardened) > > + && (opt->code == OPT_D || opt->code == OPT_U)) > > + { > > + if (!fortify_seen_p) > > +

Re: [PATCH 2/2 v2] Ada: Finalization of constrained subtypes of unconstrained synchronized private extensions

2023-09-15 Thread Gary Dismukes via Gcc-patches
Richard, As a follow-on to my earlier message, additional testing has uncovered an issue with your patch. When run against a compiler built with assertions enabled, the test of "Present (Corresponding_Record_Type (Parent_Utyp))" can fail. An additional guard is needed prior to that test, as

[PATCH] RISC-V: Fix using wrong mode to get reduction insn vlmax

2023-09-15 Thread Lehua Ding
This patch fix using wrong mode when emit vlmax reduction insn. We should use src operand instead dest operand (which always LMUL=m1) to get the vlmax length. This patch alse remove dest_mode and mask_mode from insn_expander constructor, which can be geted by insn_flags. gcc/ChangeLog: *

Re: [WIP] Re-introduce 'TREE_USED' in tree streaming

2023-09-15 Thread Thomas Schwinge
Hi! On 2023-09-15T12:11:44+0200, Richard Biener via Gcc-patches wrote: > On Fri, Sep 15, 2023 at 11:20 AM Thomas Schwinge > wrote: >> Now, that was another quirky debug session: in >> 'gcc/omp-low.cc:create_omp_child_function' we clearly do set >> 'TREE_USED (t) = 1;' for '.omp_data_i', which

Re: [PATCH V4] RISC-V: Expand VLS mode to scalar mode move[PR111391]

2023-09-15 Thread Jeff Law via Gcc-patches
On 9/14/23 16:26, 钟居哲 wrote: I don't think it can fix the case when it is -march=rv64gc_zve32x juzhe.zh...@rivai.ai *From:* Kito Cheng *Date:* 2023-09-15 00:17 *To:*

Re: [PATCH V4] RISC-V: Expand VLS mode to scalar mode move[PR111391]

2023-09-15 Thread Robin Dapp via Gcc-patches
> You mean this patch is ok? I thought about it a bit more. From my point of view the patch is OK for now in order to get the bug out of the way. In the longer term I would really prefer a more "regular" solution (i.e. via hard_regno_mode_ok) and related. I can take care of that once I have a

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

2023-09-15 Thread Patrick O'Neill
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 equivalent patch (without the comment changes). This patch resolves

[PATCH][RFC] middle-end/106811 - document GENERIC/GIMPLE undefined behavior

2023-09-15 Thread Richard Biener via Gcc-patches
The following attempts to provide a set of conditions GENERIC/GIMPLE considers invoking undefined behavior, leaning on the C standards Annex J, as to provide portability guidance to language frontend developers. I've both tried to remember cases we exploit undefined behavior and went over C2x

[COMMITTED] ada: Explicitly analyze and expand null array aggregates

2023-09-15 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Null array aggregates have present but empty lists of expressions and component associations. This confuses the previous code for ordinary array aggregates, which assumes that if a list of either expressions or component associations is present, then it is non-empty. This

[COMMITTED] ada: Fix minor glitch in finish_record_type

2023-09-15 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou The size needs to be rounded up to the storage unit in all cases. gcc/ada/ * gcc-interface/utils.cc (finish_record_type): Round the size in the padding case as well. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/utils.cc |

Re: Question on -fwrapv and -fwrapv-pointer

2023-09-15 Thread Andrew Pinski via Gcc-patches
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 -fsanitize=unsigned-integer-overflow. GCC > might need to do the same. > >>> > >>> NO. There is

Re: Re: [PATCH V4] RISC-V: Expand VLS mode to scalar mode move[PR111391]

2023-09-15 Thread 钟居哲
You mean this patch is ok? juzhe.zh...@rivai.ai From: Jeff Law Date: 2023-09-15 23:27 To: 钟居哲; kito.cheng CC: gcc-patches; kito.cheng; rdapp.gcc Subject: Re: [PATCH V4] RISC-V: Expand VLS mode to scalar mode move[PR111391] On 9/14/23 16:26, 钟居哲 wrote: > I don't think it can fix the case

Re: Question on -fwrapv and -fwrapv-pointer

2023-09-15 Thread Xi Ruoyao via Gcc-patches
On Fri, 2023-09-15 at 15:37 +, Qing Zhao wrote: > > > > On Sep 15, 2023, at 11:29 AM, Richard Biener > > wrote: > > > > > > > > > Am 15.09.2023 um 17:25 schrieb Qing Zhao : > > > > > >  > > > > > > > On Sep 15, 2023, at 8:41 AM, Arsen Arsenović > > > > wrote: > > > > > > > > > > >

RE: [PATCH] test: Block slp-16.c check for target support vect_strided6

2023-09-15 Thread Li, Pan2 via Gcc-patches
Committed, thanks Richard. Pan -Original Message- From: Gcc-patches On Behalf Of Richard Biener via Gcc-patches Sent: Friday, September 15, 2023 5:38 PM To: Juzhe-Zhong Cc: gcc-patches@gcc.gnu.org; jeffreya...@gmail.com; richard.sandif...@arm.com Subject: Re: [PATCH] test: Block

Re: [PATCH] RISC-V: Fix using wrong mode to get reduction insn vlmax

2023-09-15 Thread Lehua Ding
Committed, thanks Juzhe. On 2023/9/15 19:18, juzhe.zhong wrote: lgtm Replied Message FromLehua Ding Date09/15/2023 19:13 To gcc-patches@gcc.gnu.org Cc juzhe.zh...@rivai.ai ,

Re: [PATCH] Checking undefined_p before using the vr

2023-09-15 Thread Andrew MacLeod via Gcc-patches
On 9/14/23 22:07, Jiufu Guo wrote: undefined is a perfectly acceptable range.  It can be used to represent either values which has not been initialized, or more frequently it identifies values that cannot occur due to conflicting/unreachable code.  VARYING means it can be any range, UNDEFINED

[COMMITTED 2/2] Always do PHI analysis before loop analysis.

2023-09-15 Thread Andrew MacLeod via Gcc-patches
The original invocation of phi_analysis was only invoked if there was no loop information available.  I have found situations where phi analysis enhances existing loop information, and as such this patch moves the phi analysis block to before loop analysis is invoked (in case a query is made

[PATCH] gcc: Introduce -fhardened

2023-09-15 Thread Marek Polacek via Gcc-patches
Bootstrapped/regtested on x86_64-pc-linux-gnu, powerpc64le-unknown-linux-gnu, and aarch64-unknown-linux-gnu; ok for trunk? -- >8 -- In I proposed -fhardened, a new umbrella option that enables a reasonable set of hardening flags.

Re: Question on -fwrapv and -fwrapv-pointer

2023-09-15 Thread Richard Biener via Gcc-patches
> Am 15.09.2023 um 17:25 schrieb Qing Zhao : > >  > >> On Sep 15, 2023, at 8:41 AM, Arsen Arsenović wrote: >> >> >> Qing Zhao writes: >> >>> Even though unsigned integer overflow is well defined, it might be >>> unintentional, shall we warn user about this? >> >> This would be better

Re: RFC: Introduce -fhardened to enable security-related flags

2023-09-15 Thread Marek Polacek via Gcc-patches
On Fri, Sep 01, 2023 at 10:09:28PM +, Qing Zhao via Gcc-patches wrote: > > > > On Aug 29, 2023, at 3:42 PM, Marek Polacek via Gcc-patches > > wrote: > > > > Improving the security of software has been a major trend in the recent > > years. Fortunately, GCC offers a wide variety of flags

Re: Machine Mode ICE in RISC-V when LTO

2023-09-15 Thread Robin Dapp via Gcc-patches
Hi Thomas, Jakub, is there anything we can do to assist from the riscv side in order to help with this? I haven't really been involved with it but was wondering what's missing. If I understand correctly Thomas has a major cleanup operation in plan but might not get to it soon. The fix he

[COMMITTED] ada: Clean up scope depth and related code (tech debt)

2023-09-15 Thread Marc Poulhiès via Gcc-patches
From: Bob Duff The main point of this patch is to remove the special case for Atree.F_Scope_Depth_Value in the Assert that Field_Present in Get_Field_Value. Pulling on that thread leads to lots of related cleanup. gcc/ada/ChangeLog: * atree.adb (Node_Kind_Table): Specify parameter

[COMMITTED] ada: Fix internal error on aggregate nested in container aggregate

2023-09-15 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This handles the case where a component association is present. gcc/ada/ * exp_aggr.adb (Convert_To_Assignments): In the case of a component association, call Is_Container_Aggregate on the parent's parent. (Expand_Array_Aggregate): Likewise.

[COMMITTED] ada: Crash on creation of extra formals on type extension

2023-09-15 Thread Marc Poulhiès via Gcc-patches
From: Javier Miranda Revert previous patch and fix the pending issue. gcc/ada/ * accessibility.ads (Needs_Result_Accessibility_Extra_Formal): Removed. * accessibility.adb (Needs_Result_Accessibility_Level_Param): Removed.

Re: [PATCH] MATCH: Improve zero_one_valued_p for cases without range information

2023-09-15 Thread Andrew Pinski via Gcc-patches
On Thu, Sep 14, 2023 at 11:28 PM Richard Biener via Gcc-patches wrote: > > On Fri, Sep 15, 2023 at 3:09 AM Andrew Pinski via Gcc-patches > wrote: > > > > I noticed we sometimes lose range information in forwprop due to a few > > match and simplify patterns optimizing away casts. So the easier

Re: RFC: Introduce -fhardened to enable security-related flags

2023-09-15 Thread Marek Polacek via Gcc-patches
On Wed, Aug 30, 2023 at 10:46:14AM +0200, Martin Uecker wrote: > > Improving the security of software has been a major trend in the recent > > years. Fortunately, GCC offers a wide variety of flags that enable extra > > hardening. These flags aren't enabled by default, though. And since > >

Re: RFC: Introduce -fhardened to enable security-related flags

2023-09-15 Thread Marek Polacek via Gcc-patches
On Mon, Sep 04, 2023 at 11:40:34PM +0100, Richard Sandiford wrote: > Qing Zhao via Gcc-patches writes: > >> On Aug 29, 2023, at 3:42 PM, Marek Polacek via Gcc-patches > >> wrote: > >> > >> Improving the security of software has been a major trend in the recent > >> years. Fortunately, GCC

[PATCH] c++: overeager type completion in convert_to_void [PR111419]

2023-09-15 Thread Patrick Palka via Gcc-patches
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- Here convert_to_void always completes the type of an INDIRECT_REF or VAR_DECL expression, but according to [expr.context] an lvalue-to-rvalue conversion is applied to a discarded-value expression only if

Re: [PATCH v5] c++: Move consteval folding to cp_fold_r

2023-09-15 Thread Jason Merrill via Gcc-patches
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: On 9/8/23 14:24, Marek Polacek wrote: + switch (TREE_CODE (stmt)) +{ +/*

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

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

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

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

[PATCH] c++: constness of decltype of NTTP object [PR98820]

2023-09-15 Thread Patrick Palka via Gcc-patches
bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk/13? -- >8 -- This corrects decltype of a (class) NTTP object as per [dcl.type.decltype]/1.2 and [temp.param]/6 in the type-dependent case. In the non-dependent case (nontype-class8.C) we resolve the decltype ahead of

Re: Question on -fwrapv and -fwrapv-pointer

2023-09-15 Thread Qing Zhao via Gcc-patches
> On Sep 15, 2023, at 12:53 PM, Xi Ruoyao wrote: > > On Fri, 2023-09-15 at 15:37 +, Qing Zhao wrote: >> >> >>> On Sep 15, 2023, at 11:29 AM, Richard Biener >>> wrote: >>> >>> >>> Am 15.09.2023 um 17:25 schrieb Qing Zhao :  > On Sep 15, 2023, at 8:41 AM,

[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

[pushed] analyzer: introduce pending_location

2023-09-15 Thread David Malcolm via Gcc-patches
No functional change intended. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r14-4041-g759a1a52ea615d. gcc/analyzer/ChangeLog: * analyzer.h (struct pending_location): New forward decl. * diagnostic-manager.cc

[pushed] analyzer: support diagnostics that don't have a stmt

2023-09-15 Thread David Malcolm via Gcc-patches
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r14-4042-gb09193fb0686b7. gcc/analyzer/ChangeLog: * analyzer.cc (get_stmt_location): Handle null stmt. * diagnostic-manager.cc (saved_diagnostic::saved_diagnostic): Copy m_loc from ploc.

[pushed] analyzer: handle volatile ops

2023-09-15 Thread David Malcolm via Gcc-patches
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r14-4040-g6319b5b2d46690. gcc/analyzer/ChangeLog: * region-model.cc (region_model::get_gassign_result): Handle volatile ops by using a conjured_svalue. gcc/testsuite/ChangeLog: *

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

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

Re: Question on -fwrapv and -fwrapv-pointer

2023-09-15 Thread Richard Biener via Gcc-patches
> Am 15.09.2023 um 17:37 schrieb Qing Zhao : > >  > >>> On Sep 15, 2023, at 11:29 AM, Richard Biener >>> wrote: >>> >>> >>> Am 15.09.2023 um 17:25 schrieb Qing Zhao : >>> >>>  >>> On Sep 15, 2023, at 8:41 AM, Arsen Arsenović wrote: Qing Zhao writes:

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

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

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

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

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

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

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

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

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

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

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

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 *

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 >

  1   2   >