Re: [PATCH v4] RISC-V: Implement TARGET_CAN_INLINE_P

2024-10-08 Thread Jeff Law
On 10/3/24 9:30 AM, Yangyu Chen wrote: Currently, we lack support for TARGET_CAN_INLINE_P on the RISC-V ISA. As a result, certain functions cannot be optimized with inlining when specific options, such as __attribute__((target("arch=+v"))) . This can lead to potential performance issues when b

Re: [PATCH] Add fancy pointer support in std::map/set

2024-10-08 Thread Jonathan Wakely
On Thu, 1 Aug 2024 at 18:28, François Dumont wrote: > Hi > > Here is a proposal to add fancy pointer support in std::_Rb_tree container. > > As you'll see there are still several usages of > pointer_traits<>::pointer_to. The ones in _M_header_ptr() are > unavoidable. Yes, those are necessary.

Re: [PATCH] Add fancy pointer support in std::map/set

2024-10-08 Thread Jonathan Wakely
On Tue, 8 Oct 2024 at 22:50, Jonathan Wakely wrote: > > > On Thu, 1 Aug 2024 at 18:28, François Dumont wrote: > >> Hi >> >> Here is a proposal to add fancy pointer support in std::_Rb_tree >> container. >> >> As you'll see there are still several usages of >> pointer_traits<>::pointer_to. The on

Re: [PATCH v1 2/4] aarch64: add minimal support for GCS build attributes

2024-10-08 Thread Richard Sandiford
Since this is an RFC, it would probably be more helpful to get review comments about the design or the adherence to the spec. I'll need to look into things a bit more for that, though, so I'm afraid the below is more implementation trivia. Matthieu Longo writes: > [...] > diff --git a/gcc/config

Re: [PATCH v2] RISC-V: Improve vsetvl vconfig alignment

2024-10-08 Thread Jeff Law
On 10/2/24 6:27 AM, Dusan Stojkovic wrote: This patch is a new version of: https://gcc.gnu.org/pipermail/gcc-patches/2024-September/662745.html > Can you elaborate a bit on that?  Rearranging the CFG shouldn't matter >

Re: [PATCH v2] x86/{,V}AES: adjust when to force EVEX encoding

2024-10-08 Thread Hongtao Liu
On Tue, Oct 8, 2024 at 3:00 PM Jan Beulich wrote: > > On 08.10.2024 08:54, Hongtao Liu wrote: > > On Mon, Sep 30, 2024 at 3:33 PM Jan Beulich wrote: > >> > >> Commit a79d13a01f8c ("i386: Fix aes/vaes patterns [PR114576]") correctly > >> said "..., but we need to emit {evex} prefix in the assembly

[PATCH] x86: Implement Fast-Math Float Truncation to BF16 via PSRLD Instruction

2024-10-08 Thread Levy Hsu
Bootstrapped and tested on x86_64-linux-gnu, OK for trunk? gcc/ChangeLog: * config/i386/i386.md: Rewrite insn truncsfbf2. gcc/testsuite/ChangeLog: * gcc.target/i386/truncsfbf-1.c: New test. * gcc.target/i386/truncsfbf-2.c: New test. --- gcc/config/i386/i386.md

Re: [PATCH v2] diagnostics: Fix compile error for MinGW <7.0

2024-10-08 Thread Torbjorn SVENSSON
On 2024-10-08 01:30, Jonathan Yong wrote: On 9/28/24 12:49, Torbjörn SVENSSON wrote: Ok for trunk? Changes since v1: - Updated the commit message to mention the actual build error. - Switch to checking the required define rather than the version number of MinGW. Patch looks OK to me. T

[PATCH] ssa-math-opts, i386: Handle most unordered values rather than just 2 [PR116896]

2024-10-08 Thread Jakub Jelinek
On Mon, Oct 07, 2024 at 10:32:57AM +0200, Richard Biener wrote: > > They are implementation defined, -1, 0, 1, 2 is defined by libstdc++: > > using type = signed char; > > enum class _Ord : type { equivalent = 0, less = -1, greater = 1 }; > > enum class _Ncmp : type { _Unordered = 2 };

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Alejandro Colomar
On Tue, Oct 08, 2024 at 08:45:48AM GMT, Jakub Jelinek wrote: > On Tue, Oct 08, 2024 at 02:09:52AM +0200, Alejandro Colomar wrote: > > On the other hand, should we provide a version of the operator that is > > free from pedantic warnings? A GNU extension? > > No, why? One can always use (__extens

Re: [PR middle-end/114635] Set OMP safelen handling to INT_MAX when the pragma didn’t provide one.

2024-10-08 Thread Richard Biener
On Mon, Aug 5, 2024 at 7:05 AM Kugan Vivekanandarajah wrote: > > > > > On 15 Jul 2024, at 5:18 pm, Jakub Jelinek wrote: > > > > External email: Use caution opening links or attachments > > > > > > On Mon, Jul 15, 2024 at 12:39:22AM +, Kugan Vivekanandarajah wrote: > >> OMP safelen handling is

Re: [PATCH] ssa-math-opts, i386: Handle most unordered values rather than just 2 [PR116896]

2024-10-08 Thread Richard Biener
On Tue, 8 Oct 2024, Jakub Jelinek wrote: > On Mon, Oct 07, 2024 at 10:32:57AM +0200, Richard Biener wrote: > > > They are implementation defined, -1, 0, 1, 2 is defined by libstdc++: > > > using type = signed char; > > > enum class _Ord : type { equivalent = 0, less = -1, greater = 1 }; >

Re: [PATCH] ssa-math-opts, i386: Handle most unordered values rather than just 2 [PR116896]

2024-10-08 Thread Uros Bizjak
On Tue, Oct 8, 2024 at 10:08 AM Jakub Jelinek wrote: > > On Mon, Oct 07, 2024 at 10:32:57AM +0200, Richard Biener wrote: > > > They are implementation defined, -1, 0, 1, 2 is defined by libstdc++: > > > using type = signed char; > > > enum class _Ord : type { equivalent = 0, less = -1, gre

[PATCH] tree-optimization/117000 - elide .REDUC_IOR with compare against zero

2024-10-08 Thread Richard Biener
The following adds a pattern to elide a .REDUC_IOR operation when the result is compared against zero with a cbranch. I've resorted to using can_compare_p since that's what RTL expansion eventually checks - while GIMPLE allowed whole vector equality compares for long I'll notice vector lowering wo

[PATCH v2 2/2] Adjust testcase after relax O2 vectorization.

2024-10-08 Thread liuhongt
gcc/testsuite/ChangeLog: * gcc.dg/fstack-protector-strong.c: Adjust scan-assembler-times. * gcc.dg/graphite/scop-6.c: Add -Wno-aggressive-loop-optimizations. * gcc.dg/graphite/scop-9.c: Ditto. * gcc.dg/tree-ssa/ivopts-lt-2.c: Add -fno-tree-vectorize.

[PATCH v1 4/4] RISC-V: Add testcases for form 1 of scalar signed SAT_TRUNC

2024-10-08 Thread pan2 . li
From: Pan Li Form 1: #define DEF_SAT_S_TRUNC_FMT_1(WT, NT, NT_MIN, NT_MAX) \ NT __attribute__((noinline)) \ sat_s_trunc_##WT##_to_##NT##_fmt_1 (WT x) \ { \ NT trunc = (NT)x;

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Alejandro Colomar
Hi Jakub, On Tue, Oct 08, 2024 at 10:25:24AM GMT, Jakub Łukasiewicz wrote: > I think it would be beneficial to have different syntax/spelling for > features still in development. That way we, as a committee, can tweak it as > we please, while mitigating effect on early adopters. > > If what ends

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Jakub Łukasiewicz
I think it would be beneficial to have different syntax/spelling for features still in development. That way we, as a committee, can tweak it as we please, while mitigating effect on early adopters. If what ends in final document is exactly the same as in early phrases, then great, all users a

[PATCH v1 3/4] RISC-V: Implement scalar SAT_TRUNC for signed integer

2024-10-08 Thread pan2 . li
From: Pan Li This patch would like to implement the sstrunc for scalar signed integer. Form 1: #define DEF_SAT_S_TRUNC_FMT_1(WT, NT, NT_MIN, NT_MAX) \ NT __attribute__((noinline)) \ sat_s_trunc_##WT##_to_##NT##_fmt_1 (WT x) \ {

[PATCH v1 1/4] Match: Support form 1 for scalar signed integer SAT_TRUNC

2024-10-08 Thread pan2 . li
From: Pan Li This patch would like to support the form 1 of the scalar signed integer SAT_TRUNC. Aka below example: Form 1: #define DEF_SAT_S_TRUNC_FMT_1(NT, WT, NT_MIN, NT_MAX) \ NT __attribute__((noinline)) \ sat_s_trunc_##WT##_to_##NT##_fmt_1 (WT x)

[PATCH v1 2/4] Widening-Mul: Fix one bug of consume after phi node released

2024-10-08 Thread pan2 . li
From: Pan Li When try to matching saturation related pattern on PHI node, we may have to try each pattern for all phi node of bb. Aka: for each PHI node in bb: gphi *phi = xxx; try_match_sat_add (, phi); try_match_sat_sub (, phi); try_match_sat_trunc (, phi); The PHI node will be remov

Re: [PATCH] [PR116831] match.pd: Check trunc_mod vector obtap before folding.

2024-10-08 Thread Richard Biener
On Fri, 4 Oct 2024, Jennifer Schmitz wrote: > As in https://gcc.gnu.org/pipermail/gcc-patches/2024-September/663185.html, > this patch guards the simplification x / y * y == x -> x % y == 0 in > match.pd for vector types by a check for: > 1) Support of the mod optab for vectors OR > 2) Application

[PATCH v2 1/2] Enable vectorization for unknown tripcount in very cheap cost model but disable epilog vectorization.

2024-10-08 Thread liuhongt
>So should we adjust very-cheap to allow niter peeling as proposed or >should we switch the default at -O2 to cheap? I prefer the former. Update in V2: Adjust testcase after relax O2 vectorization. Ok for trunk? gcc/ChangeLog: * tree-vect-loop.cc (vect_analyze_loop_costing): Enable

Re: [RFC/RFA] [PATCH v4 01/12] Implement internal functions for efficient CRC computation

2024-10-08 Thread Jeff Law
On 10/8/24 4:52 AM, Mariam Arutunian wrote: On Sun, Sep 29, 2024 at 9:08 PM Jeff Law > wrote: On 9/13/24 5:05 AM, Mariam Arutunian wrote: > Add two new internal functions (IFN_CRC, IFN_CRC_REV), to provide faster > CRC generation. > On

[PATCH v1 2/2] RISC-V: Add testcases for form 2 of scalar signed SAT_TRUNC

2024-10-08 Thread pan2 . li
From: Pan Li Form 2: #define DEF_SAT_S_TRUNC_FMT_2(NT, WT, NT_MIN, NT_MAX) \ NT __attribute__((noinline)) \ sat_s_trunc_##WT##_to_##NT##_fmt_2 (WT x) \ { \ NT trunc = (NT)x;

[PATCH v1 1/2] Match: Support form 2 for scalar signed integer SAT_TRUNC

2024-10-08 Thread pan2 . li
From: Pan Li This patch would like to support the form 2 of the scalar signed integer SAT_TRUNC. Aka below example: Form 2: #define DEF_SAT_S_TRUNC_FMT_2(NT, WT, NT_MIN, NT_MAX) \ NT __attribute__((noinline)) \ sat_s_trunc_##WT##_to_##NT##_fmt_2 (WT x)

Re: [PATCH] Add fancy pointer support in std::map/set

2024-10-08 Thread Jonathan Wakely
On Tue, 8 Oct 2024 at 22:50, Jonathan Wakely wrote: > > > On Thu, 1 Aug 2024 at 18:28, François Dumont wrote: > >> Hi >> >> Here is a proposal to add fancy pointer support in std::_Rb_tree >> container. >> >> As you'll see there are still several usages of >> pointer_traits<>::pointer_to. The on

RE: [PATCH]middle-end: support SLP early break

2024-10-08 Thread Tamar Christina
> -Original Message- > From: Richard Biener > Sent: Wednesday, October 2, 2024 1:50 PM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; nd ; j...@ventanamicro.com > Subject: Re: [PATCH]middle-end: support SLP early break > > On Tue, 1 Oct 2024, Tamar Christina wrote: > > > Hi all, >

[PATCH] Don't lower vpcmpu to pcmpgt since the latter is for signed comparison.

2024-10-08 Thread liuhongt
r15-1737-gb06a108f0fbffe lower AVX512 kmask comparison to AVX2 ones, but wrong lowered unsigned comparison to signed ones, for unsigned comparison, only EQ/NEQ can be lowered. The commit fix that. Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. Ready push to trunk. gcc/ChangeLog:

[PATCH v3 2/2] Adjust testcase after relax O2 vectorization.

2024-10-08 Thread liuhongt
Update in V3. >The testcase looks bogus: > > b[i+k] = b[i+k-5] + 2; > >accesses b[-3], can you instead adjust the inner loop to start with k == 4? Changed, also adjust b[100] to b[200] to avoid array out of bound. >Please remove this testcase - even with fully masking we'd need alias >versi

[PATCH v3 1/2] Enable vectorization for unknown tripcount in very cheap cost model but disable epilog vectorization.

2024-10-08 Thread liuhongt
>We'd also need to update the documentation: >... The @samp{very-cheap} model only >allows vectorization if the vector code would entirely replace the >scalar code that is being vectorized. For example, if each iteration >of a vectorized loop would only be able to handle exactly four iterations >

Re: [PATCH v1 3/4] aarch64: improve assembly debug comments for build attributes

2024-10-08 Thread Richard Sandiford
Matthieu Longo writes: > The previous implementation to emit build attributes did not support > string values (asciz) in aeabi_subsection, and was not emitting values > associated to tags in the assembly comments. > > This new approach provides a more user-friendly interface relying on > typing, a

Re: [PATCH] c: Speed up compilation of large char array initializers when not using #embed

2024-10-08 Thread Joseph Myers
On Sat, 3 Aug 2024, Jakub Jelinek wrote: > * c-c++-common/init-1.c: New test. I think there should also be tests of initializing signed char (and plain char) arrays; I don't see any such tests here. -- Joseph S. Myers josmy...@redhat.com

Re: [PATCH v5] gcc, libcpp: Add warning switch for "#pragma once in main file" [PR89808]

2024-10-08 Thread Ken Matsui
On Tuesday, October 8th, 2024 at 11:21 AM, Marek Polacek wrote: > > > On Mon, Oct 07, 2024 at 11:16:20PM +, Ken Matsui wrote: > > > On Monday, October 7th, 2024 at 4:41 PM, Marek Polacek pola...@redhat.com > > wrote: > > > > > On Sat, Jun 15, 2024 at 10:30:35PM -0700, Ken Matsui wrote

Re: [PATCH] RISC-V: Add implication for M extension.

2024-10-08 Thread Jeff Law
On 10/7/24 11:33 PM, Tsung Chun Lin wrote: That M implies Zmmul. gcc/ChangeLog: * common/config/riscv/riscv-common.cc: M implies Zmmul. THanks. I've pushed this to the trunk. jeff ps. Quite a discussion on this topic in the zmmul public discussion from a couple years ago. But

Re: [PATCH] RISC-V: Enable builtin __riscv_mul with Zmmul extension.

2024-10-08 Thread Jeff Law
On 10/8/24 12:25 AM, Tsung Chun Lin wrote: From d5b254e19d1f37fe27c7e98a0160e5c22446cfea Mon Sep 17 00:00:00 2001 From: Jim Lin Date: Tue, 8 Oct 2024 13:14:32 +0800 Subject: [PATCH] RISC-V: Enable builtin __riscv_mul with Zmmul extension. gcc/ChangeLog: * config/riscv/riscv-c.cc:

Re: [PATCH v4 1/4] tree-optimization/116024 - simplify C1-X cmp C2 for UB-on-overflow types

2024-10-08 Thread Jeff Law
On 9/30/24 2:04 AM, Artemiy Volkov wrote: Implement a match.pd pattern for C1 - X cmp C2, where C1 and C2 are integer constants and X is of a UB-on-overflow type. The pattern is simplified to X rcmp C1 - C2 by moving X and C2 to the other side of the comparison (with opposite signs). If C1 -

Re: [PATCH v4 2/4] tree-optimization/116024 - simplify C1-X cmp C2 for unsigned types

2024-10-08 Thread Jeff Law
On 9/30/24 2:04 AM, Artemiy Volkov wrote: Implement a match.pd transformation inverting the sign of X in C1 - X cmp C2, where C1 and C2 are integer constants and X is of an unsigned type, by observing that: (a) If cmp is == or !=, simply move X and C2 to opposite sides of the comparison to ar

Re: [PATCH v4 3/4] tree-optimization/116024 - simplify C1-X cmp C2 for wrapping signed types

2024-10-08 Thread Jeff Law
On 9/30/24 2:04 AM, Artemiy Volkov wrote: Implement a match.pd transformation inverting the sign of X in C1 - X cmp C2, where C1 and C2 are integer constants and X is of a wrapping signed type, by observing that: (a) If cmp is == or !=, simply move X and C2 to opposite sides of the comparison

Re: [PATCH v4 4/4] tree-optimization/116024 - simplify some cases of X +- C1 cmp C2

2024-10-08 Thread Jeff Law
On 9/30/24 2:04 AM, Artemiy Volkov wrote: Whenever C1 and C2 are integer constants, X is of a wrapping type, and cmp is a relational operator, the expression X +- C1 cmp C2 can be simplified in the following cases: (a) If cmp is <= and C2 -+ C1 == +INF(1), we can transform the initial compari

Re: [PATCH v5] gcc, libcpp: Add warning switch for "#pragma once in main file" [PR89808]

2024-10-08 Thread Andreas Schwab
../../libcpp/directives.cc: In function 'void do_pragma_once(cpp_reader*)': ../../libcpp/directives.cc:2078:20: error: unknown conversion type character '<' in format [-Werror=format=] 2078 | "%<#pragma once%> in main file"); |^ ../../libcpp/directives.c

[r15-4186 Regression] FAIL: gcc.dg/pr67089-6.c scan-tree-dump-times widening_mul "SUB_OVERFLOW" 9 on Linux/x86_64

2024-10-08 Thread haochen.jiang
On Linux/x86_64, 0883c88664d48463dfc79335dccaf15a69230952 is the first bad commit commit 0883c88664d48463dfc79335dccaf15a69230952 Author: Artemiy Volkov Date: Tue Oct 8 17:51:08 2024 -0600 tree-optimization/116024 - simplify C1-X cmp C2 for UB-on-overflow types caused FAIL: gcc.dg/pr6708

Re: [PATCH] libgcc: Use inline variable instead of function-local static

2024-10-08 Thread Michael Matz
Hello, On Tue, 8 Oct 2024, Jonathan Wakely wrote: > We originally had global static variables, which means a different > variable per TU. That causes ODR violations which were silently > ignored until we try to use them in modules, where they're diagnosed. > So we need to replace them. Aren't th

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Joseph Myers
On Tue, 8 Oct 2024, Alejandro Colomar wrote: > > I have plenty of concerns with > > both the wording and incompatibility of various changes suggested there > > related to what's allowed as a sizeof operand and associated semantics but > > I don't think there were any concerns in that discussion

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Chris Bazley
> ​Because I don't like the paper that has been voted into the standard. > I kind of presented that paper against my will. I wish GCC merged the > feature with a different name, and forced the standard to reconsider > what they merged, which I consider to be a security problem. > > Alternatively,

[COMMITTED 05/32] ada: Add System definitions of SIGSYS for Android

2024-10-08 Thread Marc Poulhiès
From: Olivier Hainque This allows reusing a-intnam__linux.ads for Android. gcc/ada/ChangeLog: * libgnarl/s-linux__android-arm.ads: Define SIGSYS. * libgnarl/s-linux__android-aarch64.ads: Define SIGSYS. * libgnarl/s-osinte__android.ads: Expose SIGSYS value. Tested on x86

[COMMITTED 11/32] ada: Missing constraint check for 'Length attribute reference

2024-10-08 Thread Marc Poulhiès
From: Steve Baird In some cases involving a universal-integer-valued attribute reference (typically a 'Length attribute reference) occurring as an actual parameter in a call, the runtime check that the constraints of the formal parameter are satisfied is incorrectly not performed. gcc/ada/Change

[COMMITTED 06/32] ada: Use a-nallfl__wraplf.ads for Android

2024-10-08 Thread Marc Poulhiès
From: Olivier Hainque This is the most common definition. Otherwise, from the default: a-nallfl.ads:51:13: ... intrinsic binding type mismatch on result a-nallfl.ads:51:13: ... intrinsic binding type mismatch on parameter 1 a-nallfl.ads:51:13: ... profile of "Sin" doesn't match the builtin it bi

[COMMITTED 03/32] ada: Account for aarch64 in init.c section for Android

2024-10-08 Thread Marc Poulhiès
From: Olivier Hainque Unlike the ARM port already there, aarch64 is dwarf CFI based for unwinding and Android-Linux exposes kernel CFI for signal handlers. gcc/ada/ChangeLog: * init.c (__gnat_error_handler): Map signals straight to Ada exceptions, without a local CFI trampoline.

[COMMITTED 02/32] ada: Extend arm-android section of Makefile.rtl to aarch64

2024-10-08 Thread Marc Poulhiès
From: Olivier Hainque gcc/ada/ChangeLog: * Makefile.rtl: Extend arm-android section to aarch64, in a similar fashion as other arm/arch64 configurations. Introduce pair selection guards to prevent match of aarch64-linux-android on the regular aarch64-linux% cross a

[COMMITTED 01/32] ada: sem_prag.adb: ignore compile_time_{warning, error} in CodePeer mode

2024-10-08 Thread Marc Poulhiès
From: Ghjuvan Lacambre GNAT sometimes needs help from the GCC back-end in order to check whether Compile_Time_{Warning,Error} are true. As CodePeer does not have access to a GCC back-end, it is unable to perform these checks. Thus we need to remove said pragmas from the tree. gcc/ada/ChangeLog:

[COMMITTED 19/32] ada: Add Is_Rep_To_Pos predicate and export it for use in gigi

2024-10-08 Thread Marc Poulhiès
From: Eric Botcazou This is modeled on the existing Is_Init_Proc predicate. gcc/ada/ChangeLog: * exp_tss.ads (Is_Rep_To_Pos): New function declaration. * exp_tss.adb (Is_Rep_To_Pos): New function body. * fe.h (Is_Rep_To_Pos): New macro and extern declaration. Tested on x

[COMMITTED 13/32] ada: Print the load address in symbolic backtraces

2024-10-08 Thread Marc Poulhiès
From: Eric Botcazou The load address of PIE executables is printed in non-symbolic backtraces (-E binder switch) but it makes sense to print it in symbolic backtraces (-Es binder switch) too, because symbolic backtraces may degenerate into non-symbolic ones when the executable is stripped for exa

[COMMITTED 14/32] ada: Early freezeing of types with 'Size'Class

2024-10-08 Thread Marc Poulhiès
From: squirek This patch fixes an issue in the compiler whereby declarations of derived types whose parent is a mutably tagged type cause early freezing of the parent type - leading to spurious compile-time errors. gcc/ada/ChangeLog: * sem_ch3.adb (Derived_Type_Declaration): Modify gener

[COMMITTED 04/32] ada: Rework s-linux/osinte for arm/aarch64-android sigactions

2024-10-08 Thread Marc Poulhiès
From: Olivier Hainque Building an aarch64-android compiler with the current sources initially intended for arm-android expectedly trips on problems. This change is meant to address: ``` .../gcc/ada/rts % ../../gnat1 -quiet ... a-stbufi.adb -I. s-osinte.ads:591:07: error: component "sa_flags" ov

[COMMITTED 08/32] ada: sem_prag.adb: fix indentation

2024-10-08 Thread Marc Poulhiès
From: Ghjuvan Lacambre The indentation was wrong on these two lines. gcc/ada/ChangeLog: * sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Fix indentation. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_prag.adb | 4 ++-- 1 file changed, 2 insertions(

[COMMITTED 07/32] ada: Add External_Initialization extension

2024-10-08 Thread Marc Poulhiès
From: Ronan Desplanques This patch introduces a GNAT extension that adds a new aspect, External_Initialization. A section is added to the reference manual with a description of what the aspect does. The implementation reuses existing mechanisms, in particular Sinput.L.Load_Source_File and Sem_Re

[COMMITTED 15/32] ada: Improved support for incomplete parameter types

2024-10-08 Thread Marc Poulhiès
From: Steve Baird Fix two bugs uncovered by a recent ACATS test C3A1005: a freezing problem and a case where a user-defined equality function for an incomplete type was incorrectly hidden from use-clause visibility by the "corresponding" predefined op (which doesn't actually exist). gcc/ada/Chan

[COMMITTED 16/32] ada: Fix reproducer generation with child subprograms

2024-10-08 Thread Marc Poulhiès
From: Ronan Desplanques This patch fixes a corner case that was not handled correctly by Generate_Minimal_Reproducer. gcc/ada/ChangeLog: * generate_minimal_reproducer.adb (Generate_Minimal_Reproducer): Fix behavior on child subprograms without specs. Tested on x86_64-pc-linux-gn

[COMMITTED 17/32] ada: Use semantics from the RFC for declarative items mixed with statements

2024-10-08 Thread Marc Poulhiès
From: Raphaël AMIARD We want to allow statements lists with declarations *and* an exception handler. What follows from this is that declarations declared in the statement list are *not* visible from the exception handler, and that the following code: declare A : Integer := 12; be

[COMMITTED 10/32] ada: Add adareducer integration to ICE handling

2024-10-08 Thread Marc Poulhiès
From: Ronan Desplanques This patch adds a way to have the adareducer tool run on a appropriate set of files when GNAT crashes. This feature is behind the -gnatd_m debugging switch. gcc/ada/ChangeLog: * comperr.adb (Compiler_Abort): Add call to Generate_Minimal_Reproducer and repl

[COMMITTED 12/32] ada: Legal access discriminant default expression incorrectly rejected

2024-10-08 Thread Marc Poulhiès
From: Steve Baird If a limited private partial view of a type has an access discriminant with a default expression, and if the type (perhaps tagged, perhaps not) is completed by deriving from an immutably limited type, then the default discriminant expression should not be rejected. gcc/ada/Chan

[COMMITTED 09/32] ada: Fix wrong finalization of anonymous array aggregate

2024-10-08 Thread Marc Poulhiès
From: Eric Botcazou The issue arises when the aggregate consists only of iterated associations because, in this case, its expansion uses a 2-pass mechanism which creates a temporary that needs a fully-fledged initialization, thus running afoul of the optimization that avoids building the initiali

[COMMITTED 25/32] ada: Reject mixed container aggregates

2024-10-08 Thread Marc Poulhiès
From: Viljar Indus A container aggregate can either be empty, contain only positional elements or named element associations. Reject the scenario where the latter two are both used. gcc/ada/ChangeLog: * diagnostics-constructors.adb (Make_Mixed_Container_Aggregate_Error): New func

[COMMITTED 18/32] ada: Avoid dependency on Long_Long_Long_Integer and System.Img_LLLI for 'Image

2024-10-08 Thread Marc Poulhiès
From: Eric Botcazou When the Image attribute is applied directly to another attribute returning Universal_Integer, for example Enum_Rep, it is converted to the equivalent of Universal_Integer'Image, which is implemented by Long_Long_Long_Integer and thus triggers a dependency on System.Img_LLLI,

[COMMITTED 20/32] ada: Use corect capacity with two dimensional arrays

2024-10-08 Thread Marc Poulhiès
From: Viljar Indus Previously when a bounded list was initialized with an array aggregate then we used the correct size only if the array was one dimensional. This patch adds support for deriving the size for multidimensional array types as well. gcc/ada/ChangeLog: * exp_aggr.adb (Build_

[COMMITTED 24/32] ada: Add mechanism to test internal error machinery

2024-10-08 Thread Marc Poulhiès
From: Ronan Desplanques This patch adds a pragma that triggers an internal compiler error when analyzed. It is not externally documented and makes it possible to test the code that runs when the compiler encounters an internal error. gcc/ada/ChangeLog: * snames.ads-tmpl: Add new pragma d

[COMMITTED 21/32] ada: Add dependency lines for External_Initialization

2024-10-08 Thread Marc Poulhiès
From: Ronan Desplanques When a file included through External_Initialization has been modified, the unit including it must be recompiled. This patch adds the generation of dependency lines to the handling of the External_Initialization aspect, to signal that fact to gnatmake and other tools that

[COMMITTED 32/32] ada: Fix infinite loop on MSP430 with -mlarge flag

2024-10-08 Thread Marc Poulhiès
From: Eric Botcazou This removes the loop trying to find a pointer mode among the integer modes, which is obsolete and does not work on platforms where pointers have unusual size like MSP430 or special semantics like Morello. gcc/ada/ChangeLog: PR ada/116498 * gcc-interface/decl.

[COMMITTED 23/32] ada: Tweak position of comment

2024-10-08 Thread Marc Poulhiès
From: Ronan Desplanques This patch puts a comment explaining the absence of Storage_Size in an alphabetically sorted list at the spot where Storage_Size would be in that list. gcc/ada/ChangeLog: * snames.ads-tmpl: Tweak position of comment. Tested on x86_64-pc-linux-gnu, committed on ma

Re: [PATCH] [PR86710][PR116826] match.pd: Fold logarithmic identities.

2024-10-08 Thread Richard Biener
On Thu, 3 Oct 2024, Jennifer Schmitz wrote: > > > > On 1 Oct 2024, at 14:27, Richard Biener wrote: > > > > External email: Use caution opening links or attachments > > > > > > On Tue, 1 Oct 2024, Jennifer Schmitz wrote: > > > >> This patch implements 4 rules for logarithmic identities in ma

[COMMITTED 28/32] ada: Fix bogus error in instantiation with formal package

2024-10-08 Thread Marc Poulhiès
From: Eric Botcazou The compiler reports that an actual does not match the formal when there is a defaulted formal discrete type because Check_Formal_Package_Instance fails to skip the implicit base type generated by the compiler. gcc/ada/ChangeLog: PR ada/114636 * sem_ch12.adb (

[COMMITTED 27/32] ada: Fix negative value returned by 'Image for array with nonnegative component

2024-10-08 Thread Marc Poulhiès
From: Eric Botcazou The problem is that Exp_Put_Image.Build_Elementary_Put_Image_Call uses the signedness of the base type but the size of the first subtype, hence the discrepancy between them. gcc/ada/ChangeLog: PR ada/115535 * exp_put_image.adb (Build_Elementary_Put_Image_Call)

[PATCH 2/2] [x86] Add a new tune avx256_avoid_vec_perm for SRF.

2024-10-08 Thread liuhongt
According to Intel SOM[1], For Crestmont, most 256-bit Intel AVX2 instructions can be decomposed into two independent 128-bit micro-operations, except for a subset of Intel AVX2 instructions, known as cross-lane operations, can only compute the result for an element by utilizing one or more source

Re: [PATCH v2 1/2] Enable vectorization for unknown tripcount in very cheap cost model but disable epilog vectorization.

2024-10-08 Thread Richard Biener
On Tue, Oct 8, 2024 at 10:36 AM liuhongt wrote: > > >So should we adjust very-cheap to allow niter peeling as proposed or > >should we switch the default at -O2 to cheap? > I prefer the former. > > Update in V2: > Adjust testcase after relax O2 vectorization. > > Ok for trunk? OK. Thanks, Richar

[PATCH 0/2] Enable more SRF tuning

2024-10-08 Thread liuhongt
The series add 2 tune for SRF/CWF according to Intel SOE Crestmont microarchitecture. 1) Generate vpandn + vpand + vpor instead of vblendvps/vblendvpd/vpblendvb instruction since 4-operand vex instruction comes from MSROM on Crestmont, and it's slower than 3-instruction sequence. 2) Don't do 256-

[COMMITTED 22/32] ada: Remove references to internal gnat RFC's

2024-10-08 Thread Marc Poulhiès
From: Tonu Naks gcc/ada/ChangeLog: * doc/gnat_rm/gnat_language_extensions.rst: replace references to RFC's with appropriate text from the rfc * gnat_rm.texi: Regenerate. * gnat_ugn.texi: Regenerate. Tested on x86_64-pc-linux-gnu, committed on master. --- .../doc

[PATCH 1/2] [x86] Add new microarchitecture tune for SRF/GRR/CWF.

2024-10-08 Thread liuhongt
For Crestmont, 4-operand vex blendv instructions come from MSROM and is slower than 3-instructions sequence (op1 & mask) | (op2 & ~mask). legacy blendv instruction can still be handled by the decoder. The patch add a new tune which is enabled for all processors except for SRF/CWF. It will use vpan

[COMMITTED 26/32] ada: Fix internal error on elsif part of if-statement containing if-expression

2024-10-08 Thread Marc Poulhiès
From: Eric Botcazou The problem occurs when the compiler is trying to find a context to which it can hoist finalization actions coming from the if-expression, because Find_Hook_Context incorrectly returns the N_Elsif_Part node. gcc/ada/ChangeLog: PR ada/114640 * exp_util.adb (Fin

[COMMITTED 29/32] ada: Fix bogus Constraint_Error for 'Wide_Wide_Value on wide enumeration literal

2024-10-08 Thread Marc Poulhiès
From: Eric Botcazou The problem is that 'Wide_Wide_Value is piggybacked on 'Value and the latter invokes System.Val_Util.Normalize_String, which incorrectly normalizes the input string in the presence of enumeration literals with wide characters. gcc/ada/ChangeLog: PR ada/115507

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Jakub Jelinek
On Tue, Oct 08, 2024 at 03:28:29PM +0200, Alejandro Colomar wrote: > On Tue, Oct 08, 2024 at 01:19:06PM GMT, Joseph Myers wrote: > > On Tue, 8 Oct 2024, Alejandro Colomar wrote: > > > > > On Mon, Oct 07, 2024 at 05:35:16PM GMT, Joseph Myers wrote: > > > > Patches 1, 2 and 3 are logically nothing t

Re: [PATCH 2/8] aarch64: Add new +fcma flag

2024-10-08 Thread Richard Sandiford
Andrew Carlotti writes: > This includes +fcma as a dependency of +sve, and means that we can > finally support fcma intrinsics on a64fx. > > Also add fcma to the Features list in several cpunative testcases that > incorrectly included sve without fcma. > > gcc/ChangeLog: > > * config/aarch64

[COMMITTED 31/32] ada: Remove -gnateE information message for noncontiguous enumeration type

2024-10-08 Thread Marc Poulhiès
From: Eric Botcazou It is very confusing for the user because it does not make any reference to the source code but only to details of the underlying implementation. gcc/ada/ChangeLog: * gcc-interface/trans.cc (Raise_Error_to_gnu) : Do not the generate range information if the va

[COMMITTED 30/32] ada: Rework the Android sigtramp implementation

2024-10-08 Thread Marc Poulhiès
From: Olivier Hainque The initial signal handling code introduced for aarch64-android overlooked details of the tasking runtime, not in the initial testing perimeter. Specifically, a reference to __gnat_sigtramp from __gnat_error_handler, initially introduced for the arm port, was prevented if !

Re: [PATCH v2 2/2] Adjust testcase after relax O2 vectorization.

2024-10-08 Thread Richard Biener
On Tue, Oct 8, 2024 at 10:36 AM liuhongt wrote: > > gcc/testsuite/ChangeLog: > > * gcc.dg/fstack-protector-strong.c: Adjust > scan-assembler-times. > * gcc.dg/graphite/scop-6.c: Add > -Wno-aggressive-loop-optimizations. > * gcc.dg/graphite/scop-9.c: Ditto. >

Re: [PATCH] libgcc: Use inline variable instead of function-local static

2024-10-08 Thread Jonathan Wakely
On Tue, 8 Oct 2024 at 13:59, Michael Matz wrote: > > Hello, > > On Tue, 8 Oct 2024, Jonathan Wakely wrote: > > > We originally had global static variables, which means a different > > variable per TU. That causes ODR violations which were silently > > ignored until we try to use them in modules, w

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Alejandro Colomar
On Tue, Oct 08, 2024 at 03:40:53PM GMT, Jakub Jelinek wrote: > On Tue, Oct 08, 2024 at 03:28:29PM +0200, Alejandro Colomar wrote: > > On Tue, Oct 08, 2024 at 01:19:06PM GMT, Joseph Myers wrote: > > > On Tue, 8 Oct 2024, Alejandro Colomar wrote: > > > > > > > On Mon, Oct 07, 2024 at 05:35:16PM GMT,

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Alejandro Colomar
Hi Joseph, On Tue, Oct 08, 2024 at 02:04:12PM GMT, Joseph Myers wrote: > On Tue, 8 Oct 2024, Alejandro Colomar wrote: > > > If you wish to wait for Graz to make sure there's no incompatibility > > with ISO, that's another possibility. > > The name could be changed in GCC after Graz (while in >

Re: [PATCH v1 2/4] Widening-Mul: Fix one bug of consume after phi node released

2024-10-08 Thread Richard Biener
On Tue, Oct 8, 2024 at 10:34 AM wrote: > > From: Pan Li > > When try to matching saturation related pattern on PHI node, we may have > to try each pattern for all phi node of bb. Aka: > > for each PHI node in bb: > gphi *phi = xxx; > try_match_sat_add (, phi); > try_match_sat_sub (, phi);

[PATCH] libgcc: Use inline variable instead of function-local static

2024-10-08 Thread Nathaniel Shead
On Tue, Oct 01, 2024 at 12:36:21PM +0200, Jakub Jelinek wrote: > On Tue, Oct 01, 2024 at 11:10:03AM +0100, Jonathan Wakely wrote: > > Let's use an inline variable. A function-local static requires > > __cxa_guard_acquire, which (for some targets, including the ones > > affected by this change) uses

Re: [PATCH] libgcc: Use inline variable instead of function-local static

2024-10-08 Thread Jonathan Wakely
On Tue, 8 Oct 2024 at 10:28, Jakub Jelinek wrote: > > On Tue, Oct 08, 2024 at 08:18:56PM +1100, Nathaniel Shead wrote: > > On Tue, Oct 01, 2024 at 12:36:21PM +0200, Jakub Jelinek wrote: > > > On Tue, Oct 01, 2024 at 11:10:03AM +0100, Jonathan Wakely wrote: > > > > Let's use an inline variable. A f

Re: [PATCH v3 1/2] aarch64: Add SVE2 faminmax intrinsics

2024-10-08 Thread Saurabh Jha
Thanks for the review. Wanted to clarify your comment: On 10/8/2024 11:51 AM, Richard Sandiford wrote: writes: diff --git a/gcc/testsuite/gcc.target/aarch64/sve2/acle/asm/amax_f16.c b/gcc/testsuite/gcc.target/aarch64/sve2/acle/asm/amax_f16.c new file mode 100644 index 000..de4a6f8efaa

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Joseph Myers
On Tue, 8 Oct 2024, Alejandro Colomar wrote: > If you wish to wait for Graz to make sure there's no incompatibility > with ISO, that's another possibility. The name could be changed in GCC after Graz (while in regression-fixes-only mode for GCC 15) if WG14 changes the name in Graz. It wouldn't

[Patch] Fortran/OpenMP: Fix __builtin_omp_is_initial_device

2024-10-08 Thread Tobias Burnus
Patches gfc_conv_procedure_call (+ called functions). Found via OpenMP_VV which uses rather pointlessly 'if (omp_is_initial_device() .eqv. .true.)' – instead of using 'if (omp_…())'. This failed with an ICE as the middle end did not like 'if ( == )' comparisons. The initial idea was to crea

Ping: [PATCH] gcc/doc: adjust __builtin_choose_expr() description

2024-10-08 Thread Jan Beulich
On 19.06.2024 16:01, Jan Beulich wrote: > Present wording has misled people to believe the ?: operator would be > evaluating all three of the involved expressions. > > gcc/ > > * doc/extend.texi: Clarify __builtin_choose_expr() similarity to > the ?: operator. Anyone? I don't think I

Re: Ping: [PATCH] gcc/doc: adjust __builtin_choose_expr() description

2024-10-08 Thread Sandra Loosemore
On 10/8/24 09:35, Jan Beulich wrote: On 08.10.2024 17:30, Sandra Loosemore wrote: [snip] Hmmm, looking at the complete documentation for this built-in, and the code, I think I'd go a little farther with fixing up the docs. Since requiring the first operand to be a constant is also different be

Re: [PATCH 1/8] aarch64: Use PAUTH instead of V8_3A in some places

2024-10-08 Thread Richard Sandiford
Andrew Carlotti writes: > gcc/ChangeLog: > > * config/aarch64/aarch64.cc > (aarch64_expand_epilogue): Use TARGET_PAUTH. > * config/aarch64/aarch64.md: Update comment. > > > diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc > index > e7bb3278a27eca44c46af

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Jₑₙₛ Gustedt
Hello everybody, can you please leave me out of this ever spinning discussion? The discussion in Minneapolis has fulfilled my needs on this for the next 10 years at least. I consider forcing people to opt out of mailings as being quite rude. Thanks Jₑₙₛ -- :: ICube

Re: [PATCH 2/3] aarch64: libgcc: add prototypes in cpuinfo

2024-10-08 Thread Kyrylo Tkachov
> On 8 Oct 2024, at 11:57, Richard Sandiford wrote: > > External email: Use caution opening links or attachments > > > Christophe Lyon writes: >> On Fri, 4 Oct 2024 at 10:00, Kyrylo Tkachov wrote: >>> >>> >>> On 3 Oct 2024, at 21:44, Christophe Lyon wrote: External

Re: [PING] [PATCH] i386: Implement Thread Local Storage on Windows

2024-10-08 Thread Julian Waters
Sorry for not being fast enough to rewrite the patch on my end to integrate your changes (I'm maintaining this patch for both gcc 14 and master at the same time, which is a little complicated), but I appreciate the help :) How did you figure out the issue so quickly? I was going in circles trying t

  1   2   >