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

2023-05-25 Thread juzhe . zhong
From: Ju-Zhe Zhong This patch is supporting decrement IV by following the flow designed by Richard: (1) In vect_set_loop_condition_partial_vectors, for the first iteration of: call vect_set_loop_controls_directly. (2) vect_set_loop_controls_directly calculates "step" as in your patch. If

Re: [PATCH] [x86] reenable dword MOVE_MAX for better memmove inlining

2023-05-25 Thread Richard Biener via Gcc-patches
On Thu, May 25, 2023 at 1:10 PM Alexandre Oliva wrote: > > On May 25, 2023, Richard Biener wrote: > > > I mean we could do what RTL expansion would do later and do > > by-pieces, thus emit multiple loads/stores but not n loads and then > > n stores but interleaved. > > That wouldn't help e.g.

Re: [PATCH] [testsuite] [powerpc] adjust -m32 counts for fold-vec-extract*

2023-05-25 Thread Segher Boessenkool
Hi! On Thu, May 25, 2023 at 07:05:55AM -0300, Alexandre Oliva wrote: > On May 25, 2023, "Kewen.Lin" wrote: > > So both lp64 and ilp32 have the same count, could we merge it and > > remove the selectors? > > We could, but... I thought I wouldn't, since they were different > before, and they're

Re: [PATCH] [x86] reenable dword MOVE_MAX for better memmove inlining

2023-05-25 Thread Alexandre Oliva via Gcc-patches
On May 25, 2023, Richard Biener wrote: > I mean we could do what RTL expansion would do later and do > by-pieces, thus emit multiple loads/stores but not n loads and then > n stores but interleaved. That wouldn't help e.g. gcc.dg/memcpy-6.c's fold_move_8, because MOVE_MAX and MOVE_MAX_PIECES

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

2023-05-25 Thread Richard Biener via Gcc-patches
On Thu, 25 May 2023, juzhe.zh...@rivai.ai wrote: > Yeah. I see. Removing it will cause testcase run fail. > Now I found the issue, since you want to store the step in the iv_rgroup. > > After I tried, the IR looks correct but create ICE: > 0x18c8d41 process_bb >

[PATCH] target/109955 - handle pattern generated COND_EXPR without vcond

2023-05-25 Thread Richard Biener via Gcc-patches
The following properly handles pattern matching generated COND_EXPRs which can still have embedded compares in vectorizable_condition which will always code generate the masked vector variant. We were requiring vcond with embedded comparisons instead of also allowing (as code generated) split

Re: [PATCH] [x86] reenable dword MOVE_MAX for better memmove inlining

2023-05-25 Thread Richard Biener via Gcc-patches
On Thu, May 25, 2023 at 12:01 PM Alexandre Oliva wrote: > > --text follows this line-- > On May 24, 2023, Richard Biener wrote: > > > gimple_fold_builtin_memory_op tries to expand the call to a single > > load plus a single store so we can handle overlaps by first loading > > everything to

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

2023-05-25 Thread juzhe.zh...@rivai.ai
+(define_expand "abs2" + [(set (match_operand:VI 0 "register_operand") +(match_operand:VI 1 "register_operand"))] + "TARGET_VECTOR" +{ + rtx zero = gen_const_vec_duplicate (mode, GEN_INT (0)); + machine_mode mask_mode = riscv_vector::get_mask_mode (mode).require (); + rtx mask =

RE: [PATCH] arm: Fix ICE due to infinite splitting [PR109800]

2023-05-25 Thread Kyrylo Tkachov via Gcc-patches
> -Original Message- > From: Alex Coplan > Sent: Thursday, May 25, 2023 11:26 AM > To: Kyrylo Tkachov > Cc: gcc-patches@gcc.gnu.org; ni...@redhat.com; Richard Earnshaw > ; Ramana Radhakrishnan > > Subject: Re: [PATCH] arm: Fix ICE due to infinite splitting [PR109800] > > Hi Kyrill, >

Re: [PATCH] doc: clarify semantics of vector bitwise shifts

2023-05-25 Thread Richard Biener via Gcc-patches
On Thu, May 25, 2023 at 8:50 AM Richard Biener wrote: > > On Wed, May 24, 2023 at 8:36 PM Alexander Monakov wrote: > > > > > > On Wed, 24 May 2023, Richard Biener via Gcc-patches wrote: > > > > > I’d have to check the ISAs what they actually do here - it of course > > > depends > > > on RTL

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

2023-05-25 Thread juzhe.zh...@rivai.ai
Yeah. I see. Removing it will cause testcase run fail. Now I found the issue, since you want to store the step in the iv_rgroup. After I tried, the IR looks correct but create ICE: 0x18c8d41 process_bb ../../../riscv-gcc/gcc/tree-ssa-sccvn.cc:7933 0x18cb6d9 do_rpo_vn_1

Re: [PATCH] arm: Fix ICE due to infinite splitting [PR109800]

2023-05-25 Thread Alex Coplan via Gcc-patches
Hi Kyrill, On 23/05/2023 11:14, Kyrylo Tkachov wrote: > Hi Alex, > diff --git a/gcc/testsuite/gcc.target/arm/pr109800.c > b/gcc/testsuite/gcc.target/arm/pr109800.c > new file mode 100644 > index 000..71d1ede13dd > --- /dev/null > +++ b/gcc/testsuite/gcc.target/arm/pr109800.c > @@ -0,0

[committed] arc: Make TLS Local Dynamic work like Global Dynamic model

2023-05-25 Thread Claudiu Zissulescu via Gcc-patches
Current ARC's TLS Local Dynamic model is using two anchors to access data, namely `.tdata` and `.tbss`. This implementation is unnecessary complicated. However, the TLS Local Dynamic model has better results using Global Dynamic model and anchors. gcc/ChangeLog; * config/arc/arc.cc

Re: [PATCH 2/3] OpenMP: C++ support for imperfectly-nested loops

2023-05-25 Thread Jakub Jelinek via Gcc-patches
On Fri, Apr 28, 2023 at 05:22:53PM -0600, Sandra Loosemore wrote: > OpenMP 5.0 removed the restriction that multiple collapsed loops must > be perfectly nested, allowing "intervening code" (including nested > BLOCKs) before or after each nested loop. In GCC this code is moved > into the inner

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

2023-05-25 Thread Richard Sandiford via Gcc-patches
"juzhe.zh...@rivai.ai" writes: > Hi, Richard. Thanks for the comments. > >>> if (!LOOP_VINFO_USING_DECREMENTING_IV_P (loop_vinfo) >>> || !iv_rgc >>> || (iv_rgc->max_nscalars_per_iter * iv_rgc->factor >>> != rgc->max_nscalars_per_iter * rgc->factor)) >>> { > >> /* See

[ping] RE: [PATCH] stor-layout, aarch64: Express SRA intrinsics with RTL codes

2023-05-25 Thread Kyrylo Tkachov via Gcc-patches
Ping. Thanks, Kyrill > -Original Message- > From: Gcc-patches bounces+kyrylo.tkachov=arm@gcc.gnu.org> On Behalf Of Kyrylo > Tkachov via Gcc-patches > Sent: Thursday, May 18, 2023 4:19 PM > To: gcc-patches@gcc.gnu.org > Subject: [PATCH] stor-layout, aarch64: Express SRA intrinsics

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

2023-05-25 Thread Robin Dapp via Gcc-patches
Hi, this patch implements abs2, vneg2 and vnot2 expanders for integer vector registers and adds tests for them. v2 is rebased against Juzhe's latest refactoring. Regards Robin gcc/ChangeLog: * config/riscv/autovec.md (2): Add vneg/vnot. (abs2): Add. *

Re: [PATCH] [testsuite] [powerpc] adjust -m32 counts for fold-vec-extract*

2023-05-25 Thread Alexandre Oliva via Gcc-patches
On May 25, 2023, "Kewen.Lin" wrote: > Thanks for fixing, I tested this on ppc64le and ppc64 {-m64,-m32} > well. Thanks! > I think this is for PR101169, could you add it as PR marker? Nice, will do! >> -/* { dg-final { scan-assembler-times {\maddi\M|\madd\M} 3 { target ilp32 } >> } } */ >>

Re: [PATCH] [x86] reenable dword MOVE_MAX for better memmove inlining

2023-05-25 Thread Alexandre Oliva via Gcc-patches
--text follows this line-- On May 24, 2023, Richard Biener wrote: > gimple_fold_builtin_memory_op tries to expand the call to a single > load plus a single store so we can handle overlaps by first loading > everything to registers and then storing: *nod*, that's why I figured we could afford to

Re: [PATCH 1/3] OpenMP: C support for imperfectly-nested loops

2023-05-25 Thread Jakub Jelinek via Gcc-patches
On Fri, Apr 28, 2023 at 05:22:52PM -0600, Sandra Loosemore wrote: > OpenMP 5.0 removed the restriction that multiple collapsed loops must > be perfectly nested, allowing "intervening code" (including nested > BLOCKs) before or after each nested loop. In GCC this code is moved > into the inner

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

2023-05-25 Thread Prathamesh Kulkarni via Gcc-patches
On Thu, 25 May 2023 at 13:04, Richard Sandiford wrote: > > LGTM, just a couple of comment tweaks: > > Prathamesh Kulkarni writes: > > diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc > > index d6fc94015fa..db7ca4c28c3 100644 > > --- a/gcc/config/aarch64/aarch64.cc > >

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

2023-05-25 Thread juzhe.zh...@rivai.ai
Hi, Richard. Thanks for the comments. >> if (!LOOP_VINFO_USING_DECREMENTING_IV_P (loop_vinfo) >> || !iv_rgc >> || (iv_rgc->max_nscalars_per_iter * iv_rgc->factor >> != rgc->max_nscalars_per_iter * rgc->factor)) >> { >> /* See whether zero-based IV would ever generate

Re: [PATCH] RISC-V: Add autovec sign/zero extension and truncation.

2023-05-25 Thread Robin Dapp via Gcc-patches
Hi Juzhe, > use riscv_v_ext_vector_mode_p  instead since riscv_v_ext_mode_p includes > tuple modes. > You should not use tuple modes in related_mode. Tuple modes will be used in > array mode target hook and > used by vec_load_lanes/vec_store_lanes. Ah, thanks for catching this. Yes,

[PATCH] Add scalar_storage_order support to C++

2023-05-25 Thread naveenh--- via Gcc-patches
From: Naveen H S This patch adds support scalar_storage_order attribute to C++ front-end. It treats the opposite order fields similar as the packed fields are treated such that they will not bind to references. For arrays, the attributes applies to the inner type rather than the array type

[PATCH] Add scalar_storage_order support to C++

2023-05-25 Thread naveenh--- via Gcc-patches
From: Naveen H S This patch adds support scalar_storage_order attribute to C++ front-end. It treats the opposite order fields similar as the packed fields are treated such that they will not bind to references. For arrays, the attributes applies to the inner type rather than the array type

[PATCH] Add scalar_storage_order support to C++

2023-05-25 Thread naveenh--- via Gcc-patches
From: Naveen H S This patch adds support scalar_storage_order attribute to C++ front-end. It treats the opposite order fields similar as the packed fields are treated such that they will not bind to references. For arrays, the attributes applies to the inner type rather than the array type

[PATCH] Add scalar_storage_order support to C++

2023-05-25 Thread naveenh--- via Gcc-patches
From: Naveen H S This patch adds support scalar_storage_order attribute to C++ front-end. It treats the opposite order fields similar as the packed fields are treated such that they will not bind to references. For arrays, the attributes applies to the inner type rather than the array type

[PATCH] Add scalar_storage_order support to C++

2023-05-25 Thread naveenh--- via Gcc-patches
From: Naveen H S This patch adds support scalar_storage_order attribute to C++ front-end. It treats the opposite order fields similar as the packed fields are treated such that they will not bind to references. For arrays, the attributes applies to the inner type rather than the array type

Re: [PATCH] RISC-V: Add autovec sign/zero extension and truncation.

2023-05-25 Thread juzhe.zh...@rivai.ai
Hi, Robin. >>+extern bool riscv_v_ext_mode_p (machine_mode mode); No, we don't need it as global extern. >> + if (riscv_v_ext_mode_p (vector_mode) >>+ && multiple_p (BYTES_PER_RISCV_VECTOR * ((int) riscv_autovec_lmul), >>+ GET_MODE_SIZE (element_mode), _units)) use

Re: [PATCH] RISC-V: In pipeline scheduling, insns should not be fusion in different BB blocks.

2023-05-25 Thread Richard Sandiford via Gcc-patches
Jin Ma writes: > When the last insn1 of BB1 and the first insn2 of BB2 are fusion, insn2 will > clear all dependencies in the function chain_to_prev_insn, resulting in insn2 > may mov to any BB, and the program calculation result is wrong. > > gcc/ChangeLog: > > * sched-deps.cc

Re: [PATCH] Fix type error of 'switch (SUBREG_BYTE (op)).'

2023-05-25 Thread Richard Sandiford via Gcc-patches
"Jin Ma" writes: >> > On 5/17/23 03:03, Jin Ma wrote: >> >> For example: >> >> (define_insn "mov_lowpart_sidi2" >> >>[(set (match_operand:SI0 "register_operand" "=r") >> >> (subreg:SI (match_operand:DI 1 "register_operand" " r") 0))] >> >>"TARGET_64BIT" >> >>

[PATCH] RISC-V: Add autovec sign/zero extension and truncation.

2023-05-25 Thread Robin Dapp via Gcc-patches
Hi, this patch implements the autovec expanders for sign and zero extension patterns as well as the accompanying truncations. In order to use them additional mode_attr iterators as well as vectorizer hooks are required. Using these hooks we can e.g. vectorize with VNx4QImode as base mode and

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

2023-05-25 Thread Richard Sandiford via Gcc-patches
Thanks, this looks functionally correct to me. And I agree it handles the cases that previously needed multiplication. But I think it regresses code quality when no multiplication was needed. We can now generate duplicate IVs. Perhaps ivopts would remove the duplicates, but it might be hard,

[PATCH] tree-optimization/109791 - expand + off for niter compute

2023-05-25 Thread Richard Biener via Gcc-patches
The following makes expand_simple_operations expand POINTER_PLUS_EXPRs with variable offset when the base is invariant. That will allow to simplify address differences to offset differences in some cases. Note the patch doesn't follow the variable off chain as I don't have a testcase showing

RE: [PATCH] aarch64: Implement vector FP absolute compare intrinsics with builtins

2023-05-25 Thread Kyrylo Tkachov via Gcc-patches
> -Original Message- > From: Kyrylo Tkachov > Sent: Thursday, May 18, 2023 12:14 PM > To: gcc-patches@gcc.gnu.org > Cc: Richard Sandiford > Subject: [PATCH] aarch64: Implement vector FP absolute compare intrinsics > with builtins > > Hi all, > > While optimising some vector math

RE: [PATCH] i386: Fix incorrect intrinsic signature for AVX512 s{lli|rai|rli}

2023-05-25 Thread Liu, Hongtao via Gcc-patches
> -Original Message- > From: Hu, Lin1 > Sent: Thursday, May 25, 2023 3:52 PM > To: Hongtao Liu > Cc: gcc-patches@gcc.gnu.org; Liu, Hongtao ; > ubiz...@gmail.com > Subject: RE: [PATCH] i386: Fix incorrect intrinsic signature for AVX512 > s{lli|rai|rli} > > OK, I update the change log

[PATCH] RISC-V: In pipeline scheduling, insns should not be fusion in different BB blocks.

2023-05-25 Thread Jin Ma via Gcc-patches
When the last insn1 of BB1 and the first insn2 of BB2 are fusion, insn2 will clear all dependencies in the function chain_to_prev_insn, resulting in insn2 may mov to any BB, and the program calculation result is wrong. gcc/ChangeLog: * sched-deps.cc (sched_macro_fuse_insns): Insns should

Re: [PATCH] Fix type error of 'switch (SUBREG_BYTE (op)).'

2023-05-25 Thread Jin Ma via Gcc-patches
> > On 5/17/23 03:03, Jin Ma wrote: > >> For example: > >> (define_insn "mov_lowpart_sidi2" > >>[(set (match_operand:SI0 "register_operand" "=r") > >> (subreg:SI (match_operand:DI 1 "register_operand" " r") 0))] > >>"TARGET_64BIT" > >>"mov\t%0,%1") > >> > >>

Re: [PATCH] LoongArch: Fix the problem of structure parameter passing in C++. This structure has empty structure members and less than three floating point members.

2023-05-25 Thread Jonathan Wakely via Gcc-patches
On Wed, 24 May 2023 at 21:15, Jason Merrill wrote: > On Wed, May 24, 2023 at 5:00 AM Jonathan Wakely via Gcc-patches < > gcc-patches@gcc.gnu.org> wrote: > >> On Wed, 24 May 2023 at 09:41, Xi Ruoyao wrote: >> >> > Wang Lei raised some concerns about Itanium C++ ABI, so let's ask a C++ >> >

[COMMITTED] ada: Require successful build of xsnamest

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Tom Tromey While experimenting, I introduced a compilation error into xsnamest. This took a little while to track down because, while the error was in the log, the build did not stop. This patch changes Make-generated.in to require a successful build of this program. gcc/ada/ *

[COMMITTED] ada: Minor adjustments to Standard_Address

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou Standard_Address is an internal entity that is meant to be a clone of System.Address built at compilation startup. It needs to be seen as a bona-fide address by the code generator. For the sake of completeness, it is also given its modulus, although this does not matter in

[COMMITTED] ada: Enable Support_Atomic_Primitives on VxWorks 7 PPC

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Johannes Kliemann gcc/ada/ * libgnat/system-vxworks7-ppc-kernel.ads: Enable Support_Atomic_Primitives. * libgnat/system-vxworks7-ppc-rtp-smp.ads: Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/system-vxworks7-ppc-kernel.ads |

[COMMITTED] ada: Missing warning on null-excluding array aggregate component

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Javier Miranda The compiler does not report warnings on the initialization of arrays of null-excluding access type components by means of iterated component association, when the expression initializing each component is either a conditional expression or a case expression that may

[COMMITTED] ada: Fix copying of quantified expressions

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek While visiting the AST as part of routine New_Copy_Tree we maintain an EWA_Level variable in a stack-like fashion. This worked fine for expression with actions nodes but not for quantified expressions. gcc/ada/ * sem_util.adb (Visit_Node): Decrement EWA_Level with

[COMMITTED] ada: Expect Exceptional_Cases as a context for attribute Old

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek When determining whether attribute Old is evaluated conditionally, we must also expect it to appear in the recently added contract Exceptional_Cases. gcc/ada/ * sem_util.adb (Determining_Expressions): Fix style; fix layout and ordering of pragma names;

[COMMITTED] ada: Simplify copying of node lists

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek When creating a copy of a node list we called Copy_Entity for entities and Copy_Separate_Tree for other nodes. This was unnecessary, because the Copy_Separate_Tree when called on entities will just do Copy_Entity. Code cleanup; semantics is unaffected. gcc/ada/ *

[COMMITTED] ada: Use procedural variant of Next_Index where possible

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * einfo-utils.adb (Write_Entity_Info): Use procedural Next_Index. * sem_aggr.adb (Collect_Aggr_Bounds): Reuse local constant. (Resolve_Null_Array_Aggregate): Use procedural Next_Index. Tested on

[COMMITTED] ada: Avoid duplicated streaming subprograms

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Steve Baird In some common cases, a reference to Some_Type'Some_Streaming_Attribute causes the needed subprogram to be generated "on demand". If there are multiple such references (e.g., two calls to Some_Type'Write) then we want to avoid generating multiple essentially-identical

[COMMITTED] ada: Fix (again) incorrect handling of Aggregate aspect

2023-05-25 Thread Marc Poulhiès via Gcc-patches
Previous fix stopped the processing of the Aggregate aspect early, skipping the call to Record_Rep_Item, making later call to Resolve_Container_Aggregate fail. Also, the previous fix would not handle correctly the case where the type is private and the check for non-array type can only be done at

[COMMITTED] ada: Crash on empty aggregate using the Ada 2022 notation

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Javier Miranda The compiler crashes processing an empty aggregate initializing a component of a discriminated record type using the Ada 2022 notation (that is, []). gcc/ada/ * exp_aggr.adb (Build_Record_Aggr_Code): Protect access to aggregate components when the aggregate

[COMMITTED] ada: Switch from E_Void to Is_Not_Self_Hidden

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Bob Duff We had previously used Ekind = E_Void to indicate that a declaration is self-hidden. We now use the Is_Not_Self_Hidden flag instead. This allows us to avoid many "vanishing fields", which are (possibly-latent) bugs, and we now enable the assertions in Atree that detect such bugs.

[COMMITTED] ada: Fix copy-paste mistake in analysis of Exceptional_Cases

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Trivial mistakes in copied code. gcc/ada/ * sem_prag.adb (Analyze_Pragma): Fix references to Exceptional_Cases in code copied from handling of Subprogram_Variant. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_prag.adb | 6 +++--- 1

[COMMITTED] ada: Add size clause to System.Address

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou Standard'Address_Size is the value provided by the code generator for the size of pointers, and it is set as the default size of every thin pointer by the front-end. Now it is documented in the GNAT RM as having the value of System.Address'Size, which is indeed the case on

[COMMITTED] ada: Decouple size of addresses and pointers from size of memory space

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This decouples the size of the types representing addresses and pointers, which is Standard'Address_Size, from the size of the memory space, which is System.Memory_Size (more precisely log2 of it). They are tied through the definition of System.Address: type Address is

[COMMITTED] ada: Remove redundant guards from calls to Move_Aspects

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Routine Move_Aspects does nothing if its From parameter has no aspects. There is no need to check this at the call sites. Code cleanup related to changes in handling of expressions functions in GNATprove; semantics is unaffected. gcc/ada/ * par-ch7.adb

[COMMITTED] ada: Deconstruct a no longer used parameter of New_Copy_Tree

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Parameter Scopes_In_EWA_OK of New_Copy_Tree was introduced in 2018 to deal with expressions-with-actions (EWA) in the build-in-place machinery. However, after changes made in 2022 it is no longer used by any caller. Cleanup related to handling of expression functions in

[COMMITTED] ada: Clean up copying of node trees

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Before calling routine In_Entity_Map we checked if the entity map is present; inside this routine we checked this again. Code cleanup; semantics is unaffected. gcc/ada/ * sem_util.adb (Update_New_Entities): Remove redundant check for entity map being

[COMMITTED] ada: Maximize use of existing constant

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Ronan Desplanques This patch does not change the behavior of the compiler and is intended as a readability improvement. gcc/ada/ * sem_ch3.adb (Replace_Type): Use existing constant wherever possible. Tested on x86_64-pc-linux-gnu, committed on master. ---

[COMMITTED] ada: Remove unused initial value of a local variable

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Cleanup related to improved handling of expression functions in GNATprove; semantics is unaffected. gcc/ada/ * sem_ch6.adb (Analyze_Return_Type): Remove unused initial value. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch6.adb | 2 +- 1

[COMMITTED] ada: Tune handling of attributes Old in contract Exceptional_Cases

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Contract Exceptional_Cases allows formal parameters to appear *in* prefixes of attributes Old, but the code only allowed them to appear *as* prefixes of those attributes. For example, we now accetp expressions like "X.all'Old" that were previously rejected. gcc/ada/

[COMMITTED] ada: Small tweak to implementation of by-copy semantics for storage models

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou Get_Actual_Subtype can be used to access the Actual_Designated_Subtype of explicit dereferences with a storage model. As a side effect, this also handles the case where the prefix of the dereference is a formal parameter. gcc/ada/ * exp_ch6.adb

[COMMITTED] ada: Prevent search of calls in preconditions from going too far

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek When determining whether a call to protected function appears within a pragma expression we can safely stop at the subprogram body. Cleanup related to recently added support for a new SPARK aspects, whose implementation was based on Contract_Cases. gcc/ada/ *

[COMMITTED] ada: Fix comments for recently added SPARK aspects

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Implementation of contract Subprogram_Variant and Exceptional_Cases was based on the existing code for Contract_Cases, i.e. on the existing occurrences of Aspect_Contract_Cases, Name_Contract_Cases and Pragma_Contract_Cases. However, occurrences of "Contract_Cases" itself in

[COMMITTED] ada: Set Is_Not_Self_Hidden flag in more cases

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Bob Duff More work-in-progress for changing E_Void checks to the flag. gcc/ada/ * sem_ch9.adb (Analyze_Protected_Type_Declaration): Set the flag for protected types. (Analyze_Single_Protected_Declaration): Likewise, for singleton protected objects.

[COMMITTED] ada: Fix crash during function return analysis

2023-05-25 Thread Marc Poulhiès via Gcc-patches
The compiler would crash when checking type relation between the function's return type and the type of the expression used in the return statement. It would not work if the function's return type is an access type and the expression is not. gcc/ada/ * sem_ch6.adb

[COMMITTED] ada: Add Entry_Cancel_Parameter to E_Label

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Bob Duff ...and other (minor) changes. gcc/ada/ * gen_il-gen-gen_entities.adb (E_Label): Add Entry_Cancel_Parameter. This is necessary because Analyze_Implicit_Label_Declaration set the Ekind to E_Label. Without this change, this field would fail the

[COMMITTED] ada: Enrich documentation of subprogram

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Ronan Desplanques This patch adds documentation to the subprogram Replace_Type in Sem_Ch3. In particular, references to relevant parts of the Ada reference manual are added. gcc/ada/ * sem_ch3.adb (Replace_Type): Add more documentation. Tested on x86_64-pc-linux-gnu, committed

[COMMITTED] ada: Fix internal error on declare-expression in post-condition

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou It comes from an incorrect node sharing in the expanded tree. gcc/ada/ * sem_ch3.adb (Find_Type_Of_Object): Copy the object definition when building the subtype declaration in the case of a spec expression. Tested on x86_64-pc-linux-gnu, committed on

[COMMITTED] ada: Add missing supportive code for recently added SPARK aspects

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Fix minor inconsistencies with the recently added SPARK aspects Exceptional_Cases and Subprogram_Variant, whose implementation is based on Contract_Cases. gcc/ada/ * aspects.ads (Implementation_Defined_Aspect): Recently added aspects are

[COMMITTED] ada: Fix incorrect handling of Aggregate aspect

2023-05-25 Thread Marc Poulhiès via Gcc-patches
This change fixes 2 incorrect handlings of the aspect. The arguments are now correctly resolved and the aspect is rejected on non array types. gcc/ada/ * sem_ch13.adb (Analyze_One_Aspect): Mark Aggregate aspect as needing delayed resolution and reject the aspect on non-array

[COMMITTED] ada: Handle controlling access parameters in DTWs

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Ronan Desplanques This patch improves the way controlling access parameters are handled in dispatch table wrappers. The constructions of both the specifications and the bodies of wrappers are modified. gcc/ada/ * freeze.adb (Build_DTW_Body): Add appropriate type conversions for

[COMMITTED] ada: Fix error message for Aggregate aspect

2023-05-25 Thread Marc Poulhiès via Gcc-patches
The error message was wrongly using % instead of & in the format string, causing the displayed message to refer to incorrect names in some cases. gcc/ada/ * sem_ch13.adb (Check_Aspect_At_Freeze_Point): fix format string, use existing local Ident. Tested on x86_64-pc-linux-gnu,

[COMMITTED] ada: Reduce span of variable

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Ronan Desplanques This patch does not change the behavior of the compiler, but is intended to improve readability. It seizes an opportunity to move a variable declaration to a smaller scope, so that it's clearer that the variable is not used outside of that scope. gcc/ada/ *

[COMMITTED] ada: Fix obsolete comment in Sinfo.Utils

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Bob Duff ...caused by moving code here from Atree. gcc/ada/ * sinfo-utils.adb: Update comment to refer to New_Node_Debugging_Output. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sinfo-utils.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[COMMITTED] ada: Tune warning about assignment just before a raise statement

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Tune warning about a possibly ineffective assignment to a formal parameter that happens just before a raise statement. The warning is now emitted for parameters of all by-copy types and not just of scalar types (this gives more warnings), but is suppressed for aliased

[COMMITTED] ada: Fix SPARK context not restored when Load_Unit is failing

2023-05-25 Thread Marc Poulhiès via Gcc-patches
When Load_Unit fails to find the unit or encounters an error, the Load_Fail procedure is called and an exception is raised, skipping the restoration of the SPARK/Ghost context stored on procedure entry. gcc/ada/ * rtsfind.adb (Load_RTU.Restore_SPARK_Context): New. (Load_RTU): Use

[COMMITTED] ada: Minor fixes in description of scope depth

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou In particular, the scope depth of library units is 1 instead of 0. gcc/ada/ * einfo.ads (Scope_Depth): Fix circular definition. (Scope_Depth_Value): Fix value for library units. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/einfo.ads | 6

[COMMITTED] ada: Restrict use of formal parameters within exceptional cases

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Restrict references to formal parameters within the new SPARK aspect Exceptional_Cases and allow occurrences of 'Old in this aspect. gcc/ada/ * sem_attr.adb (Analyze_Attribute_Old_Result): Allow uses of 'Old and 'Result within the new aspect.

[COMMITTED] ada: Accept aliased parameters in Exceptional_Cases

2023-05-25 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Aliased parameters, just like parameters by-reference types, can safely appear in consequences of Exceptional_Cases aspect. gcc/ada/ * sem_res.adb (Resolve_Entity_Name): Allow aliased parameters; tune error message. Tested on x86_64-pc-linux-gnu, committed

Re: [COMMITTED 4/4] - Gimple range PHI analyzer and testcases

2023-05-25 Thread Aldy Hernandez via Gcc-patches
Some minor nits. +// There can be only one running at a time. +static phi_analyzer *phi_analysis_object = NULL; Shouldn't this be phi_analyzer_object to be more consistent? Similarly throughout. +// Create a new phi_group with members BM, initialvalue INIT_VAL, modifier +// statement

[PATCH] RISC-V: Add RVV FRM enum for floating-point rounding mode intriniscs

2023-05-25 Thread juzhe . zhong
From: Juzhe-Zhong gcc/ChangeLog: * config/riscv/riscv-vector-builtins.cc (register_frm): New function. (DEF_RVV_FRM_ENUM): New macro. (handle_pragma_vector): Add FRM enum * config/riscv/riscv-vector-builtins.def (DEF_RVV_FRM_ENUM): New macro. (RNE):

RE: [PATCH] i386: Fix incorrect intrinsic signature for AVX512 s{lli|rai|rli}

2023-05-25 Thread Hu, Lin1 via Gcc-patches
OK, I update the change log and modify a part of format. The attached file is the new version. -Original Message- From: Hongtao Liu Sent: Thursday, May 25, 2023 11:40 AM To: Hu, Lin1 Cc: gcc-patches@gcc.gnu.org; Liu, Hongtao ; ubiz...@gmail.com Subject: Re: [PATCH] i386: Fix

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

2023-05-25 Thread juzhe.zh...@rivai.ai
Bootstrap && Regression on X86 passed. Ok for trunk ? juzhe.zh...@rivai.ai From: juzhe.zhong Date: 2023-05-25 10:58 To: gcc-patches CC: richard.sandiford; rguenther; Ju-Zhe Zhong Subject: [PATCH V15] VECT: Add decrement IV iteration loop control by variable amount support From: Ju-Zhe Zhong

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

2023-05-25 Thread Richard Sandiford via Gcc-patches
LGTM, just a couple of comment tweaks: Prathamesh Kulkarni writes: > diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc > index d6fc94015fa..db7ca4c28c3 100644 > --- a/gcc/config/aarch64/aarch64.cc > +++ b/gcc/config/aarch64/aarch64.cc > @@ -22332,6 +22332,46 @@

Re: [PATCH] libgcc: Use initarray section type for .init_stack

2023-05-25 Thread Andreas Krebbel via Gcc-patches
On 3/20/23 07:33, Kewen.Lin wrote: > Hi, > > One of my workmates found there is a warning like: > > libgcc/config/rs6000/morestack.S:402: Warning: ignoring > incorrect section type for .init_array.0 > > when compiling libgcc/config/rs6000/morestack.S. > > Since commit r13-6545

Re: [COMMITTED 4/4] - Gimple range PHI analyzer and testcases

2023-05-25 Thread Richard Biener via Gcc-patches
On Wed, May 24, 2023 at 11:21 PM Andrew MacLeod via Gcc-patches wrote: > > This patch provide the framework for a gimple-range phi analyzer. > > Currently, the primary purpose is to give better initial values for > members of a "phi group" > > a PHI group is defined as a a group of PHI nodes

[PATCH V2] RISC-V: Fix incorrect VXRM configuration in mode switching for CALL and ASM

2023-05-25 Thread juzhe . zhong
From: Juzhe-Zhong Currently mode switching incorrect codegen for the following case: void fn (void); void f (void * in, void *out, int32_t x, int n, int m) { for (int i = 0; i < n; i++) { vint32m1_t v = __riscv_vle32_v_i32m1 (in + i, 4); vint32m1_t v2 = __riscv_vle32_v_i32m1_tu (v, in

[PATCH] Add scalar_storage_order support to C++

2023-05-25 Thread naveenh--- via Gcc-patches
From: Naveen H S This patch adds support scalar_storage_order attribute to C++ front-end. It treats the opposite order fields similar as the packed fields are treated such that they will not bind to references. For arrays, the attributes applies to the inner type rather than the array type

Re: [PATCH] doc: clarify semantics of vector bitwise shifts

2023-05-25 Thread Richard Biener via Gcc-patches
On Wed, May 24, 2023 at 8:36 PM Alexander Monakov wrote: > > > On Wed, 24 May 2023, Richard Biener via Gcc-patches wrote: > > > I’d have to check the ISAs what they actually do here - it of course depends > > on RTL semantics as well but as you say those are not strictly defined here > > either.

[PATCH] RISC-V: Fix incorrect VXRM configuration in mode switching for CALL and ASM

2023-05-25 Thread juzhe . zhong
From: Juzhe-Zhong Currenty mode switching incorrect codegen for the following case: void fn (void); void f (void * in, void *out, int32_t x, int n, int m) { for (int i = 0; i < n; i++) { vint32m1_t v = __riscv_vle32_v_i32m1 (in + i, 4); vint32m1_t v2 = __riscv_vle32_v_i32m1_tu (v, in

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

2023-05-25 Thread Prathamesh Kulkarni via Gcc-patches
On Thu, 25 May 2023 at 01:28, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > > On Wed, 24 May 2023 at 15:40, Richard Sandiford > > wrote: > >> > >> Prathamesh Kulkarni writes: > >> > On Mon, 22 May 2023 at 14:18, Richard Sandiford > >> > wrote: > >> >> > >> >> Prathamesh Kulkarni

Re: [patch]: Implement PR104327 for avr

2023-05-25 Thread Richard Biener via Gcc-patches
On Wed, May 24, 2023 at 5:44 PM Georg-Johann Lay wrote: > > > > Am 24.05.23 um 11:38 schrieb Richard Biener: > > On Tue, May 23, 2023 at 2:56 PM Georg-Johann Lay wrote: > >> > >> PR target/104327 not only affects s390 but also avr: > >> The avr backend pre-sets some options depending on

Re: [PATCH] Fix artificial overflow during GENERIC folding

2023-05-25 Thread Richard Biener via Gcc-patches
On Wed, May 24, 2023 at 4:41 PM Eric Botcazou wrote: > > > But nobody is going to understand why the INTEGER_CST case goes the > > other way. > > I can add a fat comment to that effect of course. :-) > > > As you say we don't have a good way to say we're doing > > this to avoid undefined

RE: [PATCH] RISC-V: Remove FRM_REGNUM dependency for rtx conversions

2023-05-25 Thread Li, Pan2 via Gcc-patches
Committed, thanks Kito. Pan -Original Message- From: Gcc-patches On Behalf Of Kito Cheng via Gcc-patches Sent: Thursday, May 25, 2023 12:02 PM To: juzhe.zh...@rivai.ai Cc: gcc-patches@gcc.gnu.org; pal...@rivosinc.com; rdapp@gmail.com; jeffreya...@gmail.com Subject: Re: [PATCH]

<    1   2