[PATCH v2] i386: Disable ix86_expand_vecop_qihi2 when !TARGET_AVX512BW

2024-05-21 Thread Haochen Jiang
Hi all, This is the v2 patch to fix PR115069. The new testcase has passed. Changes in v2: - Added a testcase. - Change the comment for the early exit. Thx, Haochen Since vpermq is really slow, we should avoid using it for permutation when vpmovwb is not available (needs AVX512BW) for ix86_e

Re: [PATCH v2] i386: Disable ix86_expand_vecop_qihi2 when !TARGET_AVX512BW

2024-05-21 Thread Hongtao Liu
On Tue, May 21, 2024 at 3:14 PM Haochen Jiang wrote: > > Hi all, > > This is the v2 patch to fix PR115069. The new testcase has passed. > > Changes in v2: > - Added a testcase. > - Change the comment for the early exit. > > Thx, > Haochen > > Since vpermq is really slow, we should avoid using

Re: [Patch] Fortran: invoke.texi - link to OpenCoarrays.org + mention libcaf_single

2024-05-21 Thread rep . dot . nop
On 20 May 2024 02:31:27 CEST, Sandra Loosemore wrote: >On 5/19/24 02:01, Tobias Burnus wrote: >> I noticed that gfortran's coarray support did not link to the >> http://www.opencoarrays.org/ > >> [snip] >> >> diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi >> index 40e8e4a7cdd..78

[COMMITTED 02/31] ada: Follow-up fix to previous change for Text_Ptr

2024-05-21 Thread Marc Poulhiès
From: Eric Botcazou The variable would be saved and restored while still uninitialized. gcc/ada/ * err_vars.ads (Error_Msg_Sloc): Initialize to No_Location. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/err_vars.ads | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[COMMITTED 04/31] ada: Remove conversion from String_Id to String and back to String_Id

2024-05-21 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * exp_put_image.adb (Build_Record_Put_Image_Procedure): Remove useless conversions. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_put_image.adb | 6 ++ 1 file changed, 2 insertions(

[COMMITTED 07/31] ada: Fix index entry for an implemented AI feature

2024-05-21 Thread Marc Poulhiès
From: Piotr Trojanek Fix inconsistent reference with "05" in the name of AI. gcc/ada/ * doc/gnat_rm/implementation_of_ada_2012_features.rst (AI-0216): Fix index reference. * gnat_rm.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/doc/

[COMMITTED 03/31] ada: Remove trailing NUL in minimal expansion of Put_Image attribute

2024-05-21 Thread Marc Poulhiès
From: Piotr Trojanek When procedure that implements Put_Image attribute emits the type name, this name was wrongly followed by a NUL character. gcc/ada/ * exp_put_image.adb (Build_Record_Put_Image_Procedure): Remove trailing NUL from the fully qualified type name. Tested on x86

[COMMITTED 12/31] ada: Add elaboration switch tags to info messages

2024-05-21 Thread Marc Poulhiès
From: Viljar Indus Add the ?$? insertion characters for elaboration message so they would be marked with the [-gnatel] tag. Note that these insertion characters were not added for SPARK elaboration messages: gcc/ada/ * sem_elab.adb: Add missing elaboration insertion characters t

[COMMITTED 09/31] ada: Fix formatting in list of implemented Ada 2012 features

2024-05-21 Thread Marc Poulhiès
From: Piotr Trojanek Fix formatting; meaning is unaffected. gcc/ada/ * doc/gnat_rm/implementation_of_ada_2012_features.rst: Fix formatting. * gnat_rm.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/doc/gnat_rm/implementation_of_ada_20

[COMMITTED 05/31] ada: Do not leak tagged type names when Discard_Names is enabled

2024-05-21 Thread Marc Poulhiès
From: Piotr Trojanek When both pragmas Discard_Names and No_Tagged_Streams apply to a tagged type, the intended behavior is to prevent type names from leaking into object code, as documented in GNAT RM. However, while Discard_Names can be used as a configuration pragma, No_Tagged_Streams must be

[COMMITTED 06/31] ada: Update documentation of warning messages

2024-05-21 Thread Marc Poulhiès
From: Viljar Indus Update the documentation of warning messages that only emit info messages to clearly reflect that they only emit info messages and not warning messages. gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Update the documentation of -gnatw.n an

[COMMITTED 11/31] ada: Simplify management of scopes while inlining

2024-05-21 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * inline.adb (Add_Scope_To_Clean): Use Append_Unique_Elmt. (Analyze_Inlined_Bodies): Refine type of a local counter; remove extra whitespace. Tested on x86_64-pc-linux-gnu, committed on master. --- g

[COMMITTED 21/31] ada: Remove unused dependencies from gnatbind object list

2024-05-21 Thread Marc Poulhiès
From: Piotr Trojanek The gnatbind executable does not depend on aspects, SCIL, style checks, etc. Also, these dependencies are not needed to actually build the executable. Cleanup. gcc/ada/ * gcc-interface/Make-lang.in (GNATBIND_OBJS): Remove unused dependencies. Tested on x86_

[COMMITTED 01/31] ada: Add new Mingw task priority mapping

2024-05-21 Thread Marc Poulhiès
From: Justin Squirek This patch adds a new mapping (Non_FIFO_Underlying_Priorities) for dynamically setting task priorities in Windows when pragma Task_Dispatching_Policy (FIFO_Within_Priorities) is not present. Additionally, it documents the requirement to specify the pragma in order to use Set_

[COMMITTED 13/31] ada: Remove useless trampolines caused by Unchecked_Conversion

2024-05-21 Thread Marc Poulhiès
From: Eric Botcazou The partial solution implemented in Validate_Unchecked_Conversion to support unchecked conversions between addresses and pointers to subprograms, for the platforms where pointers to subprograms do not all have the same size, turns out to be counter-productive for others becaus

[COMMITTED 16/31] ada: Missing constraint check for initial value of object with address clause

2024-05-21 Thread Marc Poulhiès
From: Steve Baird In some cases where an object is declared with an initial value that is an aggregate and also with a specified Address (either via an aspect_specification or via an attribute_definition_clause), the check that the initial value satisfies the constraints of the object's subtype w

[COMMITTED 10/31] ada: Remove some explicit yields in tasking run-time

2024-05-21 Thread Marc Poulhiès
From: Ronan Desplanques This patch removes three occurrences where tasking run-time subprograms yielded control shortly before conditional calls to Sleep, in order to avoid these calls more often. It was intended as an optimization on systems where calls to Sleep are costly and in particular VMS.

[COMMITTED 28/31] ada: Fix strict aliasing violation in parameter passing (continued)

2024-05-21 Thread Marc Poulhiès
From: Eric Botcazou This fixes another long-standing (implicit) violation of the strict aliasing rules that occurs when the result of a value conversion is directly passed as an actual parameter in a call to a subprogram and the passing mechanism is by reference. In this case, the reference pass

[COMMITTED 15/31] ada: Fix layout in a list of aspects

2024-05-21 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * aspects.ads (Nonoverridable_Aspect_Id): Fix layout. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/aspects.ads | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --gi

[COMMITTED 20/31] ada: Fix assembler error for gigantic library-level object on 64-bit Windows

2024-05-21 Thread Marc Poulhiès
From: Eric Botcazou Most small 64-bit code models have a limit of 2 GB on the span of binaries, so we also use the limit for the size of the largest statically allocatable object by the compiler. If the limit is topped, the compiler switches over to a dynamic allocation (if not forbidden) after

Re: [Patch] contrib/gcc-changelog/git_update_version.py: Improve diagnostic

2024-05-21 Thread Tobias Burnus
Hi Jakub, Jakub Jelinek wrote: On Mon, May 20, 2024 at 08:31:02AM +0200, Tobias Burnus wrote: Hmm, there were now two daily bumps: [...] I really wonder why. Because I've done it by hand. Okay, that explains it. I still do not understand why it slipped through at the first place; I tried o

[COMMITTED 14/31] ada: Remove duplicate statement

2024-05-21 Thread Marc Poulhiès
From: Ronan Desplanques This patch removes a duplicate statement that was useless and could be misleading to the reader by suggesting that there are multiple global variables named Style_Check, while there is just one. gcc/ada/ * frontend.adb (Frontend): Remove duplicate statement. Tes

[COMMITTED 19/31] ada: Fix crash on aliased constant with packed array type and -g switch

2024-05-21 Thread Marc Poulhiès
From: Eric Botcazou The problem is that we build a template whose array field is not an array in the case of an aliased object with nominal unconstrained array subtype. gcc/ada/ * gcc-interface/decl.cc (gnat_to_gnu_entity) : For an array allocated with its bounds, make sure to h

[COMMITTED 18/31] ada: Fix small inaccuracy for Size attribute applied to objects

2024-05-21 Thread Marc Poulhiès
From: Eric Botcazou This reverts a change made some time ago in lvalue_required_for_attribute_p whereby the Size attribute applied to objects would no longer be considered as requiring an lvalue. While not wrong in principle, this turns out to be problematic because the implementation in Attribu

[COMMITTED 17/31] ada: Fix oversight in previous change

2024-05-21 Thread Marc Poulhiès
From: Eric Botcazou In rare cases, types using structural equality may reach relate_alias_sets. gcc/ada/ * gcc-interface/utils.cc (relate_alias_sets): Restore previous code when the type uses structural equality. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada

[COMMITTED 22/31] ada: Avoid temporary for conditional expression of discriminated record type

2024-05-21 Thread Marc Poulhiès
From: Eric Botcazou This just aligns the definite case (discriminants with default) with the indefinite case (discriminants without default), the latter case having been properly handled for long. In the former case, the maximum size is used so a temporary can be much larger than the actual data

[COMMITTED 24/31] ada: Minor typo fix in comment

2024-05-21 Thread Marc Poulhiès
gcc/ada/ * gcc-interface/decl.cc: Fix typo in comment. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/gcc-interface/decl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc index e16ee6edac

[COMMITTED 27/31] ada: Make detection of useless copy for return more robust

2024-05-21 Thread Marc Poulhiès
From: Eric Botcazou In the return-by-invisible-reference case, the return object of an extended return statement is allocated directly on the return stack and, therefore, the copy operation on return is useless. The code detecting this was not robust enough and missed some complex cases. gcc/ad

[COMMITTED 29/31] ada: Fix internal error on discriminated record with Atomic aspect in Ada 2022

2024-05-21 Thread Marc Poulhiès
From: Eric Botcazou It occurs in build_load_modify_store where the pattern matching logic cannot find the atomic load that is present in the tree because it has been wrapped in a SAVE_EXPR by gnat_protect_expr, which is unnecessary. gcc/ada/ * gcc-interface/utils2.cc (gnat_protect_expr)

[COMMITTED 23/31] ada: Follow-up adjustment to earlier fix in Build_Allocate_Deallocate_Proc

2024-05-21 Thread Marc Poulhiès
From: Eric Botcazou The deallocation call of the return and secondary stacks no longer matches the profile built in Exp_Util.Build_Allocate_Deallocate_Proc, so this just removes the code as unreachable and adds an assertion to that effect. gcc/ada/ * gcc-interface/utils2.cc (build_call_

[COMMITTED 31/31] ada: Streamline implementation of simple nonbinary modular operations

2024-05-21 Thread Marc Poulhiès
From: Eric Botcazou They are implemented by the nonbinary_modular_operation routine, which is complex and, in particular, creates signed types and types with a partial precision each time a subtraction or a multiplication resp. is generated. Both are unnecessary and a simple approach even generat

[COMMITTED 25/31] ada: Fix crash with aliased array and if expression

2024-05-21 Thread Marc Poulhiès
From: Ronan Desplanques The way if expressions were translated led the gimplifying phase to attempt to create a temporary of a variable-sized type in some cases. This patch fixes this by adding an address indirection layer in those cases. gcc/ada/ * gcc-interface/utils2.cc (build_cond_e

[COMMITTED 26/31] ada: Fix strict aliasing violation in parameter passing

2024-05-21 Thread Marc Poulhiès
From: Eric Botcazou This fixes a long-standing (implicit) violation of the strict aliasing rules that occurs when the result of a call to an instance of Unchecked_Conversion is directly passed as an actual parameter in a call to a subprogram and the passing mechanism is by reference. In this cas

[COMMITTED 30/31] ada: Simplify test for propagation of attributes to subtypes

2024-05-21 Thread Marc Poulhiès
From: Eric Botcazou This changes the test to use the Is_Base_Type predicate and also removes the superfluous call to Base_Type before First_Subtype. No functional changes. gcc/ada/ * gcc-interface/decl.cc (gnat_to_gnu_entity): Use the Is_Base_Type predicate and remove superfluo

Re: [Patch] contrib/gcc-changelog/git_update_version.py: Improve diagnostic

2024-05-21 Thread Jakub Jelinek
On Tue, May 21, 2024 at 09:36:05AM +0200, Tobias Burnus wrote: > Jakub Jelinek wrote: > > On Mon, May 20, 2024 at 08:31:02AM +0200, Tobias Burnus wrote: > > > Hmm, there were now two daily bumps: [...] I really wonder why. > > Because I've done it by hand. > > Okay, that explains it. > > I still

Re: [Patch] Fortran: invoke.texi - link to OpenCoarrays.org + mention libcaf_single

2024-05-21 Thread Tobias Burnus
Hi Bernhard, rep.dot@gmail.com wrote: library such as @url{http://opencoarrays.org} needs to be linked. Maybe use https? Works, but as the certificate is not valid, it requires to ignore the errors in a browser, which is a worse user experience. The error is, e.g., "curl: (60) SSL cer

Re: [PATCH v5 1/5] Improve must tail in RTL backend

2024-05-21 Thread Richard Biener
On Mon, May 20, 2024 at 6:53 AM Andi Kleen wrote: > > On Tue, May 14, 2024 at 04:15:08PM +0200, Richard Biener wrote: > > On Sun, May 5, 2024 at 8:16 PM Andi Kleen wrote: > > > > > > - Give error messages for all causes of non sibling call generation > > > - Don't override choices of other non si

RE: [PATCH v2] i386: Disable ix86_expand_vecop_qihi2 when !TARGET_AVX512BW

2024-05-21 Thread Jiang, Haochen
> > diff --git a/gcc/testsuite/gcc.target/i386/pr115069.c > b/gcc/testsuite/gcc.target/i386/pr115069.c > > new file mode 100644 > > index 000..c4b48b602ef > > --- /dev/null > > +++ b/gcc/testsuite/gcc.target/i386/pr115069.c > > @@ -0,0 +1,78 @@ > > +/* { dg-do compile } */ > > +/* { dg-opti

[PATCH] tree-optimization/115149 - VOP live and missing PHIs

2024-05-21 Thread Richard Biener
The following fixes a bug in vop-live get_live_in which was using NULL to indicate the first processed edge but at the same time using it for the case the live-in virtual operand cannot be computed. The following fixes this, avoiding sinking a load to a place where we'd have to insert virtual PHIs

[PATCH v3] i386: Disable ix86_expand_vecop_qihi2 when !TARGET_AVX512BW

2024-05-21 Thread Haochen Jiang
Hi all, This is the v3 patch to fix PR115069. The new testcase has passed. Changes in v3: - Simplify the testcase. Changes in v2: - Add a testcase. - Change the comment for the early exit. Thx, Haochen Since vpermq is really slow, we should avoid using it for permutation when vpmovwb is

[PATCH] Cache the set of EH_RETURN_DATA_REGNOs

2024-05-21 Thread Richard Sandiford
While reviewing Andrew's fix for PR114843, it seemed like it would be convenient to have a HARD_REG_SET of EH_RETURN_DATA_REGNOs. This patch adds one and uses it to simplify a couple of use sites. Tested on aarch64-linux-gnu & x86_64-linux-gnu. OK to install? Richard gcc/ * hard-reg-se

[Ada] Fix PR ada/115168

2024-05-21 Thread Eric Botcazou
Recent changes made to the runtime library broke again its build on Solaris because it uses Solaris threads instead of POSIX threads on this platform. Tested by Rainer, applied on the mainline. 2024-05-21 Eric Botcazou PR ada/115168 * libgnarl/s-taprop__solaris.adb (Initiali

Re: [PATCH] Cache the set of EH_RETURN_DATA_REGNOs

2024-05-21 Thread Richard Biener
On Tue, May 21, 2024 at 11:03 AM Richard Sandiford wrote: > > While reviewing Andrew's fix for PR114843, it seemed like it would > be convenient to have a HARD_REG_SET of EH_RETURN_DATA_REGNOs. > This patch adds one and uses it to simplify a couple of use sites. > > Tested on aarch64-linux-gnu & x

[PATCH] tree-optimization/115137 - more ptr-vs-ptr compare fixes

2024-05-21 Thread Richard Biener
The following fixes the omission of const-pool included in NONLOCAL. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. PR tree-optimization/115137 * tree-ssa-structalias.cc (pt_solution_includes_const_pool): NONLOCAL also includes constant pool entries.

Re: [Patch, aarch64, middle-end] Move pair_fusion pass from aarch64 to middle-end

2024-05-21 Thread Ajit Agarwal
Hello Alex: On 21/05/24 1:16 am, Alex Coplan wrote: > On 20/05/2024 18:44, Alex Coplan wrote: >> Hi Ajit, >> >> On 20/05/2024 21:50, Ajit Agarwal wrote: >>> Hello Alex/Richard: >>> >>> Move pair fusion pass from aarch64-ldp-fusion.cc to middle-end >>> to support multiple targets. >>> >>> Common in

RE: [PATCH v3] Match: Extract ternary_integer_types_match_p helper func [NFC]

2024-05-21 Thread Li, Pan2
> Thanks, looks good to me! You still need approval from a maintainer.. Thanks Tamar, let's wait for a while, 😊! Pan -Original Message- From: Tamar Christina Sent: Tuesday, May 21, 2024 11:19 AM To: Li, Pan2 ; gcc-patches@gcc.gnu.org Cc: juzhe.zh...@rivai.ai; kito.ch...@gmail.com; rich

[PATCH v1 2/2] RISC-V: Add test cases for __builtin_add_overflow branch form unsigned SAT_ADD

2024-05-21 Thread pan2 . li
From: Pan Li After we support __builtin_add_overflow branch form unsigned SAT_ADD from the middle end. Add more tests case to cover the functionarlities. The below test suites are passed. * The rv64gcv fully regression test. gcc/testsuite/ChangeLog: * gcc.target/riscv/sat_arith.h: Ad

[PATCH v1 1/2] Match: Support __builtin_add_overflow branch form for unsigned SAT_ADD

2024-05-21 Thread pan2 . li
From: Pan Li This patch would like to support the __builtin_add_overflow branch form for unsigned SAT_ADD. For example as below: uint64_t sat_add (uint64_t x, uint64_t y) { uint64_t ret; return __builtin_add_overflow (x, y, &ret) ? -1 : ret; } Different to the branchless version, we lever

[PING^2] [PATCH v2] testsuite: Verify r0-r3 are extended with CMSE

2024-05-21 Thread Torbjorn SVENSSON
Gentle ping! Kind regards, Torbjörn On 2024-05-14 13:01, Torbjorn SVENSSON wrote: Hi, I'm not sure if the previous "ok" from Richard on the v1 is enough for this or if there needs another approval. Adding extra maintainers since Richard Earnshaw appears to be busy the past weeks. Kind re

[PATCH] testsuite: Allow for non-SECTION_MERGE systems in gcc.dg/pr115066.c [PR115066]

2024-05-21 Thread Rainer Orth
gcc.dg/pr115066.c currently FAILs on Solaris/SPARC with the native as: FAIL: gcc.dg/pr115066.c scan-assembler .bytet0xbt# Define macro strx Instead of the expected .byte 0xb ! Define macro strx the assembler output contains .byte 0x1 ! Define macro Appa

Re: [PATCH v1 1/2] Match: Support __builtin_add_overflow branch form for unsigned SAT_ADD

2024-05-21 Thread Andrew Pinski
On Tue, May 21, 2024, 3:55 AM wrote: > From: Pan Li > > This patch would like to support the __builtin_add_overflow branch form for > unsigned SAT_ADD. For example as below: > > uint64_t > sat_add (uint64_t x, uint64_t y) > { > uint64_t ret; > return __builtin_add_overflow (x, y, &ret) ? -1

[PATCH] driver: Use -as/ld as final fallback instead of as/ld for cross

2024-05-21 Thread YunQiang Su
If `find_a_program` cannot find `as/ld` and we are a cross toolchain, the final fallback is `as/ld` of system. In fact, we can have a try with -as/ld before fallback to native as/ld. This patch is derivatived from Debian's patch: gcc-search-prefixed-as-ld.diff gcc * gcc.cc(execute): Lo

[C PATCH]: allow aliasing of compatible types derived from enumeral types [PR115157]

2024-05-21 Thread Martin Uecker
For enum and integer we allow aliasing by specifically returning via a langhook the aliasing set of the underlying type. But this is not sufficient for derived types, i.e. pointers to enums and pointers to compatible integers also need to have the same aliasing set. We also allow forward declara

Re: [PATCH] driver: Use -as/ld as final fallback instead of as/ld for cross

2024-05-21 Thread Andrew Pinski
On Tue, May 21, 2024 at 5:12 AM YunQiang Su wrote: > > If `find_a_program` cannot find `as/ld` and we are a cross toolchain, > the final fallback is `as/ld` of system. In fact, we can have a try > with -as/ld before fallback to native as/ld. > > This patch is derivatived from Debian's patch: >

RE: [PATCH v1 1/2] Match: Support __builtin_add_overflow branch form for unsigned SAT_ADD

2024-05-21 Thread Li, Pan2
Thanks Andrew for comments. > I think you need to make sure type and @0's type matches. Oh, yes, we need that, will update in v2. > Also I don't think you need :c here since you don't match @0 nor @1 more than > once. You mean the :c from (IFN_ADD_OVERFLOW:c@2 @0 @1)), right? My initial idea i

Re: [Patch, aarch64, middle-end] Move pair_fusion pass from aarch64 to middle-end

2024-05-21 Thread Alex Coplan
On 21/05/2024 16:02, Ajit Agarwal wrote: > Hello Alex: > > On 21/05/24 1:16 am, Alex Coplan wrote: > > On 20/05/2024 18:44, Alex Coplan wrote: > >> Hi Ajit, > >> > >> On 20/05/2024 21:50, Ajit Agarwal wrote: > >>> Hello Alex/Richard: > >>> > >>> Move pair fusion pass from aarch64-ldp-fusion.cc to

Re: [PATCH v1 1/2] Match: Support __builtin_add_overflow branch form for unsigned SAT_ADD

2024-05-21 Thread Andrew Pinski
On Tue, May 21, 2024 at 5:28 AM Li, Pan2 wrote: > > Thanks Andrew for comments. > > > > > I think you need to make sure type and @0's type matches. > > > > Oh, yes, we need that, will update in v2. > > > > > Also I don't think you need :c here since you don't match @0 nor @1 more > > than once. >

Re: [PATCH] driver: Use -as/ld as final fallback instead of as/ld for cross

2024-05-21 Thread YunQiang Su
Andrew Pinski 于2024年5月21日周二 20:23写道: > > On Tue, May 21, 2024 at 5:12 AM YunQiang Su wrote: > > > > If `find_a_program` cannot find `as/ld` and we are a cross toolchain, > > the final fallback is `as/ld` of system. In fact, we can have a try > > with -as/ld before fallback to native as/ld. > > >

[PATCH 1/4] Avoid requiring VEC_PERM represenatives

2024-05-21 Thread Richard Biener
The following plugs one hole where we require a VEC_PERM node representative unnecessarily. This is for vect_check_store_rhs which looks at the RHS and checks whether a constant can be native encoded. The fix is to guard that with vect_constant_def additionally and making vect_is_simple_use forgi

[PATCH 2/4] Avoid SLP_REPRESENTATIVE access for VEC_PERM in SLP scheduling

2024-05-21 Thread Richard Biener
SLP permute nodes can end up without a SLP_REPRESENTATIVE now, the following avoids touching it in this case in vect_schedule_slp_node. * tree-vect-slp.cc (vect_schedule_slp_node): Avoid looking at SLP_REPRESENTATIVE for VEC_PERM nodes. --- gcc/tree-vect-slp.cc | 28 ++

[PATCH 3/4] Avoid splitting store dataref groups during SLP discovery

2024-05-21 Thread Richard Biener
The following avoids splitting store dataref groups during SLP discovery but instead forces (eventually single-lane) consecutive lane SLP discovery for all lanes of the group, creating VEC_PERM SLP nodes merging them so the store will always cover the whole group. With this for example int x[1024

[PATCH 4/4] Testsuite updates

2024-05-21 Thread Richard Biener
The gcc.dg/vect/slp-12a.c case is interesting as we currently split the 8 store group into lanes 0-5 which we SLP with an unroll factor of two (on x86-64 with SSE) and the remaining two lanes are using interleaving vectorization with a final unroll factor of four. Thus we're using hybrid SLP withi

Re: [PATCH v3] i386: Disable ix86_expand_vecop_qihi2 when !TARGET_AVX512BW

2024-05-21 Thread Uros Bizjak
On Tue, May 21, 2024 at 11:01 AM Haochen Jiang wrote: > > Hi all, > > This is the v3 patch to fix PR115069. The new testcase has passed. > > Changes in v3: > - Simplify the testcase. > > Changes in v2: > - Add a testcase. > - Change the comment for the early exit. > > Thx, > Haochen > > Sinc

Re: [Patch, aarch64, middle-end] Move pair_fusion pass from aarch64 to middle-end

2024-05-21 Thread Alex Coplan
On 20/05/2024 21:50, Ajit Agarwal wrote: > Hello Alex/Richard: > > Move pair fusion pass from aarch64-ldp-fusion.cc to middle-end > to support multiple targets. > > Common infrastructure of load store pair fusion is divided into > target independent and target dependent code. > > Target independ

[PATCH] rs6000: Don't pass -many to the assembler [PR112868]

2024-05-21 Thread jeevitha
Hi All, The following patch has been bootstrapped and regtested with default configuration [--enable-checking=yes] and with --enable-checking=release on powerpc64le-linux. This patch removes passing the -many assembler option for release builds. Now, GCC no longer passes -many under any condit

Re: [PATCH v5 1/5] Improve must tail in RTL backend

2024-05-21 Thread Andi Kleen
> I can't see how this triggers on the IL above, the loop should have > ignored both the return and the clobber and when recursing to > the predecessor stop before the above check when runnig into the > call? Yes, I tracked that down later. The problem was that there were multiple successors to th

RE: [PATCH v1 1/2] Match: Support __builtin_add_overflow branch form for unsigned SAT_ADD

2024-05-21 Thread Li, Pan2
> Since you matching @2 for the realpart rather than `(IFN_ADD_OVERFLOW > @0 @1)` directly the :c is not needed and genmatch will just generate > extra matching code that cannot be not get reached Got it, thanks for explanation. I may need to check the generated matching code for a better underst

Re: [committed] PATCH for Re: Stepping down as maintainer for ARC and Epiphany

2024-05-21 Thread Jeff Law
On 5/21/24 12:05 AM, Richard Biener via Gcc wrote: On Mon, May 20, 2024 at 4:45 PM Gerald Pfeifer wrote: On Wed, 5 Jul 2023, Joern Rennecke wrote: I haven't worked with these targets in years and can't really do sensible maintenance or reviews of patches for them. I am currently working on

Re: [committed] PATCH for Re: Stepping down as maintainer for ARC and Epiphany

2024-05-21 Thread Paul Koning
> On May 21, 2024, at 9:57 AM, Jeff Law wrote: > > > > On 5/21/24 12:05 AM, Richard Biener via Gcc wrote: >> On Mon, May 20, 2024 at 4:45 PM Gerald Pfeifer wrote: >>> >>> On Wed, 5 Jul 2023, Joern Rennecke wrote: I haven't worked with these targets in years and can't really do se

Musttail patchkit v6

2024-05-21 Thread Andi Kleen
I reworked the musttail patchkit to make it work without optimization and also give better error messages and fixed some bugs and increased the test coverage. The no optimization support is not perfect: it cannot handle returning small structures which would need to be allocated to registers first

[PATCH v6 3/8] C++: Support clang compatible [[musttail]] (PR83324)

2024-05-21 Thread Andi Kleen
This patch implements a clang compatible [[musttail]] attribute for returns. musttail is useful as an alternative to computed goto for interpreters. With computed goto the interpreter function usually ends up very big which causes problems with register allocation and other per function optimizati

[PATCH v6 4/8] C: Implement musttail attribute for returns

2024-05-21 Thread Andi Kleen
Implement a C23 clang compatible musttail attribute similar to the earlier C++ implementation in the C parser. PR83324 gcc/c/ChangeLog: * c-parser.cc (struct attr_state): Define with musttail_p. (c_parser_statement_after_labels): Handle [[musttail]] (c_parser_std_

[PATCH v6 1/8] Improve must tail in RTL backend

2024-05-21 Thread Andi Kleen
- Give error messages for all causes of non sibling call generation - When giving error messages clear the musttail flag to avoid ICEs - Error out when tree-tailcall failed to mark a must-tail call sibcall. In this case it doesn't know the true reason and only gives a vague message. PR8332

[PATCH v6 2/8] Add a musttail generic attribute to the c-attribs table

2024-05-21 Thread Andi Kleen
It does nothing currently since statement attributes are handled directly in the parser. gcc/c-family/ChangeLog: * c-attribs.cc (handle_musttail_attribute): Add. * c-common.h (handle_musttail_attribute): Add. --- gcc/c-family/c-attribs.cc | 15 +++ gcc/c-family/c-comm

[PATCH v6 5/8] Add tests for C/C++ musttail attributes

2024-05-21 Thread Andi Kleen
Mostly adopted from the existing C musttail plugin tests. gcc/testsuite/ChangeLog: * c-c++-common/musttail1.c: New test. * c-c++-common/musttail2.c: New test. * c-c++-common/musttail3.c: New test. * c-c++-common/musttail4.c: New test. * c-c++-common/musttai

[PATCH v6 7/8] Give better error messages for musttail

2024-05-21 Thread Andi Kleen
When musttail is set, make tree-tailcall to give error messages when it cannot handle a call. This avoids vague "other reasons" error messages later at expand time. This doesn't always work, for example when find_tail_call walking gives up because the control flow is too complicated then it won't

[PATCH v6 8/8] Add documentation for musttail attribute

2024-05-21 Thread Andi Kleen
gcc/ChangeLog: * doc/extend.texi: Document [[musttail]] --- gcc/doc/extend.texi | 23 +-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index e290265d68d3..f3df7688edf1 100644 --- a/gcc/doc/extend.texi +++ b/gc

[PATCH v6 6/8] Enable musttail tail conversion even when not optimizing

2024-05-21 Thread Andi Kleen
Enable the tailcall optimization for non optimizing builds, but in this case only checks calls that have the musttail attribute set. This makes musttail work without optimization. This is done with a new late musttail pass that is only active when not optimizing. The pass must be after ehcleanup.

Re: [PATCH] RISC-V: Enable vectorization for vect-early-break_124-pr114403.c

2024-05-21 Thread Robin Dapp
The patch is OK from the riscv side. generic-ooo includes fast unaligned access. Regards Robin

Re: [PATCH v3] aarch64: Fix normal returns inside functions which use eh_returns [PR114843]

2024-05-21 Thread Richard Sandiford
Wilco Dijkstra writes: > Hi Andrew, > > A few comments on the implementation, I think it can be simplified a lot: FWIW, I agree with Wilco's comments, except: >> +++ b/gcc/config/aarch64/aarch64.h >> @@ -700,8 +700,9 @@ constexpr auto AARCH64_FL_DEFAULT_ISA_MODE = >> AARCH64_FL_SM_OFF; >> #defi

Re: [Patch, aarch64, middle-end] Move pair_fusion pass from aarch64 to middle-end

2024-05-21 Thread Ajit Agarwal
Hello Alex: On 21/05/24 6:02 pm, Alex Coplan wrote: > On 21/05/2024 16:02, Ajit Agarwal wrote: >> Hello Alex: >> >> On 21/05/24 1:16 am, Alex Coplan wrote: >>> On 20/05/2024 18:44, Alex Coplan wrote: Hi Ajit, On 20/05/2024 21:50, Ajit Agarwal wrote: > Hello Alex/Richard: > >

Re: [Patch, aarch64, middle-end] Move pair_fusion pass from aarch64 to middle-end

2024-05-21 Thread Ajit Agarwal
Hello Alex: On 21/05/24 6:50 pm, Alex Coplan wrote: > On 20/05/2024 21:50, Ajit Agarwal wrote: >> Hello Alex/Richard: >> >> Move pair fusion pass from aarch64-ldp-fusion.cc to middle-end >> to support multiple targets. >> >> Common infrastructure of load store pair fusion is divided into >> target

Re: [RFC][PATCH] PR tree-optimization/109071 - -Warray-bounds false positive warnings due to code duplication from jump threading

2024-05-21 Thread Qing Zhao
Thanks for the comments and suggestions. > On May 15, 2024, at 10:00, David Malcolm wrote: > > On Tue, 2024-05-14 at 15:08 +0200, Richard Biener wrote: >> On Mon, 13 May 2024, Qing Zhao wrote: >> >>> -Warray-bounds is an important option to enable linux kernal to >>> keep >>> the array out-of-b

Re: [PATCH v3 2/2] RISC-V: avoid LUI based const mat in alloca epilogue expansion

2024-05-21 Thread Vineet Gupta
On 5/20/24 20:54, Jeff Law wrote: > On 5/20/24 5:32 PM, Vineet Gupta wrote: >> This is testsuite clean however there's a dwarf quirk which I want to >> run by the experts. The test that was tripping CI has following >> fragment: >> >> Before patch| After Patch >>

Re: [committed] PATCH for Re: Stepping down as maintainer for ARC and Epiphany

2024-05-21 Thread Jeff Law
On 5/21/24 8:02 AM, Paul Koning wrote: On May 21, 2024, at 9:57 AM, Jeff Law wrote: On 5/21/24 12:05 AM, Richard Biener via Gcc wrote: On Mon, May 20, 2024 at 4:45 PM Gerald Pfeifer wrote: On Wed, 5 Jul 2023, Joern Rennecke wrote: I haven't worked with these targets in years and ca

Re: [PATCH v5 1/5] Improve must tail in RTL backend

2024-05-21 Thread Richard Biener
On Tue, May 21, 2024 at 3:35 PM Andi Kleen wrote: > > > I can't see how this triggers on the IL above, the loop should have > > ignored both the return and the clobber and when recursing to > > the predecessor stop before the above check when runnig into the > > call? > > Yes, I tracked that down

Re: [committed] PATCH for Re: Stepping down as maintainer for ARC and Epiphany

2024-05-21 Thread Richard Biener
On Tue, May 21, 2024 at 6:21 PM Jeff Law wrote: > > > > On 5/21/24 8:02 AM, Paul Koning wrote: > > > > > >> On May 21, 2024, at 9:57 AM, Jeff Law wrote: > >> > >> > >> > >> On 5/21/24 12:05 AM, Richard Biener via Gcc wrote: > >>> On Mon, May 20, 2024 at 4:45 PM Gerald Pfeifer wrote: > > >>>

Re: [Patch, aarch64, middle-end] v2: Move pair_fusion pass from aarch64 to middle-end

2024-05-21 Thread Alex Coplan
Hi Ajit, I've left some more comments below. It's getting there now, thanks for your patience. On 21/05/2024 20:32, Ajit Agarwal wrote: > Hello Alex/Richard: > > All comments are addressed. > > Move pair fusion pass from aarch64-ldp-fusion.cc to middle-end > to support multiple targets. > > C

[PATCH] Fix mixed input kind permute optimization

2024-05-21 Thread Richard Biener
When change_vec_perm_layout runs into a permute combining two nodes where one is invariant and one internal the partition of one input can be -1 but the other might not be. The following supports this case by simply ignoring inputs with input partiton -1. I'm not sure this is correct but it avoid

Re: [PATCH v1 2/2] RISC-V: Add test cases for __builtin_add_overflow branch form unsigned SAT_ADD

2024-05-21 Thread Jeff Law
On 5/21/24 4:53 AM, pan2...@intel.com wrote: From: Pan Li After we support __builtin_add_overflow branch form unsigned SAT_ADD from the middle end. Add more tests case to cover the functionarlities. The below test suites are passed. * The rv64gcv fully regression test. gcc/testsuite/Chan

Re: [PATCH v3 1/2] RISC-V: avoid LUI based const mat in prologue/epilogue expansion [PR/105733]

2024-05-21 Thread Jeff Law
On 5/20/24 5:32 PM, Vineet Gupta wrote: Changes since v2: - Broke out the hunk corresponding to alloca in epilogue expansion in a seperate patch. --- If the constant used for stack offset can be expressed as sum of two S12 values, the constant need not be materialized (in a reg) and i

[COMMITTED] RISC-V: avoid LUI based const mat in prologue/epilogue expansion [PR/105733]

2024-05-21 Thread Vineet Gupta
If the constant used for stack offset can be expressed as sum of two S12 values, the constant need not be materialized (in a reg) and instead the two S12 bits can be added to instructions involved with frame pointer. This avoids burning a register and more importantly can often get down to be 2 ins

Re: [PATCH v3 2/2] RISC-V: avoid LUI based const mat in alloca epilogue expansion

2024-05-21 Thread Jeff Law
On 5/20/24 5:32 PM, Vineet Gupta wrote: This is testsuite clean however there's a dwarf quirk which I want to run by the experts. The test that was tripping CI has following fragment: Before patch| After Patch --

Re: [PATCH v1 2/2] RISC-V: Add test cases for branch form unsigned SAT_ADD

2024-05-21 Thread Jeff Law
On 5/20/24 5:01 AM, pan2...@intel.com wrote: From: Pan Li After we support branch form unsigned SAT_ADD from the middle end. Add more tests case to cover the functionarlities. The below test suites are passed. * The rv64gcv fully regression test. gcc/testsuite/ChangeLog: * gcc.ta

[COMMITTED] RISC-V: avoid LUI based const mat in alloca epilogue expansion

2024-05-21 Thread Vineet Gupta
This is continuing on the prev patch in function epilogue expansion. Broken out of easy of review. gcc/ChangeLog: * config/riscv/riscv.cc (riscv_expand_epilogue): Handle offset being sum of two S12. Tested-by: Patrick O'Neill # pre-commit-CI #1569 Signed-off-by: Vineet Gupta ---

Re: [PATCH v5 2/5] C++: Support clang compatible [[musttail]] (PR83324)

2024-05-21 Thread Jason Merrill
On 5/14/24 19:23, Andi Kleen wrote: You need a template testcase; I expect it doesn't work in templates with the current patch. It's probably enough to copy it in tsubst_expr where we currently propagate CALL_EXPR_OPERATOR_SYNTAX. I tried it with the appended test case, everything seems to wor

Re: [PATCH] testsuite: Allow for non-SECTION_MERGE systems in gcc.dg/pr115066.c [PR115066]

2024-05-21 Thread Jason Merrill
On 5/21/24 07:36, Rainer Orth wrote: gcc.dg/pr115066.c currently FAILs on Solaris/SPARC with the native as: FAIL: gcc.dg/pr115066.c scan-assembler .bytet0xbt# Define macro strx Instead of the expected .byte 0xb ! Define macro strx the assembler output contains

Re: [PATCH] c++: folding non-dep enumerator from current inst [PR115139]

2024-05-21 Thread Jason Merrill
On 5/17/24 12:05, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk/14? OK for both. -- >8 -- After the tsubst_copy removal r14-4796-g3e3d73ed5e85e7 GCC 14 ICEs during fold_non_dependent_expr for 'e1 | e2' ultimately because we no longer exit

[PING] [PATCH] Fortran: fix bounds check for assignment, class component [PR86100]

2024-05-21 Thread Harald Anlauf
Am 13.05.24 um 22:27 schrieb Harald Anlauf: Dear all, the attached patch does two things: - it fixes a bogus array bounds check when deep-copying a class component of a derived type and the class component has rank > 1, the reason being that the previous code compared the full size of one

Re: [PATCH] Fix mixed input kind permute optimization

2024-05-21 Thread Richard Sandiford
Richard Biener writes: > When change_vec_perm_layout runs into a permute combining two > nodes where one is invariant and one internal the partition of > one input can be -1 but the other might not be. The following > supports this case by simply ignoring inputs with input partiton -1. > > I'm no

  1   2   >