Re: [PATCH] RISC-V: Allow constraint "S" even if the symbol does not bind locally

2024-01-30 Thread Kito Cheng
I realized there is 's' constraint which is defined in GCC generic infra[1], and that's kinda what same as the new semantic of 'S' here, (define_constraint "s" "Matches a symbolic integer constant." (and (match_test "CONSTANT_P (op)") (match_test "!CONST_SCALAR_INT_P (op)")

[PATCH] RISC-V: Allow constraint "S" even if the symbol does not bind locally

2024-01-30 Thread Fangrui Song
The constraint "S" can only be used with a symbol that binds locally, so the following does not work for -fpie/-fpic (GOT access is used). ``` namespace ns { extern int var, a[4]; } void foo() { asm(".pushsection .xxx,\"aw\"; .dc.a %0; .popsection" :: "S"(::var)); asm(".reloc .,

About 31109 - gprofng not built and installed in a combined binutils+gcc build

2024-01-30 Thread Vladimir Mezentsev
Hi, I asked in https://sourceware.org/bugzilla/show_bug.cgi?id=31109 > I prepared a patch for the releases/gcc-13 branch. > Richard Biener rejected my patch for this branch. > Which branch should I use? master, trunk or something else? Do you really need gprofng in the gcc repo ? if yes:  

[PATCH RFA] asan: poisoning promoted statics [PR113531]

2024-01-30 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, OK for trunk? -- 8< -- Since my r14-1500-g4d935f52b0d5c0 we promote an initializer_list backing array to static storage where appropriate, but this happens after we decided to add it to asan_poisoned_variables. As a result we add unpoison/poison for it to the gimple.

Re: Ping: Re: [PATCH] libgcc: fix SEH C++ rethrow semantics [PR113337]

2024-01-30 Thread LIU Hao
在 2024-01-31 08:08, Jonathan Yong 写道: On 1/24/24 15:17, Matteo Italia wrote: Ping! That's a one-line fix, and you can find all the details in the bugzilla entry. Also, I can provide executables built with the affected toolchains, demonstrating the problem and the fix. Thanks, Matteo I was

Re: [PATCH] c-family: Fix ICE with large column number after restoring a PCH [PR105608]

2024-01-30 Thread Lewis Hyatt
On Fri, Jan 26, 2024 at 04:16:54PM -0500, Jason Merrill wrote: > On 12/5/23 20:52, Lewis Hyatt wrote: > > Hello- > > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105608 > > > > There are two related issues here really, a regression since GCC 11 where we > > can ICE after restoring a PCH, and

[PATCH v2] Handle private COMDAT function symbol reference in readonly data section

2024-01-30 Thread H.J. Lu
Changes in v2: 1. Check decl non-null before dereferencing it. 2. Update PR rtl-optimization/113617 from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113617#c14 --- For a private COMDAT function symbol reference in readonly data section, instead of putting it in .data.rel.ro or .rodata.cst

[PATCH v3 5/5] Add documentation for musttail attribute

2024-01-30 Thread Andi Kleen
--- gcc/doc/extend.texi | 16 1 file changed, 16 insertions(+) diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 0bc586d120e7..1d413b0ef6d1 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -9867,6 +9867,22 @@ foo (int x, int y) @code{y} is not actually

[PATCH v3 3/5] C: Implement musttail attribute for returns

2024-01-30 Thread Andi Kleen
Implement a C23 clang compatible musttail attribute similar to the earlier C++ implementation in the C parser. --- gcc/c/c-parser.cc | 61 +-- gcc/c/c-tree.h| 2 +- gcc/c/c-typeck.cc | 15 ++-- 3 files changed, 63 insertions(+), 15

[PATCH v3 4/5] Add tests for C/C++ musttail attributes

2024-01-30 Thread Andi Kleen
Mostly adopted from the existing C musttail plugin tests. --- gcc/testsuite/c-c++-common/musttail1.c | 17 gcc/testsuite/c-c++-common/musttail2.c | 36 + gcc/testsuite/c-c++-common/musttail3.c | 31 +

[PATCH v3 1/5] Improve must tail in RTL backend

2024-01-30 Thread Andi Kleen
- Give error messages for all causes of non sibling call generation - Don't override choices of other non sibling call checks with must tail. This causes ICEs. The must tail attribute now only overrides flag_optimize_sibling_calls locally. - Error out when tree-tailcall failed to mark a must-tail

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

2024-01-30 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

Updated [[musttail]] patchkit

2024-01-30 Thread Andi Kleen
Fixed all earlier review comments.

[PATCH v1] RISC-V: Cleanup the comments for the psabi

2024-01-30 Thread pan2 . li
From: Pan Li This patch would like to cleanup some comments which are out of date or incorrect. gcc/ChangeLog: * config/riscv/riscv.cc (riscv_get_arg_info): Cleanup comments. (riscv_pass_by_reference): Ditto. (riscv_fntype_abi): Ditto. Signed-off-by: Pan Li ---

[committed] c: Fix ICEs casting expressions with integer constant operands to bool [PR111059, PR111911]

2024-01-30 Thread Joseph Myers
C front-end bugs 111059 and 111911 both report ICEs with conversions to boolean of expressions with integer constant operands that can appear in an integer constant expression as long as they are not evaluated (such as division by zero). The issue is a nested C_MAYBE_CONST_EXPR, with the inner

[pushed] analyzer: handle null "var" in state_change_event::get_desc [PR113509]

2024-01-30 Thread David Malcolm
Avoid ICE with -fanalyzer-verbose-state-changes when region_model::get_representative_tree returns nullptr in state_change_event::get_desc. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r14-8640-g18aabe7d203aa1. gcc/analyzer/ChangeLog: PR

Re: Ping: Re: [PATCH] libgcc: fix SEH C++ rethrow semantics [PR113337]

2024-01-30 Thread Jonathan Yong
On 1/24/24 15:17, Matteo Italia wrote: Ping! That's a one-line fix, and you can find all the details in the bugzilla entry. Also, I can provide executables built with the affected toolchains, demonstrating the problem and the fix. Thanks, Matteo I was away last week. LH, care to comment?

Re: [PATCH] i386: Add "Ws" constraint for symbolic address/label reference [PR105576]

2024-01-30 Thread H.J. Lu
On Tue, Jan 16, 2024 at 11:47 PM Uros Bizjak wrote: > > On Thu, Jan 11, 2024 at 7:24 PM Fangrui Song wrote: > > > > Printing the raw symbol is useful in inline asm (e.g. in C++ to get the > > mangled name). Similar constraints are available in other targets (e.g. > > "S" for aarch64/riscv, "Cs"

[PATCH] c++: add deprecation notice for -fconcepts-ts

2024-01-30 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- We plan to deprecate -fconcepts-ts in GCC 15 and remove the flag_concepts_ts code. This note is an admonishing reminder to convert the Concepts TS code to C++20 Concepts. gcc/c-family/ChangeLog: * c-opts.cc

[PATCH] libstdc++: Fix fs::hard_link_count behaviour on MinGW [PR113663]

2024-01-30 Thread Lennox Ho
std::filesystem::hard_link_count() always returns 1 on mingw-w64ucrt-11.0.1-r3 on Windows 10 19045 hard_link_count() queries _wstat64() on MinGW-w64 The MSFT documentation claims _wstat64() will always return 1 *non*-NTFS volumes

[PATCH v2] mklog: Add lookup for new generated files in libstdc++

2024-01-30 Thread Jonathan Wakely
On 30/01/24 15:02 +, Jonathan Wakely wrote: That way other subdirectories could add their own extra generated files to it. Like so. mklog: Add lookup for generated files in specific sub-directories The mklog.py output for libstdc++-v3/include/bits/version.h is awful.

Re: [PATCH] RISC-V: Fix VSETLV PASS compile-time issue

2024-01-30 Thread Robin Dapp
LGTM. Regards Robin

Re: [patch, libgfortran] PR111022 ES0.0E0 format gave ES0.dE0 output with d too high.

2024-01-30 Thread Harald Anlauf
Hi Jerry, Am 30.01.24 um 19:15 schrieb Jerry D: The attached patch attempts to fix the handling of the EN0.0E0 and ES0.0E0 formatting by correctly calculating the number of digits needed for the exponents and building those exponents into the float string. while your patch addresses ENw.dE0

Re: [PING][PATCH] Include safe-ctype.h after C++ standard headers, to avoid over-poisoning

2024-01-30 Thread Sam James
Sam James writes: > [[PGP Signed Part:Undecided]] > > Sam James writes: > >> Sam James writes: >> >>> Dimitry Andric writes: >>> Ping. It would be nice to get this QoL fix in. >>> >>> Yes please - we've been using this in Gentoo since around when it was >>> first posted. No

[patch,avr,applied] Add more devices.

2024-01-30 Thread Georg-Johann Lay
Applied, this adds 6 more devices, 2 new and 4 fairly old for completeness. Johann -- AVR: Add AVR64DU and some older devices. gcc/ * config/avr/avr-mcus.def: Add AVR64DU28, AVR64DU32, ATA5787, ATA5835, ATtiny64AUTO, ATA5700M322. * doc/avr-mmcu.texi: Rebuild.diff --git

Re: [PATCH] mklog: Add lookup for new generated files in libstdc++

2024-01-30 Thread Jonathan Wakely
On Tue, 30 Jan 2024, 15:03 Jonathan Wakely, wrote: > OK for trunk? > > -- >8 -- > > The mklog.py output for libstdc++-v3/include/bits/version.h is awful. > Teaching mklog.py that it's generated makes it correctly use > "Regenerate" for its changes. We can do the same for the other new >

Re: [PATCH V3 2/4] RISC-V: Add vector related pipelines

2024-01-30 Thread Robin Dapp
> I think removing the is_inorder attribute should be ok. I added it > because I wanted to avoid having two matching insn reservations > defined since matching solely on the type attribute should also match > on all subsets as well (i.e. if eventually we add an insn reservation > checking for type

[PATCH] aarch64: -mstrict-align vs __arm_data512_t [PR113657]

2024-01-30 Thread Andrew Pinski
After r14-1187-gd6b756447cd58b, simplify_gen_subreg can return NULL for "unaligned" memory subreg. Since V8DI has an alignment of 8 bytes, using TImode causes simplify_gen_subreg to return NULL. This fixes the issue by using DImode instead for the loop. And then we will have later on the STP/LDP

Re: [PATCH v2] c++: avoid -Wdangling-reference for std::span-like classes [PR110358]

2024-01-30 Thread Marek Polacek
On Thu, Jan 25, 2024 at 10:13:10PM -0500, Jason Merrill wrote: > On 1/25/24 20:36, Marek Polacek wrote: > > Better version: > > > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > > -- >8 -- > > Real-world experience shows that -Wdangling-reference triggers for > >

[patch, libgfortran] PR111022 ES0.0E0 format gave ES0.dE0 output with d too high.

2024-01-30 Thread Jerry D
The attached patch attempts to fix the handling of the EN0.0E0 and ES0.0E0 formatting by correctly calculating the number of digits needed for the exponents and building those exponents into the float string. My editor judiciously deleted trailing blank spaces in a number of places. I

Re: [PATCH] RISC-V: Fix rvv intrinsic pragma tests dejagnu selector

2024-01-30 Thread Palmer Dabbelt
On Mon, 29 Jan 2024 11:38:12 PST (-0800), e...@rivosinc.com wrote: Adding rvv related flags (i.e. --param=riscv-autovec-preference) to non vector targets bypassed the dejagnu skip test directive. Change the target selector to skip if rvv is enabled gcc/testsuite/ChangeLog: *

[COMMITTED] xtensa: Make full transition to LRA

2024-01-30 Thread Max Filippov
From: Takayuki 'January June' Suwa gcc/ChangeLog: * config/xtensa/constraints.md (R, T, U): Change define_constraint to define_memory_constraint. * config/xtensa/predicates.md (move_operand): Don't check that a constant pool operand size is a multiple of

[PATCH][GCC 13] aarch64: Avoid out-of-range shrink-wrapped saves [PR111677]

2024-01-30 Thread Alex Coplan
Bootstrapped/regtested on aarch64-linux-gnu, OK for the 13 branch after a week of the trunk fix being in? OK for the other active branches if the same changes test cleanly there? GCC 14 patch for reference: https://gcc.gnu.org/pipermail/gcc-patches/2024-January/61.html Thanks, Alex -- >8

Re: [PATCH] aarch64: Fix ICE in poly-int.h due to SLP.

2024-01-30 Thread Prathamesh Kulkarni
On Tue, 30 Jan 2024 at 20:13, Richard Ball wrote: > > Adds a check to ensure that the input vector arguments > to a function are not variable length. Previously, only the > output vector of a function was checked. Hi, Quoting from patch: @@ -8989,6 +8989,14 @@ vectorizable_slp_permutation_1

Re: [PATCH] c++: add original testcase [PR67898]

2024-01-30 Thread Jason Merrill
On 1/30/24 12:14, Patrick Palka wrote: Tested on x86_64-pc-linux-gnu, does this look OK for trunk? OK. -- >8 -- The original testcase from this PR (fixed by r14-8291) is rather different from the others, so let's add it to the testsuite. PR c++/67898 gcc/testsuite/ChangeLog:

[PATCH] c++: add original testcase [PR67898]

2024-01-30 Thread Patrick Palka
Tested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- The original testcase from this PR (fixed by r14-8291) is rather different from the others, so let's add it to the testsuite. PR c++/67898 gcc/testsuite/ChangeLog: * g++.dg/cpp0x/temp_default8.C: New test.

[pushed] testsuite: fix anon6 mangling [PR112846]

2024-01-30 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- As with r14-6796-g2fa122cae50cd8, avoid mangling compatibility aliases in mangling tests, and test the new mangling. PR c++/112846 gcc/testsuite/ChangeLog: * g++.dg/abi/anon6.C: Specify ABI v18. *

[PATCH] testsuite, arm: Fix testcase arm/pr112337.c to check for the options first

2024-01-30 Thread Saurabh Jha
Hey, Previously, this test was added to fix this bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112337. However, it did not check the compilation options before using them, leading to errors. This patch fixes the test by first checking whether it can use the options before using them.

[PATCH] libgcc: Include stdlib.h for abort() on mingw32

2024-01-30 Thread Khem Raj
libgcc/ * config/i386/enable-execute-stack-mingw32.c: Include stdlib.h for abort() definition. Signed-off-by: Khem Raj --- libgcc/config/i386/enable-execute-stack-mingw32.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libgcc/config/i386/enable-execute-stack-mingw32.c

Re: [PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-01-30 Thread Jakub Jelinek
On Tue, Jan 30, 2024 at 04:34:30PM +, Jonathan Wakely wrote: > > --- /dev/null > > +++ > > b/libstdc++-v3/testsuite/29_atomics/atomic_float/compare_exchange_padding.cc > > @@ -0,0 +1,50 @@ > > +// { dg-do run { target c++20 } } > > +// { dg-options "-O0" } > > +// { dg-timeout 10 } Why

[pushed] testsuite: mangle-reparm1a options [PR113451]

2024-01-30 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- When I added -fabi-compat-version=8 to avoid mangling aliases it also suppressed the -Wabi warning. PR c++/113451 gcc/testsuite/ChangeLog: * g++.dg/abi/mangle-regparm1a.C: Use -Wabi=0. ---

Re: [PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-01-30 Thread Jonathan Wakely
On Tue, 16 Jan 2024 at 16:17, xndcn wrote: > > Sorry about the mangled content... > So I add a new add-options for libatomic_16b: > > --- > libstdc++-v3/ChangeLog: > > * include/bits/atomic_base.h: add __builtin_clear_padding in > __atomic_float constructor. > * testsuite/lib/dg-options.exp: add

Re: [PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-01-30 Thread Jonathan Wakely
On Tue, 16 Jan 2024 at 16:17, xndcn wrote: > > Sorry about the mangled content... > So I add a new add-options for libatomic_16b: > > --- > libstdc++-v3/ChangeLog: > > * include/bits/atomic_base.h: add __builtin_clear_padding in > __atomic_float constructor. > * testsuite/lib/dg-options.exp: add

Re: [PATCH] Include safe-ctype.h after C++ standard headers, to avoid over-poisoning

2024-01-30 Thread Jonathan Wakely
On 28/09/23 18:37 +0200, Dimitry Andric wrote: Ref: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111632 When building gcc's C++ sources against recent libc++, the poisoning of the ctype macros due to including safe-ctype.h before including C++ standard headers such as , , etc, causes many

[PING][PATCH] libstdc++: atomic: Add missing clear_padding in __atomic_float constructor

2024-01-30 Thread xndcn
Ping, thanks. I do not have access to the repo, anyone can please help me submit the patch? Thanks. xndcn 于2024年1月17日周三 00:16写道: > > Sorry about the mangled content... > So I add a new add-options for libatomic_16b: > > --- > libstdc++-v3/ChangeLog: > > * include/bits/atomic_base.h: add

Re: [PATCH v4 0/4]New attribute "counted_by" to annotate bounds for C99 FAM(PR108896)

2024-01-30 Thread Qing Zhao
Okay, Based on the comments so far, I will work on the 5th version of the patch, major changes will include: 1. Change the return type of the routine .ACCESS_WITH_SIZE FROM: Pointer to the type of the element of the flexible array; TO: Pointer to the type of the flexible

Re: [PATCH v4] AArch64: Cleanup memset expansion

2024-01-30 Thread Wilco Dijkstra
Hi Richard, >> That tune is only used by an obsolete core. I ran the memcpy and memset >> benchmarks from Optimized Routines on xgene-1 with and without LDP/STP. >> There is no measurable penalty for using LDP/STP. I'm not sure why it was >> ever added given it does not do anything useful. I'll

Re: [PATCH] libgccjit: Add ability to get CPU features

2024-01-30 Thread Antoni Boucher
David: I'm unsure what to do here. It seems we cannot find a reviewer. Would it help if I show you the code in gccrs that is similar? Would it help if I ask someone from gccrs to review this code? On Sat, 2024-01-20 at 09:50 -0500, Antoni Boucher wrote: > CC-ing Iain in case they can do the

Re: [PATCH v4 0/4]New attribute "counted_by" to annotate bounds for C99 FAM(PR108896)

2024-01-30 Thread Qing Zhao
> On Jan 30, 2024, at 12:41 AM, Kees Cook wrote: > > On Mon, Jan 29, 2024 at 10:45:23PM +, Qing Zhao wrote: >> There are two things here. >> >> 1. The value of the “counted-by” is 0; (which is easy to be understood) >> 2. The result of the _builtin_object_size when see a “counted-by” 0.

[PATCH] AArch64: Remove AARCH64_EXTRA_TUNE_NO_LDP_STP_QREGS

2024-01-30 Thread Wilco Dijkstra
(follow-on based on review comments on https://gcc.gnu.org/pipermail/gcc-patches/2024-January/641913.html) Remove the tune AARCH64_EXTRA_TUNE_NO_LDP_STP_QREGS since it is only used by an old core and doesn't properly support -Os. SPECINT_2017 shows that removing it has no performance

[PATCH] aarch64: Avoid out-of-range shrink-wrapped saves [PR111677]

2024-01-30 Thread Alex Coplan
Hi, The PR shows us ICEing due to an unrecognizable TFmode save emitted by aarch64_process_components. The problem is that for T{I,F,D}mode we conservatively require mems to be in range for x-register ldp/stp. That is because (at least for TImode) it can be allocated to both GPRs and FPRs, and

Re: [PATCH] Handle function symbol reference in readonly data section

2024-01-30 Thread H.J. Lu
On Tue, Jan 30, 2024 at 4:58 AM H.J. Lu wrote: > > On Tue, Jan 30, 2024 at 4:51 AM Jakub Jelinek wrote: > > > > On Mon, Jan 29, 2024 at 06:05:25PM -0800, H.J. Lu wrote: > > > LRA may call forcce_const_mem on this insn in the function > > > > > > (gdb) call debug_tree (func_decl) > > > > >

Re: [PATCH] c++: duplicated side effects of xobj arg [PR113640]

2024-01-30 Thread Jason Merrill
On 1/30/24 10:09, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linu-xgnu, does this look OK for trunk? OK. -- >8 -- We miscompile the below testcase because keep_unused_object_arg duplicates the side effects of a (by-value) object argument of a xobj member function.

[PATCH] c++: duplicated side effects of xobj arg [PR113640]

2024-01-30 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linu-xgnu, does this look OK for trunk? -- >8 -- We miscompile the below testcase because keep_unused_object_arg duplicates the side effects of a (by-value) object argument of a xobj member function. PR c++/113640 gcc/cp/ChangeLog: *

Re: [PING][PATCH] Include safe-ctype.h after C++ standard headers, to avoid over-poisoning

2024-01-30 Thread Sam James
Sam James writes: > Sam James writes: > >> Dimitry Andric writes: >> >>> Ping. It would be nice to get this QoL fix in. >>> >> >> Yes please - we've been using this in Gentoo since around when it was >> first posted. No complaints. >> >> I cannot approve but it looks good to me. > > Ping.

[PATCH] mklog: Add lookup for new generated files in libstdc++

2024-01-30 Thread Jonathan Wakely
OK for trunk? -- >8 -- The mklog.py output for libstdc++-v3/include/bits/version.h is awful. Teaching mklog.py that it's generated makes it correctly use "Regenerate" for its changes. We can do the same for the other new generated headers as well. contrib/ChangeLog: * mklog.py

[PATCH] libstdc++: Enable std::text_encoding for darwin and FreeBSD

2024-01-30 Thread Jonathan Wakely
This should fix the std/text_encoding/* FAILs that Iain sees on darwin. I assume it will make it work for FreeBSD too. I won't push this until I hear it works for at least one of those. Tested x86_64-linux. -- >8 -- The header is needed for newlocale and locale_t on these targets.

Re: [Patch, stage-1, RFC]: i386: attribute regparm/stdcall and vaargs

2024-01-30 Thread Joseph Myers
On Tue, 30 Jan 2024, Bernhard Reutner-Fischer via Gcc wrote: > * builtin-attrs.def (ATTR_TM_NOTHROW_RT_LIST): Use ATTR_NOTHROW_LIST > instead of ATTR_TM_NOTHROW_LIST, thus removing ATTR_TM_REGPARM. That doesn't make sense. ATTR_TM_NOTHROW_RT_LIST is specifically a transactional

[PATCH] aarch64: libgcc: Cleanup ELF marking in asm

2024-01-30 Thread Szabolcs Nagy
Use aarch64-asm.h in asm code consistently, this was started in commit c608ada288ced0268c1fd4136f56c34b24d4 Author: Zac Walker CommitDate: 2024-01-23 15:32:30 + Ifdef `.hidden`, `.type`, and `.size` pseudo-ops for `aarch64-w64-mingw32` target But that commit failed to

[PATCH] aarch64: Fix ICE in poly-int.h due to SLP.

2024-01-30 Thread Richard Ball
Adds a check to ensure that the input vector arguments to a function are not variable length. Previously, only the output vector of a function was checked. gcc/ChangeLog: * tree-vect-slp.cc (vectorizable_slp_permutation_1): Add variable-length check for vector input arguments

[PATCH 3/3] aarch64: Add SVE support for simd clones [PR 96342]

2024-01-30 Thread Andre Vieira
This patch finalizes adding support for the generation of SVE simd clones when no simdlen is provided, following the ABI rules where the widest data type determines the minimum amount of elements in a length agnostic vector. gcc/ChangeLog: * config/aarch64/aarch64-protos.h

[PATCH 2/3] vect: disable multiple calls of poly simdclones

2024-01-30 Thread Andre Vieira
The current codegen code to support VF's that are multiples of a simdclone simdlen rely on BIT_FIELD_REF to create multiple input vectors. This does not work for non-constant simdclones, so we should disable using such clones when the VF is a multiple of the non-constant simdlen until we change

[PATCH 1/3] vect: Pass stmt_vec_info to TARGET_SIMD_CLONE_USABLE

2024-01-30 Thread Andre Vieira
This patch adds stmt_vec_info to TARGET_SIMD_CLONE_USABLE to make sure the target can reject a simd_clone based on the vector mode it is using. This is needed because for VLS SVE vectorization the vectorizer accepts Advanced SIMD simd clones when vectorizing using SVE types because the simdlens

[PATCH 0/3] vect, aarch64: Add SVE support for simdclones

2024-01-30 Thread Andre Vieira
Hi, This patch series is a set of patches that I have sent up for review before and it enables initial support SVE simd clones with some caveats. Caveat 1: we do not support SVE simd clones with function bodies. To enable support for this we need to change the way we 'simdify' a function body.

Re: [PATCH v3 2/2] arm: Add support for MVE Tail-Predicated Low Overhead Loops

2024-01-30 Thread Andre Simoes Dias Vieira
Hi Richard, Thanks for the reviews, I'm making these changes but just a heads up. When hardcoding LR_REGNUM like this we need to change the way we compare the register in doloop_condition_get. This function currently compares the rtx nodes by address, which I think happens to be fine before we

RE: [PATCH v2] RISC-V: Bugfix for vls mode aggregated in GPR calling convention

2024-01-30 Thread Li, Pan2
Thanks Kito. Committed with assertion, as well as pass the riscv regression test. Pan -Original Message- From: Li, Pan2 Sent: Tuesday, January 30, 2024 9:11 PM To: Kito Cheng Cc: gcc-patches@gcc.gnu.org; juzhe.zh...@rivai.ai; Wang, Yanzhang Subject: RE: [PATCH v2] RISC-V: Bugfix for

[pushed] analyzer: fix -Wanalyzer-allocation-size false +ve on Linux kernel's round_up macro [PR113654]

2024-01-30 Thread David Malcolm
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Successful run of analyzer integration tests on x86_64-pc-linux-gnu. Pushed to trunk as r14-8627-g9f382376660069. gcc/analyzer/ChangeLog: PR analyzer/113654 * region-model.cc (is_round_up): New.

[pushed] analyzer: add SARIF property bag to -Wanalyzer-allocation-size

2024-01-30 Thread David Malcolm
This is useful for debugging the analyzer. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Successful run of analyzer integration tests on x86_64-pc-linux-gnu. Pushed to trunk as r14-8626-g181f753dc4afa9. gcc/analyzer/ChangeLog: * region-model.cc

RE: [PATCH v2] RISC-V: Bugfix for vls mode aggregated in GPR calling convention

2024-01-30 Thread Li, Pan2
Thanks Kito, will add assertion here, and commit it if there is no surprise in riscv regression test. Pan -Original Message- From: Kito Cheng Sent: Tuesday, January 30, 2024 8:54 PM To: Li, Pan2 Cc: gcc-patches@gcc.gnu.org; juzhe.zh...@rivai.ai; Wang, Yanzhang Subject: Re: [PATCH

RE: [PATCH]middle-end: check memory accesses in the destination block [PR113588].

2024-01-30 Thread Richard Biener
On Tue, 30 Jan 2024, Tamar Christina wrote: > > -Original Message- > > From: Richard Biener > > Sent: Tuesday, January 30, 2024 9:51 AM > > To: Tamar Christina > > Cc: gcc-patches@gcc.gnu.org; nd ; j...@ventanamicro.com > > Subject: Re: [PATCH]middle-end: check memory accesses in the

Re: [PATCH] Handle COMDAT function symbol reference in readonly data section

2024-01-30 Thread H.J. Lu
On Mon, Jan 29, 2024 at 3:08 PM H.J. Lu wrote: > > For a COMDAT function symbol reference in readonly data section, > instead of putting it in .data.rel.ro or .rodata.cst section, call > function_rodata_section to get the read-only or relocated read-only > data section associated with the

Re: [PATCH] Handle function symbol reference in readonly data section

2024-01-30 Thread H.J. Lu
On Tue, Jan 30, 2024 at 4:51 AM Jakub Jelinek wrote: > > On Mon, Jan 29, 2024 at 06:05:25PM -0800, H.J. Lu wrote: > > LRA may call forcce_const_mem on this insn in the function > > > > (gdb) call debug_tree (func_decl) > > > type > type > align:8 warn_if_not_align:0

RE: [PATCH]middle-end: check memory accesses in the destination block [PR113588].

2024-01-30 Thread Tamar Christina
> -Original Message- > From: Richard Biener > Sent: Tuesday, January 30, 2024 9:51 AM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; nd ; j...@ventanamicro.com > Subject: Re: [PATCH]middle-end: check memory accesses in the destination block > [PR113588]. > > On Mon, 29 Jan 2024,

[PATCH] Handle private COMDAT function symbol reference in readonly data section

2024-01-30 Thread H.J. Lu
For a private COMDAT function symbol reference in readonly data section, instead of putting it in .data.rel.ro or .rodata.cst section, call function_rodata_section to get the read-only or relocated read-only data section associated with the function DECL so that the COMDAT section will be used for

Re: [PATCH] Handle function symbol reference in readonly data section

2024-01-30 Thread Jakub Jelinek
On Mon, Jan 29, 2024 at 06:05:25PM -0800, H.J. Lu wrote: > LRA may call forcce_const_mem on this insn in the function > > (gdb) call debug_tree (func_decl) > type type align:8 warn_if_not_align:0 symtab:0 alias-set -1 > canonical-type 0x77690f18 >

Re: [PATCH v2] RISC-V: Bugfix for vls mode aggregated in GPR calling convention

2024-01-30 Thread Kito Cheng
Thanks for fixing this bug! LGTM with one minor comment :) > diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc > index 7b6111aa545..1de69019cd4 100644 > --- a/gcc/config/riscv/riscv.cc > +++ b/gcc/config/riscv/riscv.cc > @@ -1382,6 +1382,38 @@ riscv_v_ext_mode_p (machine_mode

[COMMITTED 097/101] gccrs: AST: Fix for lifetime lowering

2024-01-30 Thread arthur . cohen
From: Jakub Dupak gcc/rust/ChangeLog: * hir/rust-ast-lower-type.cc (ASTLoweringTypeBounds::visit): fix for lifetimes (ASTLowerWhereClauseItem::visit): fix for lifetimes Signed-off-by: Jakub Dupak --- gcc/rust/hir/rust-ast-lower-type.cc | 21 + 1 file

[COMMITTED 088/101] gccrs: Handle newlines during string parsing while lexing

2024-01-30 Thread arthur . cohen
From: Nirmal Patel If newline strings are encountered while lexing, the lexer now handles newline characters by incrementing current line number. This provides correct line number when displaying errors. If the lexer encounters end of file before string end, then it will use the start of the

[COMMITTED 090/101] gccrs: Fix inconsistent formatting

2024-01-30 Thread arthur . cohen
From: Kushal Pal gcc/rust/ChangeLog: * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Enclose const in single quotes. gcc/testsuite/ChangeLog: * rust/compile/const_trait_fn.rs: Enclose const in single quotes. Signed-off-by: Kushal Pal ---

[COMMITTED 089/101] gccrs: Handle `async` functions in traits

2024-01-30 Thread arthur . cohen
From: Kushal Pal Fixes #2785 gcc/rust/ChangeLog: * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Added check for `async` functions inside trait. * parse/rust-parse-impl.h (Parser::parse_trait_item): Added switch-case for ASYNC token.

[COMMITTED 081/101] gccrs: Generate error for `async` trait fucntions

2024-01-30 Thread arthur . cohen
From: Kushal Pal Fixes #2767 gcc/rust/ChangeLog: * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Added check for `async` function inside trait. gcc/testsuite/ChangeLog: * rust/compile/issue-2767.rs: New test. Signed-off-by: Kushal Pal ---

[COMMITTED 098/101] gccrs: Test: check implemented for lifetime handling

2024-01-30 Thread arthur . cohen
From: Jakub Dupak gcc/testsuite/ChangeLog: * rust/compile/for_lifetimes.rs: New test. Signed-off-by: Jakub Dupak --- gcc/testsuite/rust/compile/for_lifetimes.rs | 19 +++ 1 file changed, 19 insertions(+) create mode 100644 gcc/testsuite/rust/compile/for_lifetimes.rs

[COMMITTED 074/101] gccrs: BIR: Fix missed nodiscard

2024-01-30 Thread arthur . cohen
From: Jakub Dupak gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-builder-internal.h: Replace nodiscard. * checks/errors/borrowck/rust-bir-place.h: Replace nodiscard. Signed-off-by: Jakub Dupak --- gcc/rust/checks/errors/borrowck/rust-bir-builder-internal.h | 4 ++--

[COMMITTED 075/101] gccrs: TyTy: refactor to new API

2024-01-30 Thread arthur . cohen
From: Jakub Dupak gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path): Refactor. Signed-off-by: Jakub Dupak --- gcc/rust/typecheck/rust-hir-type-check-type.cc | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git

[COMMITTED 072/101] gccrs: HIR: add missing getters

2024-01-30 Thread arthur . cohen
From: Jakub Dupak gcc/rust/ChangeLog: * hir/tree/rust-hir-item.h: Ad lifetime getter. * hir/tree/rust-hir-path.h: Make getter const ref. * hir/tree/rust-hir.h: Const ref and new getter. Signed-off-by: Jakub Dupak --- gcc/rust/hir/tree/rust-hir-item.h | 2 ++

[COMMITTED 085/101] gccrs: ast: Infer static lifetime for const and static items

2024-01-30 Thread arthur . cohen
From: Jakub Dupak (probably incomplete propagation) gcc/rust/ChangeLog: * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_lifetime): Propagate static requirement. * hir/rust-ast-lower-base.h: Propagate static requirement. * hir/rust-ast-lower-implitem.h:

[COMMITTED 096/101] gccrs: AST: Fix for lifetime parsing

2024-01-30 Thread arthur . cohen
From: Jakub Dupak gcc/rust/ChangeLog: * parse/rust-parse-impl.h (Parser::parse_where_clause): fix parsing (Parser::parse_where_clause_item): fix parsing (Parser::parse_type_bound_where_clause_item): fix parsing (Parser::parse_trait_bound): fix parsing *

[COMMITTED 063/101] gccrs: Add validation for functions without body

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry Add checks in the ast validation pass to error out with functions (either free or associated) without a definition. gcc/rust/ChangeLog: * checks/errors/rust-ast-validation.cc (ASTValidation::visit): Add a validation check and emit an error depending

[COMMITTED 071/101] gccrs: refactor builtins initialization and attributes

2024-01-30 Thread arthur . cohen
From: Arthur Cohen This commit performs builtin initialization in a more "GCC-y" way, similarly to what the D frontend is doing. This way, we no longer have to worry about invalid attributes or types when initializing them by hand. Also add attributes support through

[COMMITTED 093/101] gccrs: Unify storage of associated items in SingleASTNode

2024-01-30 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * ast/rust-ast-fragment.cc (Fragment::assert_single_fragment): Update. * ast/rust-ast.h (class TraitImplItem): Move definition before that of TraitItem. (class TraitItem): Inherit from TraitImplItem instead of

[COMMITTED 100/101] gccrs: Remove TraitImplItem

2024-01-30 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * ast/rust-ast-full-decls.h (class TraitImplItem): Remove forward declaration. (class AssociatedItem): Add forward declaration. * ast/rust-ast.h (class TraitImplItem): Remove. (class TraitItem): Inherit from

[COMMITTED 078/101] gccrs: BIR: Cleanup

2024-01-30 Thread arthur . cohen
From: Jakub Dupak gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-place.h: Cleanup. * checks/errors/borrowck/rust-borrow-checker.h: Cleanup. Signed-off-by: Jakub Dupak --- gcc/rust/checks/errors/borrowck/rust-bir-place.h | 2 +-

[COMMITTED 092/101] gccrs: Add improved error when a field is redefined in a struct constructor

2024-01-30 Thread arthur . cohen
From: Robert Goss Fixes #2381 If a struct type is initialized with one of it's fields repeated it will currently issue an error at the use site. However we would like to give the rust error code and (like rustc) show both the specifications for the field to help the user diagnose the issue.

[COMMITTED 057/101] gccrs: Make feature gate visitor inherit from default one

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry The feature gating behavior may be shortened and kept cleaner using the default visitor. This means less maintenance on visit functions as the traversal is shared by multiple visitors. gcc/rust/ChangeLog: * checks/errors/rust-feature-gate.cc

[COMMITTED 099/101] gccrs: Add improved error when no fields in initializer

2024-01-30 Thread arthur . cohen
From: Robert Goss If a struct type with a variant that has fields is initialized with some fields the expression HIR StructExprStructFields is checked that all the fields are assigned. However, if no fields are initialized the HIR StructExprStruct is generated. This doesn't check if the

[COMMITTED 087/101] gccrs: TyTy: Refactor FnType deprecated API

2024-01-30 Thread arthur . cohen
From: Jakub Dupak gcc/rust/ChangeLog: * backend/rust-compile-expr.cc (CompileExpr::visit): Use new API. * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): Use new API. * typecheck/rust-tyty-cmp.h: Remove old API. * typecheck/rust-tyty.cc (FnPtr::is_equal):

[COMMITTED 070/101] gccrs: Change cfg stripper to use default visitor

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry Cfg visitor used it's own visit patterns, this made the code longer than required. gcc/rust/ChangeLog: * expand/rust-cfg-strip.cc (CfgStrip::visit): Change calls from visitor to default visitor. (CfgStrip::go): Add call to visit crate.

[COMMITTED 051/101] gccrs: Split async and const function qualifiers

2024-01-30 Thread arthur . cohen
From: Pierre-Emmanuel Patry A function cannot be both async and const, however this should not be handled in the parser but rather at a later stage in the compiler. This commit change the AsyncConstStatus in the AST and the HIR to allows a function to be both async and const.

[COMMITTED 094/101] gccrs: Added newline to get more readable lexdump

2024-01-30 Thread arthur . cohen
From: Kushal Pal Fixes #2783 gcc/rust/ChangeLog: * lex/rust-lex.cc (Lexer::dump_and_skip): Changed " " to '\n' Signed-off-by: Kushal Pal --- gcc/rust/lex/rust-lex.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/rust/lex/rust-lex.cc

[COMMITTED 086/101] gccrs: ast: Lower 'for' lifetimes

2024-01-30 Thread arthur . cohen
From: Jakub Dupak gcc/rust/ChangeLog: * hir/rust-ast-lower-type.cc (ASTLoweringType::visit): For lifetimes. Signed-off-by: Jakub Dupak --- gcc/rust/hir/rust-ast-lower-type.cc | 7 +++ 1 file changed, 7 insertions(+) diff --git a/gcc/rust/hir/rust-ast-lower-type.cc

  1   2   3   >