Re: [PATCH V12] VECT: Fix issue of multiple-rgroup for length is counting elements

2023-05-22 Thread juzhe.zh...@rivai.ai
Hi, Richard and Richi. This patch bootstrap PASS on X86 and regression no surprise change. Ok for trunk ? Thanks. juzhe.zh...@rivai.ai From: juzhe.zhong Date: 2023-05-22 10:08 To: gcc-patches CC: richard.sandiford; rguenther; pan2.li; Ju-Zhe Zhong Subject: [PATCH V12] VECT: Fix issue of multip

[PATCH 2/2] xtensa: Merge '*addx' and '*subx' insn patterns into one

2023-05-22 Thread Takayuki 'January June' Suwa via Gcc-patches
By making use of the 'addsub_operator' added in the last patch. gcc/ChangeLog: * config/xtensa/xtensa.md (*addsubx): Rename from '*addx', and change to also accept '*subx' pattern. (*subx): Remove. --- gcc/config/xtensa/xtensa.md | 31 +-- 1 fi

[PATCH 1/2] xtensa: Optimize '(x & CST1_POW2) != 0 ? CST2_POW2 : 0'

2023-05-22 Thread Takayuki 'January June' Suwa via Gcc-patches
This patch decreses one machine instruction from "single bit extraction with shifting" operation, and tries to eliminate the conditional branch if CST2_POW2 doesn't fit into signed 12 bits with the help of ifcvt optimization. /* example #1 */ int test0(int x) { return (x & 1048576) !

[PATCH] RISC-V: Reorganize the code of CONST_VECTOR handling in riscv.cc

2023-05-22 Thread juzhe . zhong
From: Juzhe-Zhong Since satisfies_constraint_vi (x) belongs to RVV region. We make this condition inside riscv_v_ext_vector_mode_p to make codes more reasonable. gcc/ChangeLog: * config/riscv/riscv.cc (riscv_const_insns): Reorganize the codes. --- gcc/config/riscv/riscv.cc | 12 ++

[PATCH] Fold _mm{, 256, 512}_abs_{epi8, epi16, epi32, epi64} into gimple ABS_EXPR.

2023-05-22 Thread liuhongt via Gcc-patches
Also for 64-bit vector abs intrinsics _mm_abs_{pi8,pi16,pi32}. Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. Ok for trunk? gcc/ChangeLog: PR target/109900 * config/i386/i386.cc (ix86_gimple_fold_builtin): Fold _mm{,256,512}_abs_{epi8,epi16,epi32,epi64} and

Re: [PATCH] RISC-V: Reorganize the code of CONST_VECTOR handling in riscv.cc

2023-05-22 Thread Kito Cheng via Gcc-patches
LGTM On Mon, May 22, 2023 at 3:20 PM wrote: > > From: Juzhe-Zhong > > Since satisfies_constraint_vi (x) belongs to RVV region. > We make this condition inside riscv_v_ext_vector_mode_p to make codes > more reasonable. > > gcc/ChangeLog: > > * config/riscv/riscv.cc (riscv_const_insns): Re

Re: [PATCH V12] VECT: Fix issue of multiple-rgroup for length is counting elements

2023-05-22 Thread Richard Sandiford via Gcc-patches
juzhe.zh...@rivai.ai writes: > From: Ju-Zhe Zhong > > Address comments from Richard that splits the patch of fixing multiple-rgroup > handling of length counting elements. > > This patch is fixing issue of handling multiple-rgroup of length is counting > elements > > Before this patch, multiple r

Re: [PATCH] RISC-V: Add RVV comparison autovectorization

2023-05-22 Thread Robin Dapp via Gcc-patches
Hi Juzhe, thanks. Some remarks inline. > +;; Integer (signed) vcond. Don't enforce an immediate range here, since it > +;; depends on the comparison; leave it to riscv_vector::expand_vcond instead. > +(define_expand "vcond" > + [(set (match_operand:V 0 "register_operand") > + (if_then_else

Re: [PATCH V2] Provide -fcf-protection=branch,return.

2023-05-22 Thread Hongtao Liu via Gcc-patches
ping. On Sat, May 13, 2023 at 5:20 PM liuhongt wrote: > > > I think this could be simplified if you use either EnumSet or > > EnumBitSet instead in common.opt for `-fcf-protection=`. > > Use EnumSet instead of EnumBitSet since CF_FULL is not power of 2. > It is a bit tricky for sets classificatio

[PATCH] Fix handling of non-integral bit-fields in native_encode_initializer

2023-05-22 Thread Eric Botcazou via Gcc-patches
Hi, the encoder for CONSTRUCTORs assumes that all bit-fields (DECL_BIT_FIELD) have integral types, but that's not the case in Ada where they may have pretty much any type, resulting in a wrong encoding for them. The attached fix filters out non-integral bit-fields, except if they start and end on

[wwwdocs, committed] git.html: Move OG12 to OG13, briefly mention old branches

2023-05-22 Thread Tobias Burnus
Committed as 6196747803d192744097590d6703a94def0030f4 → https://gcc.gnu.org/git.html Tobias - Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der G

[PATCH V13] VECT: Fix bug of multiple-rgroup for length is counting elements

2023-05-22 Thread juzhe . zhong
From: Ju-Zhe Zhong Address comments from Richard that splits the patch of fixing multiple-rgroup handling of length counting elements. This patch is fixing issue of handling multiple-rgroup of length is counting elements Before this patch, multiple rgroup run fail: FAIL: gcc.target/riscv/rvv/a

Re: Re: [PATCH V12] VECT: Fix issue of multiple-rgroup for length is counting elements

2023-05-22 Thread juzhe.zh...@rivai.ai
Thanks. Richard. https://gcc.gnu.org/pipermail/gcc-patches/2023-May/619111.html Would you mind take a look again this patch? I just copy your codes from your comments and test them. They all passed. Ok for trunk. >> The patch is OK for trunk with those changes, thanks. Once it's pushed, >> could

Re: [PATCH V13] VECT: Fix bug of multiple-rgroup for length is counting elements

2023-05-22 Thread Richard Sandiford via Gcc-patches
juzhe.zh...@rivai.ai writes: > From: Ju-Zhe Zhong > > Address comments from Richard that splits the patch of fixing multiple-rgroup > handling of length counting elements. > > This patch is fixing issue of handling multiple-rgroup of length is counting > elements > > Before this patch, multiple r

RE: [PATCH V13] VECT: Fix bug of multiple-rgroup for length is counting elements

2023-05-22 Thread Li, Pan2 via Gcc-patches
Committed, thanks Richard. Pan -Original Message- From: Richard Sandiford Sent: Monday, May 22, 2023 4:21 PM To: juzhe.zh...@rivai.ai Cc: gcc-patches@gcc.gnu.org; rguent...@suse.de; Li, Pan2 Subject: Re: [PATCH V13] VECT: Fix bug of multiple-rgroup for length is counting elements juz

[PATCH V12] VECT: Add decrement IV iteration loop control by variable amount support

2023-05-22 Thread juzhe . zhong
From: Ju-Zhe Zhong gcc/ChangeLog: * tree-vect-loop-manip.cc (vect_adjust_loop_lens_control): New function. (vect_set_loop_controls_directly): Add decrement IV support. (vect_set_loop_condition_partial_vectors): Ditto. * tree-vect-loop.cc: Ditto. * tree-vec

Re: Re: [PATCH V12] VECT: Fix issue of multiple-rgroup for length is counting elements

2023-05-22 Thread juzhe.zh...@rivai.ai
Hi, Richard. I have rebase to trunk and send the updated patch for "decrement IV support": https://gcc.gnu.org/pipermail/gcc-patches/2023-May/619115.html Thanks. juzhe.zh...@rivai.ai From: Richard Sandiford Date: 2023-05-22 16:00 To: juzhe.zhong CC: gcc-patches; rguenther; pan2.li Subject: Re

[COMMITTED] ada: prevent infinite recursion in Collect_Types_In_Hierarchy

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Bob Duff In (illegal) mutually-dependent type declarations, it is possible for Etype (Etype (Typ)) to point back to Typ. This patch stops the recursion in such cases. gcc/ada/ * sem_util.adb (Process_Type): Stop the recursion. * exp_aggr.adb (Build_Record_Aggr_Code): Add a

[COMMITTED] ada: update Ada_Version_Type in fe.h to match opt.ads

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Bob Duff Remove Ada_With_Extensions, which is not used on the C side. Do not add Ada_With_Core_Extensions and Ada_With_All_Extensions, which are also not used on the C side, and on the Ada side are always used via functions All_Extensions_Allowed and Core_Extensions_Allowed. Explain this in

[COMMITTED] ada: Update Controlling_Argument when copying trees

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek When copying the AST we need to update fields that carry semantic meaning and not just copy them. We already updated some of them, e.g. the First/Next_Named_Association chain, but failed to update the Controlling_Argument. This fix doesn't appear to change anything for the c

Re: [aarch64] Code-gen for vector initialization involving constants

2023-05-22 Thread Richard Sandiford via Gcc-patches
Prathamesh Kulkarni writes: > Hi Richard, > Thanks for the suggestions. Does the attached patch look OK ? > Boostrap+test in progress on aarch64-linux-gnu. Like I say, please wait for the tests to complete before sending an RFA. It saves a review cycle if the tests don't in fact pass. > diff --g

[COMMITTED] ada: Restrict expression pretty-printer to subexpressions

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek When pretty-printing expressions with a CASE alternatives we can qualify the call to Nkind using N_Subexpr, so that we will get compile-time errors when new node kinds are added (e.g. Ada 2022 case expressions). gcc/ada/ * pprint.adb (Expr_Name): Qualify CASE expres

[COMMITTED] ada: Don't pretty-print DEL within expression images

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek When printing expression images, e.g. for GNATprove counterexamples, it seems better to print DEL not directly but with its numeric code. gcc/ada/ * pprint.adb (Expr_Name): Exclude DEL from printable range. Tested on x86_64-pc-linux-gnu, committed on master. ---

[COMMITTED] ada: Fix handling of constrained array declarations in declare-expression

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou They need to go through Constrain_Array or else they do not really work. gcc/ada/ * sem_ch3.adb (Find_Type_Of_Object): In a spec expression, also set the Scope of the type, and call Constrain_Array for array subtypes. Tested on x86_64-pc-linux-gnu, committed

[COMMITTED] ada: Better error message if non-Ada2022 code declares No_Return function

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Steve Baird When a feature that is legal in Ada2022 but not in earlier Ada versions is used, we typically want to call Error_Msg_Ada_2022_Feature in order to generate an informative message in the error case. Specifying No_Return for a function (as opposed to a procedure) is no exception to

[COMMITTED] ada: Add contracts to Ada.Strings.Unbounded library

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Joffrey Huguet This patch adds contracts to the conversions between Unbounded_String and String, the Element function and the equality between two Unbounded_String, or between Unbounded_String and String. This patch also disallows the use of a function in SPARK, because it returns an uninit

[COMMITTED] ada: Fix traversal for the rightmost node of a pretty-printed expression

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek When getting the rightmost node of a pretty-printed expression we incorrectly traversed some composite nodes, which caused the expression image to be chopped. gcc/ada/ * pprint.adb (Expression_Image): Reduce scope of local variables; inline local uncommented

[COMMITTED] ada: Reject illegal declarations in expression functions

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Steve Baird gcc/ada/ * sem_ch4.adb (Analyze_Expression_With_Actions.Check_Action_Ok): If Comes_From_Source (A) is False, then look at Original_Node (A) instead of A. In particular, if an (illegal) expression function is transformed into a "vanilla" function,

[COMMITTED] ada: Implement conversions from Big_Integer to large types

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This implements the conversion from Big_Integer to Long_Long_Unsigned on 32-bit platforms and to Long_Long_Long_{Integer,Unsigned} on 64-bit ones. gcc/ada/ * libgnat/s-genbig.ads (From_Bignum): New overloaded declarations. * libgnat/s-genbig.adb (LLLI): New s

[COMMITTED] ada: Fix double finalization in conditional exit statement

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou The temporary is first finalized through its enclosing block. gcc/ada/ * exp_ch4.adb (Expand_N_Expression_With_Actions.Process_Action): Do not look into nested blocks. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch4.adb | 7 +--

[COMMITTED] ada: Fix error and crash on imported function with precondition and 'Base

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This fixes a spurious error on an imported function with a precondition and a parameter declared with a 'Base formal type, and even a crash in the case where this function is declared in a generic package. gcc/ada/ * freeze.adb (Wrap_Imported_Subprogram): Use Copy_Su

[COMMITTED] ada: Remove outdated part of comment

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Ronan Desplanques The concept of extended nodes was retired with the introduction of variable-sized node types, but a reference to that concept was left over in a comment. This change removes that reference. gcc/ada/ * atree.ads: Remove outdated part of comment. Tested on x86_64-

[COMMITTED] ada: Remove a remaining reference to ?

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Arnaud Charlet We should no longer use ? anywhere when emitting warnings. gcc/ada/ * sem_aggr.adb (Get_Value): Use ?? instead of ?. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_aggr.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/g

[COMMITTED] ada: Fix crash on Ada.Containers with No_Dispatching_Calls restriction

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This makes it so that the compiler does not crash and flags the underlying violation of the restriction instead. gcc/ada/ * exp_ch3.adb (Freeze_Type): Do not associate the Finalize_Address routine for a class-wide type if restriction No_Dispatching_Calls

[COMMITTED] ada: Remove unreferenced utility routine Is_Actual_Tagged_Parameter

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Routine Is_Actual_Tagged_Parameter was added to detect unsupported SPARK 2005 constructs, but this feature was deconstructed in favor of SPARK 2014 and its SPARK_Mode aspects. gcc/ada/ * sem_util.ads (Is_Actual_Tagged_Parameter): Remove spec. * sem_util.adb

[COMMITTED] ada: Fix source location for crashes in expanded Loop_Entry attributes

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Historically, Loop_Entry attributes were expanded while expanding their corresponding loops, so it was easier to use location of these loops for expanded code. Now, these attributes are expanded where they appear, so we can easily use the location of the attribute reference f

[COMMITTED] ada: Remove extra parentheses

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Arnaud Charlet In preparation of enhancing -gnatyx to check for these automatically. gcc/ada/ * ali-util.adb, par-endh.adb, par-prag.adb, par-ch2.adb, checks.adb, fmap.adb, libgnat/a-nbnbig.ads, libgnat/g-dynhta.adb, libgnat/s-carun8.adb, libgnat/s-strcom.adb, libg

[COMMITTED] ada: Support calls through dereferences in Find_Actual

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Claire Dross Return the corresponding formal in the designated subprogram profile in that case. gcc/ada/ * sem_util.adb (Find_Actual): On calls through dereferences, return the corresponding formal in the designated subprogram profile. Tested on x86_64-pc-linux-gn

[COMMITTED] ada: Accept Assert pragmas in expression functions

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Steve Baird gcc/ada/ * sem_ch4.adb (Analyze_Expression_With_Actions.Check_Action_Ok): Accept an executable pragma occuring in a declare expression as per AI22-0045. This means Assert and Inspection_Point pragmas as well as any implementation-defined pragmas

[COMMITTED] ada: Improve -gnatyx style check

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Arnaud Charlet Check redundant parentheses in many more places, for now only under -gnatdQ, while pending violations are fixed. gcc/ada/ * par-ch3.adb, sem_ch4.adb (P_Discrete_Range, Analyze_Logical_Op, Analyze_Short_Circuit): Add calls to Check_Xtra_Parentheses. *

[COMMITTED] ada: Remove redundant protection against empty lists

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Calls to List_Length on No_List intentionally return 0 (and likewise call to First on No_List intentionally return Empty), so explicit guards against No_List are unnecessary. Code cleanup; semantics is unaffected. gcc/ada/ * exp_aggr.adb (Aggregate_Size): Remove red

[COMMITTED] ada: Fix spurious freezing error on nonabstract null extension

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This prevents the wrapper function created for each nonoverridden inherited function with a controlling result of nonabstract null extensions of tagged types from causing premature freezing of types referenced in its profile. gcc/ada/ * exp_ch3.adb (Make_Controlling_

[COMMITTED] ada: Fix spurious warning on Inline_Always and contracts

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Warnings about pre/postconditions being ignored with Inline_Always were only true for the obsolete frontend inlining. With the current backend pre/postconditions work fine with Inline_Always. gcc/ada/ * sem_prag.adb (Check_Postcondition_Use_In_Inlined_Subprogram): O

[COMMITTED] ada: Fix missing finalization in library-unit instance spec

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This fixes the missing finalization of objects declared in the spec of package instances that are library units (and only them, i.e. not all library-level package instances) when the instances have a package body. The finalization is done when there is no package body, and su

[COMMITTED] ada: Add warning on frontend inlining of Subprogram_Variant

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek We already warned when contracts like pre/postcondition appear together with pragma Inline_Always and they are ignored by the frontend inlining. For consistency we now also warn for Subprogram_Variant, which is similarly ignored even though this contract is only meaningful f

[COMMITTED] ada: Add Is_Past_Self_Hiding_Point flag

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Bob Duff This patch adds a flag Is_Past_Self_Hiding_Point. When False, this will replace E_Void as the indicator for a premature use of a declaration within itself -- for example, "X : T := X;". One might think this flag should be called something like Is_Hidden_From_All_Visibility, revers

Re: [PATCH] RISC-V: Implement autovec abs, vneg, vnot.

2023-05-22 Thread Robin Dapp via Gcc-patches
As discussed with Juzhe off-list, I will rebase this patch against Juzhe's vec_cmp/vcond patch once that hits the trunk. Regards Robin

[COMMITTED] ada: Add missing word in comment

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Ronan Desplanques gcc/ada/ * par-ch3.adb: Add missing word in comment. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/par-ch3.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/par-ch3.adb b/gcc/ada/par-ch3.adb index 7126afbfbeb..a71

[COMMITTED] ada: Cleanup redundant condition in resolution of entity names

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Code cleanup related to new contract for SPARK; semantics is unaffected. gcc/ada/ * sem_res.adb (Resolve_Entity_Name): Combine two IF statements that execute code only for references that come from source. Tested on x86_64-pc-linux-gnu, committed on master.

[COMMITTED] ada: Fix missing finalization in separate package body

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This directly comes from a loophole in the implementation. gcc/ada/ * exp_ch7.adb (Process_Package_Body): New procedure taken from... (Build_Finalizer.Process_Declarations): ...here. Call the above procedure to deal with both package bodies and packa

[COMMITTED] ada: Avoid repeated calls when looking for first/last slocs of a node

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek gcc/ada/ * errout.adb (First_Loc): Avoid repeated calls. (Last_Loc): Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/errout.adb | 34 ++ 1 file changed, 18 insertions(+), 16 deletions(-) diff --git

[COMMITTED] ada: Further fixes to GNATprove and CodePeer expression pretty-printer

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek The expression pretty-printer still crashes on several tests, but already gives much better outputs for many previously unsupported constructs. gcc/ada/ * pprint.adb (Expression_Image): Handle several previously unsupported constructs. Tested on x86_64-pc-l

[COMMITTED] ada: Use idiomatic construct in Expand_N_Package_Body

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou gcc/ada/ * exp_ch7.adb (Expand_N_Package_Body): Call Defining_Entity to get the entity of the body. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch7.adb | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/g

[COMMITTED] ada: Small cleanup in support for protected subprograms

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This moves the propagation of the Uses_Sec_Stack flag, from the original to the rewritten subprogram, to the point where the latter is expanded, along with the propagation of the Has_Nested_Subprogram flag, as well as addresses a ??? comment in the same block of code. No func

[COMMITTED] ada: Rename Is_Past_Self_Hiding_Point flag to be Is_Not_Self_Hidden

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Bob Duff ...which seems clearer. Still work in progress. gcc/ada/ * cstand.adb (Is_Past_Self_Hiding_Point): Rename to be Is_Not_Self_Hidden. * einfo.ads: Likewise. * exp_aggr.adb: Likewise. * gen_il-fields.ads: Likewise. * gen_il-gen-gen_en

Re: Re: [PATCH] RISC-V: Add RVV comparison autovectorization

2023-05-22 Thread juzhe.zh...@rivai.ai
Thanks Robin. Address comment. juzhe.zh...@rivai.ai From: Robin Dapp Date: 2023-05-22 16:07 To: juzhe.zhong; gcc-patches CC: rdapp.gcc; kito.cheng; palmer; jeffreyalaw; Richard Sandiford Subject: Re: [PATCH] RISC-V: Add RVV comparison autovectorization Hi Juzhe, thanks. Some remarks inline.

[COMMITTED] ada: Fix crash caused by incorrect expansion of iterated component

2023-05-22 Thread Marc Poulhiès via Gcc-patches
The way iterated component are expanded could lead to inconsistent tree. This change fixes 2 issues: - in an early step during Pre_Analyze, the loop variable still has Any_Type and the compiler must not emit an error. A later full Analyze is supposed to correctly set the Etype, and only then shou

Re: [PATCH] rs6000: Fix __builtin_vec_xst_trunc definition

2023-05-22 Thread Kewen.Lin via Gcc-patches
Hi Carl, on 2023/5/11 02:06, Carl Love via Gcc-patches wrote: > GCC maintainers: > > The following patch fixes errors in the arguments in the > __builtin_altivec_tr_stxvrhx, __builtin_altivec_tr_stxvrwx builtin > definitions. Note, these builtins are used by the overloaded > __builtin_vec_xst_tr

[COMMITTED] ada: Incorrect constant folding in postcondition involving 'Old

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Justin Squirek The following patch fixes an issue in the compiler whereby certain flavors of access comparisons may be incorrectly constant-folded out of contract expressions - notably in postcondition expressions featuring a reference to 'Old. gcc/ada/ * checks.adb (Install_Null_

Re: [PATCH] RISC-V: Implement autovec abs, vneg, vnot.

2023-05-22 Thread Kito Cheng via Gcc-patches
So I expect you will also apply those refactor on Juzhe's new changes? If so I would like to have a separated NFC refactor patch if possible. e.g. Juzhe's vec_cmp/vcond -> NFC refactor patch -> abs, vneg, vnot On Mon, May 22, 2023 at 4:59 PM Robin Dapp wrote: > > As discussed with Juzhe off-list

[COMMITTED] ada: Reuse idiomatic procedure in CStand

2023-05-22 Thread Marc Poulhiès via Gcc-patches
From: Ronan Desplanques This change replaces a call to Set_Name_Entity_Id with a call to the higher-level Set_Current_Entity. gcc/ada/ * cstand.adb: Use more idiomatic procedure. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/cstand.adb | 3 +-- 1 file changed, 1 ins

Re: [PATCH] RISC-V: Implement autovec abs, vneg, vnot.

2023-05-22 Thread Robin Dapp via Gcc-patches
> So I expect you will also apply those refactor on Juzhe's new changes? > If so I would like to have a separated NFC refactor patch if possible. What's NFC? :) Do you mean to just have the refactor part as a separate patch? If yes, I agree. > e.g. > Juzhe's vec_cmp/vcond -> NFC refactor patch

Re: Re: [PATCH] RISC-V: Implement autovec abs, vneg, vnot.

2023-05-22 Thread juzhe.zh...@rivai.ai
Yeah, I agree wit kito. For example, I see you have rename "get_prefer_***" into "get_preferred_**" I think this NFC patch should be separated patch. Thanks. juzhe.zh...@rivai.ai From: Kito Cheng Date: 2023-05-22 17:05 To: Robin Dapp CC: 钟居哲; gcc-patches; palmer; Michael Collison; Jeff Law Su

Re: [PATCH] RISC-V: Add missing torture-init and torture-finish for rvv.exp

2023-05-22 Thread Kito Cheng via Gcc-patches
Ooops, seems still some issue around here, but I found something might related this issue: https://github.com/gcc-mirror/gcc/commit/d6654a4be3ba44c0d57be7c8a51d76d9721345e1 https://github.com/gcc-mirror/gcc/commit/23c49bb8d09bc3bfce9a08be637cf32ac014de56 On Mon, May 22, 2023 at 2:42 PM Kito Cheng

Re: [PATCH] RISC-V: Implement autovec abs, vneg, vnot.

2023-05-22 Thread Kito Cheng via Gcc-patches
> > So I expect you will also apply those refactor on Juzhe's new changes? > > If so I would like to have a separated NFC refactor patch if possible. > > What's NFC? :) Do you mean to just have the refactor part as a separate > patch? If yes, I agree. NFC: non-functional-change, that's a term us

Re: [PATCH, rs6000] Split TImode for logical operations in expand pass [PR100694]

2023-05-22 Thread Kewen.Lin via Gcc-patches
Hi Haochen, on 2023/2/8 13:08, HAO CHEN GUI wrote: > Hi, > The logical operations for TImode is split after reload pass right now. Some > potential optimizations miss as the split is too late. This patch removes > TImode from "AND", "IOR", "XOR" and "NOT" expander so that these logical > operati

[PATCH] RISC-V: Fix typo of multiple_rgroup-2.h

2023-05-22 Thread juzhe . zhong
From: Juzhe-Zhong Just notice this following fail in the regression: FAIL: gcc.target/riscv/rvv/autovec/partial/multiple_rgroup-2.c (test for excess errors) FAIL: gcc.target/riscv/rvv/autovec/partial/multiple_rgroup_run-2.c (test for excess errors) gcc/testsuite/ChangeLog: * gcc.targe

Re: [PATCH] c-family: implement -ffp-contract=on

2023-05-22 Thread Richard Biener via Gcc-patches
On Thu, May 18, 2023 at 11:04 PM Alexander Monakov via Gcc-patches wrote: > > Implement -ffp-contract=on for C and C++ without changing default > behavior (=off for -std=cNN, =fast for C++ and -std=gnuNN). The documentation changes mention the defaults are changed for standard modes, I suppose yo

Re: [PATCH] RISC-V: Fix typo of multiple_rgroup-2.h

2023-05-22 Thread Kito Cheng via Gcc-patches
ok On Mon, May 22, 2023 at 6:02 PM wrote: > > From: Juzhe-Zhong > > Just notice this following fail in the regression: > FAIL: gcc.target/riscv/rvv/autovec/partial/multiple_rgroup-2.c (test for > excess errors) > FAIL: gcc.target/riscv/rvv/autovec/partial/multiple_rgroup_run-2.c (test for > ex

Re: [PATCH V11] VECT: Add decrement IV support in Loop Vectorizer

2023-05-22 Thread Richard Biener via Gcc-patches
On Fri, May 19, 2023 at 12:59 PM Richard Sandiford via Gcc-patches wrote: > > "juzhe.zh...@rivai.ai" writes: > >>> I don't think this is a property of decrementing IVs. IIUC it's really > >>> a property of rgl->factor == 1 && factor == 1, where factor would need > >>> to be passed in by the call

Re: [committed] Enable LRA on several ports

2023-05-22 Thread Richard Biener via Gcc-patches
On Fri, May 19, 2023 at 1:45 PM Maciej W. Rozycki wrote: > > On Tue, 2 May 2023, Jeff Law via Gcc-patches wrote: > > > Well, I'd say that my plan would be to deprecate any target that is not > > converted by the end of this development cycle. So the change keeps cris > > from > > falling into th

Re: Re: [PATCH V11] VECT: Add decrement IV support in Loop Vectorizer

2023-05-22 Thread juzhe.zh...@rivai.ai
>> Not sure if you've covered this already in another thread but IIRC >> RVV uses "with-len" not only for loads and stores but for arithmetic >> instructions as well which is where (3) fails. Fortunately RVV uses >> element counts(?) Yes, RVV uses element count. But I did discover we have bugs f

RE: [PATCH] RISC-V: Fix typo of multiple_rgroup-2.h

2023-05-22 Thread Li, Pan2 via Gcc-patches
Committed, thanks Kito and Juzhe and sorry for inconvenient. Pan -Original Message- From: Kito Cheng Sent: Monday, May 22, 2023 6:05 PM To: juzhe.zh...@rivai.ai Cc: gcc-patches@gcc.gnu.org; kito.ch...@sifive.com; pal...@dabbelt.com; pal...@rivosinc.com; jeffreya...@gmail.com; rdapp

Re: [PATCH 1/2] Improve do_store_flag for single bit comparison against 0

2023-05-22 Thread Richard Biener via Gcc-patches
On Fri, May 19, 2023 at 4:15 AM Andrew Pinski via Gcc-patches wrote: > > While working something else, I noticed we could improve > the following function code generation: > ``` > unsigned f(unsigned t) > { > if (t & ~(1<<30)) __builtin_unreachable(); > return t != 0; > } > ``` > Right know we

Re: [PATCH] avr: Set param_min_pagesize to 0 [PR105523]

2023-05-22 Thread Richard Biener via Gcc-patches
On Fri, May 19, 2023 at 7:58 AM wrote: > > On 26/04/23, 5:51 PM, "Richard Biener" > wrote: > > On Wed, Apr 26, 2023 at 12:56 PM > > wrote: > > > > > > On Wed, Apr 26, 2023 at 3:15 PM Richard Biener via Gcc-patches >

[PATCH] RISC-V: Add "m_" prefix for private member

2023-05-22 Thread juzhe . zhong
From: Juzhe-Zhong Since the current framework is hard to maintain and hard to be used in the future possible auto-vectorization patterns. We will need to keep adding more helpers and arguments during the auto-vectorization supporting. We should refactor the framework now for the future use sinc

Re: [PATCH] RISC-V: Add RVV comparison autovectorization

2023-05-22 Thread Robin Dapp via Gcc-patches
> Thanks Robin. Address comment. Did you intend to send an update here already or are you working on it? Just wondering because you just sent another refactoring patch. Regards Robin

Re: [PATCH] Fix handling of non-integral bit-fields in native_encode_initializer

2023-05-22 Thread Richard Biener via Gcc-patches
On Mon, May 22, 2023 at 10:10 AM Eric Botcazou via Gcc-patches wrote: > > Hi, > > the encoder for CONSTRUCTORs assumes that all bit-fields (DECL_BIT_FIELD) have > integral types, but that's not the case in Ada where they may have pretty much > any type, resulting in a wrong encoding for them. > >

Re: Re: [PATCH] RISC-V: Add RVV comparison autovectorization

2023-05-22 Thread juzhe.zh...@rivai.ai
Yes, I am working on it, but I noticed that the current framework is really ugly and bad. I am gonna refactor it before I send comparison support. I do refactoring since we are going to have many different auto-vectorization patterns, for example: cond_addetc. I should make the current fram

Re: [PATCH] RISC-V: Add RVV comparison autovectorization

2023-05-22 Thread Robin Dapp via Gcc-patches
> I do refactoring since we are going to have many different > auto-vectorization patterns, for example: cond_addetc. > > I should make the current framework suitable for all of them to > simplify the future work. That's good in general but can't it wait until the respective changes go in? I

Re: Re: [PATCH] RISC-V: Add RVV comparison autovectorization

2023-05-22 Thread juzhe.zh...@rivai.ai
I will first send refactor patch soon. Then second send comparison patch. The refactor patch will be applicable for all future use, and they should come first since I have implemented the all RVV auto-vectorization patterns and I know what we will need in the future use. Thanks. juzhe.zh...@riv

[PATCH] libgomp: Fix build for -fshort-enums

2023-05-22 Thread Sebastian Huber
Make sure that the API enums have at least the size of int. Otherwise the following build error may occur: In file included from gcc/libgomp/env.c:34: ./libgomp_f.h: In function 'omp_check_defines': ./libgomp_f.h:77:8: error: size of array 'test' is negative 77 | char test[(28 != sizeof (omp

Re: [PATCH v1] tree-ssa-sink: Improve code sinking pass.

2023-05-22 Thread Richard Biener via Gcc-patches
On Thu, May 18, 2023 at 9:14 AM Ajit Agarwal wrote: > > Hello All: > > This patch improves code sinking pass to sink statements before call to reduce > register pressure. > Review comments are incorporated. > > Bootstrapped and regtested on powerpc64-linux-gnu. > > Thanks & Regards > Ajit > > > tr

Re: [PATCH 2/3] Refactor widen_plus as internal_fn

2023-05-22 Thread Richard Biener via Gcc-patches
On Thu, 18 May 2023, Andre Vieira (lists) wrote: > How about this? > > Not sure about the DEF_INTERNAL documentation I rewrote in internal-fn.def, > was struggling to word these, so improvements welcome! The even/odd variant optabs are also commutative_optab_p, so is the vec_widen_sadd without h

Re: [PATCH] add glibc-stdint.h to vax and lm32 linux target (PR target/105525)

2023-05-22 Thread Maciej W. Rozycki
On Fri, 19 May 2023, Mikael Pettersson wrote: > > Hmm, I find it quite insteresting and indeed encouraging that someone > > actually verifies our VAX/Linux target. > > > > Mikael, how do you actually verify it however? > > My vax builds are only cross-compilers without kernel headers or libc.

Re: [PATCH 1/2] PR gcc/98350:Add a param to control the length of the chain with FMA in reassoc pass

2023-05-22 Thread Richard Biener via Gcc-patches
On Wed, May 17, 2023 at 3:05 PM Cui, Lili wrote: > > > I think to make a difference you need to hit the number of parallel > > fadd/fmul > > the pipeline can perform. I don't think issue width is ever a problem for > > chains w/o fma and throughput of fma vs fadd + fmul should be similar. > > >

[PATCH] libiberty: On Windows pass a >32k cmdline through a response file.

2023-05-22 Thread Costas Argyris via Gcc-patches
Currently on Windows, when CreateProcess is called with a command-line that exceeds the 32k Windows limit, we get a very bad error: "CreateProcess: No such file or directory" This patch detects the case where this would happen and writes the long command-line to a temporary response file and call

Re: [PATCH] PR gcc/98350:Handle FMA friendly in reassoc pass

2023-05-22 Thread Richard Biener via Gcc-patches
On Wed, May 17, 2023 at 3:02 PM Cui, Lili wrote: > > From: Lili Cui > > Make some changes in reassoc pass to make it more friendly to fma pass later. > Using FMA instead of mult + add reduces register pressure and insruction > retired. > > There are mainly two changes > 1. Put no-mult ops and mul

Re: [PATCH 1/4] Missed opportunity to use [SU]ABD

2023-05-22 Thread Richard Biener via Gcc-patches
On Thu, May 18, 2023 at 7:59 PM Richard Sandiford wrote: > > Thanks for the update. Some of these comments would have applied > to the first version, so sorry for not catching them first time. > > writes: > > From: oluade01 > > > > This adds a recognition pattern for the non-widening > > absolu

Re: [PATCH v2] tree-ssa-sink: Improve code sinking pass

2023-05-22 Thread Richard Biener via Gcc-patches
On Fri, May 19, 2023 at 11:43 AM Ajit Agarwal wrote: > > Hello All: > > This patch improves code sinking pass to sink statements before call to reduce > register pressure. > Review comments are incorporated. > > For example : > > void bar(); > int j; > void foo(int a, int b, int c, int d, int e, i

Re: [PATCH 2/2] vect: Enhance cost evaluation in vect_transform_slp_perm_load_1

2023-05-22 Thread Richard Biener via Gcc-patches
On Wed, May 17, 2023 at 8:15 AM Kewen.Lin wrote: > > Hi, > > Following Richi's suggestion in [1], I'm working on deferring > cost evaluation next to the transformation, this patch is > to enhance function vect_transform_slp_perm_load_1 which > could under-cost for vector permutation, since the cos

Re: [PATCH] RISC-V: Add "m_" prefix for private member

2023-05-22 Thread Kito Cheng via Gcc-patches
LGTM On Mon, May 22, 2023 at 8:10 PM wrote: > > From: Juzhe-Zhong > > Since the current framework is hard to maintain and > hard to be used in the future possible auto-vectorization patterns. > > We will need to keep adding more helpers and arguments during the > auto-vectorization supporting. W

Re: [PATCH] add glibc-stdint.h to vax and lm32 linux target (PR target/105525)

2023-05-22 Thread Jan-Benedict Glaw
Hi! On Mon, 2023-05-22 14:10:48 +0100, Maciej W. Rozycki wrote: > On Fri, 19 May 2023, Mikael Pettersson wrote: > > The background is that I maintain a script to build GCC-based crosses to > > as many targets as I can, currently it supports 78 distinct processors and > > 82 triplets (four process

RE: [PATCH] RISC-V: Add "m_" prefix for private member

2023-05-22 Thread Li, Pan2 via Gcc-patches
Committed, thanks Kito. Pan -Original Message- From: Gcc-patches On Behalf Of Kito Cheng via Gcc-patches Sent: Monday, May 22, 2023 9:49 PM To: juzhe.zh...@rivai.ai Cc: gcc-patches@gcc.gnu.org; kito.ch...@gmail.com; pal...@dabbelt.com; pal...@rivosinc.com; jeffreya...@gmail.com; rdapp.

Re: [PATCH 0/7] openmp: OpenMP 5.1 loop transformation directives

2023-05-22 Thread Jakub Jelinek via Gcc-patches
On Wed, May 17, 2023 at 01:55:00PM +0200, Frederik Harwath wrote: > Thanks for the explanation. But actually doing this would require a > complete rewrite which would almost certainly imply that mainline GCC > would not support the loop transformations for a long time. I don't think it needs compl

[COMMITTED] i386: Account for the memory read in V*QImode multiplication sequences

2023-05-22 Thread Uros Bizjak via Gcc-patches
Add the cost of a memory read to the cost of V*QImode vector mult sequences. gcc/ChangeLog: * config/i386/i386.cc (ix86_multiplication_cost): Add the cost of a memory read to the cost of V?QImode sequences. Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}. Uros. diff --git

[avr,testsuite,committed] Skip test that fail for avr for this or that reason.

2023-05-22 Thread Georg-Johann Lay
This annotates some tests that won't work for AVR like: * asm goto with output reload (AVR is not lra). * Using a program address as a ram address. * Float related stuff: AVR double is 32-bit, and long double is incomplete (some functions missing, no signed zeros, etc.) Applied as obvious.

[testsuite,committed] PR testsuite/52641

2023-05-22 Thread Georg-Johann Lay
Applied more annotations to reduce testsuite fallout for 16-bit int / pointer targets. https://gcc.gnu.org/r14-1074 Most of the affected tests use constants not suitable for 16-bit int, bit-fields wider than 16 bits, etc. Johann -- commit 9f5065094c9632a50bea604d5896a139609e50cf Author: Ge

Re: [PATCH] c-family: implement -ffp-contract=on

2023-05-22 Thread Alexander Monakov via Gcc-patches
On Mon, 22 May 2023, Richard Biener wrote: > On Thu, May 18, 2023 at 11:04 PM Alexander Monakov via Gcc-patches > wrote: > > > > Implement -ffp-contract=on for C and C++ without changing default > > behavior (=off for -std=cNN, =fast for C++ and -std=gnuNN). > > The documentation changes menti

Re: [PATCH 1/2] Improve do_store_flag for single bit comparison against 0

2023-05-22 Thread Andrew Pinski via Gcc-patches
On Mon, May 22, 2023 at 4:56 AM Richard Biener via Gcc-patches wrote: > > On Fri, May 19, 2023 at 4:15 AM Andrew Pinski via Gcc-patches > wrote: > > > > While working something else, I noticed we could improve > > the following function code generation: > > ``` > > unsigned f(unsigned t) > > { >

  1   2   >