Re: [PATCH] Mips: Enable asynchronous unwind tables with both ASAN and TSAN

2022-07-04 Thread Xi Ruoyao via Gcc-patches
On Mon, 2022-07-04 at 21:21 -0700, Fangrui Song wrote: > Clang considers that asan/msan/tsan/dataflow/etc enables > -fasynchronous-unwind-tables by default so I assume this GCC change is > fine. I agree it's fine, but the problem is TSAN is currently "unsupported" within GCC (i. e. when you build

Re: [PATCH] Mips: Enable asynchronous unwind tables with both ASAN and TSAN

2022-07-04 Thread Fangrui Song via Gcc-patches
On Mon, Jul 4, 2022 at 6:54 PM Xi Ruoyao via Gcc-patches wrote: > > On Mon, 2022-07-04 at 14:28 +, Dimitrije Milosevic wrote: > > On Saturday, June 11, 2022 2:03 PM, Xi wrote: > > > Just tried TSAN_SUPPORTED=yes with asynchronous unwind tables > > > enabled, > > > but I got some strange test

RE: [PATCH][pushed] MAINTAINERS: fix alphabetic sorting

2022-07-04 Thread Jiang, Haochen via Gcc-patches
> -Original Message- > From: Martin Liška > Sent: Monday, July 4, 2022 6:17 PM > To: gcc-patches@gcc.gnu.org > Cc: Jiang, Haochen > Subject: [PATCH][pushed] MAINTAINERS: fix alphabetic sorting > > ChangeLog: > > * MAINTAINERS: fix sorting of names > --- > MAINTAINERS | 2 +- > 1

Re: [PATCH] Mips: Enable asynchronous unwind tables with both ASAN and TSAN

2022-07-04 Thread Xi Ruoyao via Gcc-patches
On Mon, 2022-07-04 at 14:28 +, Dimitrije Milosevic wrote: > On Saturday, June 11, 2022 2:03 PM, Xi wrote: > > Just tried TSAN_SUPPORTED=yes with asynchronous unwind tables > > enabled, > > but I got some strange test failures for tls_race.c: > > > > FAIL: c-c++-common/tsan/tls_race.c   -O0 

Re: [PATCH v2 1/7] config: use $EGREP instead of egrep

2022-07-04 Thread Hans-Peter Nilsson
On Mon, 27 Jun 2022, Xi Ruoyao via Gcc-patches wrote: > egrep has been deprecated in favor of grep -E for a long time, and the > next GNU grep release (3.8 or 4.0) will print a warning if egrep is used. > Unfortunately, old hosts with non-GNU grep may lack the support for -E > option. Use

Re: [x86 PATCH] UNSPEC_PALIGNR optimizations and clean-ups.

2022-07-04 Thread Hongtao Liu via Gcc-patches
On Tue, Jul 5, 2022 at 1:48 AM Roger Sayle wrote: > > > Hi Hongtao, > Many thanks for your review. This revised patch implements your > suggestions of removing the combine splitters, and instead reusing > the functionality of the ssse3_palignrdi define_insn_and split. > > This revised patch has

[Committed] gcc.dg/analyzer/allocation-size-1..5.c: Fix for 32-bit newlib targets

2022-07-04 Thread Hans-Peter Nilsson via Gcc-patches
See gcc/config/newlib-stdint.h, where targets that have LONG_TYPE_SIZE == 32, get INT32_TYPE defined to "long int". INT32_TYPE ends up in the target int32_t. Thus the tests failed for 32-bit newlib targets due to related warning messages being matched to "aka int" where the emitted message for

[r13-1460 Regression] FAIL: gcc.dg/tree-ssa/alias-access-path-13.c scan-tree-dump-times fre1 "return 123" 1 on Linux/x86_64

2022-07-04 Thread skpandey--- via Gcc-patches
On Linux/x86_64, b110e5283e368b5377e04766e4ff82cd52634208 is the first bad commit commit b110e5283e368b5377e04766e4ff82cd52634208 Author: Martin Jambor Date: Fri Jul 1 20:57:18 2022 +0200 tree-sra: Fix union handling in build_reconstructed_reference caused FAIL:

[patch] libgompd: Add thread handles

2022-07-04 Thread Ahmed Sayed Mousse via Gcc-patches
*This patch is the initial implementation of OpenMP-API specs book section **20.5.5 with title "Thread Handles".* *I have fixed the first version after revising the notes on it.* *libgomp/ChangeLog 2022-07-01 Ahmed Sayed > * ** Makefile.am (libgompd_la_SOURCES): Add ompd-threads.c.* **

[x86 PATCH take #2] Doubleword version of and; cmp to not; test optimization.

2022-07-04 Thread Roger Sayle
This patch is the latest revision of the patch originally posted at: https://gcc.gnu.org/pipermail/gcc-patches/2022-June/596201.html This patch extends the earlier and;cmp to not;test optimization to also perform this transformation for TImode on TARGET_64BIT and DImode on -m32, One motivation

[r13-1450 Regression] FAIL: 25_algorithms/find_end/constrained.cc (test for excess errors) on Linux/x86_64

2022-07-04 Thread skpandey--- via Gcc-patches
On Linux/x86_64, d2a89809452ef79a14feae1cadc3538e4b45 is the first bad commit commit d2a89809452ef79a14feae1cadc3538e4b45 Author: Richard Biener Date: Tue Jun 21 16:17:58 2022 +0200 Put virtual operands into loop-closed SSA caused FAIL: 25_algorithms/find_end/constrained.cc

Re: [Patch] OpenMP/Fortran: Add support for OpenMP 5.2 linear clause syntax

2022-07-04 Thread Jakub Jelinek via Gcc-patches
On Mon, Jul 04, 2022 at 08:29:37PM +0200, Tobias Burnus wrote: > Fortran part to C/C++ > commit r13-1002-g03b71406323ddc065b1d7837d8b43b17e4b048b5 > > gcc/fortran/ChangeLog: > > * gfortran.h (gfc_omp_namelist): Update by creating 'linear' struct, > move 'linear_op' as 'op' to id and

Re: [x86 PATCH] PR rtl-optimization/96692: ((A|B)^C)^A using andn with -mbmi.

2022-07-04 Thread Uros Bizjak via Gcc-patches
On Mon, Jul 4, 2022 at 7:27 PM Roger Sayle wrote: > > > Hi Uros, > Thanks for the review. This patch implements all of your suggestions, both > removing ix86_pre_reload_split from the combine splitter(s), and dividing > the original splitter up into four simpler variants, that use match_dup to >

[COMMITTED] Misc conversions to vrange.

2022-07-04 Thread Aldy Hernandez via Gcc-patches
The following converts a handful of places that were irange centric. Tested on x86-64 Linux. gcc/ChangeLog: * gimple-range-fold.cc (fold_using_range::range_of_ssa_name_with_loop_info): Restrict the call to SCEV for irange supported types.

RE: [PATCH v2][GCC] arm: Add support for dwarf debug directives and pseudo hard-register for PAC feature.

2022-07-04 Thread Srinath Parvathaneni via Gcc-patches
Ping!! > -Original Message- > From: Gcc-patches bounces+srinath.parvathaneni=arm@gcc.gnu.org> On Behalf Of Srinath > Parvathaneni via Gcc-patches > Sent: 05 May 2022 12:02 > To: gcc-patches@gcc.gnu.org > Cc: Richard Earnshaw > Subject: [PATCH v2][GCC] arm: Add support for dwarf

Re: [Patch] OpenMP/Fortran: Add support for OpenMP 5.2 linear clause syntax

2022-07-04 Thread Tobias Burnus
On 04.07.22 19:20, Jakub Jelinek wrote: Perhaps you could avoid some code duplication by doing it like: bool close_paren = gfc_match ("val )") == MATCH_YES; if (close_paren || gfc_match ("val , ") == MATCH_YES) Done! Good idea! I was thinking of things

RE: [x86 PATCH] UNSPEC_PALIGNR optimizations and clean-ups.

2022-07-04 Thread Roger Sayle
Hi Hongtao, Many thanks for your review. This revised patch implements your suggestions of removing the combine splitters, and instead reusing the functionality of the ssse3_palignrdi define_insn_and split. This revised patch has been tested on x86_64-pc-linux-gnu with make bootstrap and make

RE: [x86 PATCH] PR rtl-optimization/96692: ((A|B)^C)^A using andn with -mbmi.

2022-07-04 Thread Roger Sayle
Hi Uros, Thanks for the review. This patch implements all of your suggestions, both removing ix86_pre_reload_split from the combine splitter(s), and dividing the original splitter up into four simpler variants, that use match_dup to handle the variants/permutations caused by operator

[COMMITTED] [GCC12] PR tree-optimization/106114 - Don't use gori dependencies to optimize.

2022-07-04 Thread Andrew MacLeod via Gcc-patches
Applied slight tweak to the patch for the gcc12 branch. botstrapped and no regressions on x86_64-pc-linux-gnu.  Pushed. Andrew Forwarded Message Subject: [COMMITTED] PR tree-optimization/106114 - Don't use gori dependencies to optimize. Date: Wed, 29 Jun 2022 21:40:44

Re: [Patch] OpenMP/Fortran: Add support for OpenMP 5.2 linear clause syntax

2022-07-04 Thread Jakub Jelinek via Gcc-patches
On Mon, Jul 04, 2022 at 06:09:31PM +0200, Tobias Burnus wrote: > thanks for the comment & spec referral. I have now updated the patch – > and included the new C/Fortran testcase. Thanks. > + while (true) > + { > + old_loc = gfc_current_locus; > +

Re: [PATCH] [12/11/10] Fix invalid format warnings on Windows

2022-07-04 Thread Jeff Law via Gcc-patches
On 5/16/2022 5:27 AM, Tomas Kalibera via Gcc-patches wrote: On 5/11/22 18:43, Joseph Myers wrote: There are various coding style issues in the patch; at least missing space before '(' and '&&' at end of line (should be at start of line).  It will also need to be updated for .c files having

Re: [PATCH] c-family: Add names to diagnostics for known headers

2022-07-04 Thread Jonathan Wakely via Gcc-patches
On Thu, 30 Jun 2022 at 16:15, Marek Polacek wrote: > > On Thu, Jun 30, 2022 at 04:11:42PM +0100, Jonathan Wakely via Gcc-patches > wrote: > > I recently changed to no longer include an unnecessary header, > > which meant it no longer includes , which means it no longer > > includes . This

Re: [Patch] OpenMP/Fortran: Add support for OpenMP 5.2 linear clause syntax

2022-07-04 Thread Tobias Burnus
Hi Jakub, thanks for the comment & spec referral. I have now updated the patch – and included the new C/Fortran testcase. On 04.07.22 16:53, Jakub Jelinek via Fortran wrote: See OpenMP 5.2 [59:31-34]: A modifier that is an expression must neither lexically match the name of a simple modifier

[PATCH] c++, v3: Add support for __real__/__imag__ modifications in constant expressions [PR88174]

2022-07-04 Thread Jakub Jelinek via Gcc-patches
On Mon, Jun 27, 2022 at 06:31:18PM +0200, Jakub Jelinek via Gcc-patches wrote: > Because the late evaluation of the initializer could have touched > the destination, so we need to reevaluate it. > Same reason why we call get_or_insert_ctor_field again in the second > loop as we call it in the

Re: [PATCH] OpenMP, libgomp: Environment variable syntax extension.

2022-07-04 Thread Jakub Jelinek via Gcc-patches
On Thu, Jun 30, 2022 at 01:40:24PM +0200, Jakub Jelinek via Gcc-patches wrote: > On Fri, Jun 10, 2022 at 03:59:37PM +0200, Marcel Vollweiler wrote: > > > I'm not sure we can rely on execv on all targets that do support libgomp. > > > Any reason why you actually need this, rather than using > > >

Re: [Patch] OpenMP/Fortran: Add support for OpenMP 5.2 linear clause syntax

2022-07-04 Thread Jakub Jelinek via Gcc-patches
On Mon, Jul 04, 2022 at 04:10:03PM +0200, Tobias Burnus wrote: > This patch adds support for the OpenMP 5.2 syntax for the linear clause, > following the C/C++ patch. The testcases are modified versions from the > C/C++ ones, plus one added one for duplicated modifiers. > > At least to me it is

Re: [PATCH] tree-sra: Fix union handling in build_reconstructed_reference (PR 105860)

2022-07-04 Thread Martin Jambor
Hi, On Mon, Jul 04 2022, Richard Biener wrote: > On Fri, 1 Jul 2022, Martin Jambor wrote: > >> Hi, >> >> As the testcase in PR 105860 shows, the code that tries to re-use the >> handled_component chains in SRA can be horribly confused by unions, >> where it thinks it has found a compatible

Re: [PATCH 4/12] arm: Add testsuite library support for PACBTI target

2022-07-04 Thread Andrea Corallo via Gcc-patches
Richard Earnshaw writes: > On 01/07/2022 14:03, Richard Earnshaw via Gcc-patches wrote: >> On 28/04/2022 10:40, Andrea Corallo via Gcc-patches wrote: >>> Add targeting-checking entities for PACBTI in testsuite >>> framework. >>> >>> Pre-approved with the requested changes here >>>

Re: [PATCH] Mips: Enable asynchronous unwind tables with both ASAN and TSAN

2022-07-04 Thread Dimitrije Milosevic
On Saturday, June 11, 2022 2:03 PM, Xi wrote: > Just tried TSAN_SUPPORTED=yes with asynchronous unwind tables enabled, > but I got some strange test failures for tls_race.c: > > FAIL: c-c++-common/tsan/tls_race.c   -O0  output pattern test > Output was: > ThreadSanitizer: CHECK failed:

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-04 Thread Martin Liška
On 7/1/22 08:36, Richard Biener wrote: > On Thu, Jun 30, 2022 at 10:42 AM Martin Liška wrote: >> >> On 6/30/22 08:43, Rui Ueyama wrote: >>> Thanks Martin for creating this patch. >> >> You're welcome. >> >>> >>> Here is a preliminary change for the mold side: >>>

[PATCH v2] RISC-V: Split unordered FP comparisons into individual RTL insns

2022-07-04 Thread Maciej W. Rozycki
We have unordered FP comparisons implemented as RTL insns that produce multiple machine instructions. Such RTL insns are hard to match with a processor pipeline description and additionally there is a redundant SNEZ instruction produced on the result of these comparisons even though the

[Patch] OpenMP/Fortran: Add support for OpenMP 5.2 linear clause syntax

2022-07-04 Thread Tobias Burnus
This patch adds support for the OpenMP 5.2 syntax for the linear clause, following the C/C++ patch. The testcases are modified versions from the C/C++ ones, plus one added one for duplicated modifiers. At least to me it is not quite clear when linear ( var : ref) refers to a variable 'ref' and

[PATCH] tree-optimization/106182 - LC SSA after CFG cleanup

2022-07-04 Thread Richard Biener via Gcc-patches
The testcase shows that when cleaning up the CFG we can end up with broken LC SSA (for virtual operands with the testcase). The case here involves deleting a loop after which it is not enough to scan the blocks with changed loop depth for SSA uses that need to be rewritten. So make

Re: [PATCH] lto-plugin: Add path to libatomic for riscv64

2022-07-04 Thread Martin Liška
On 7/4/22 14:28, Richard Biener wrote: > ... but ... is libatomic properly built for the host? libgo is a > target library. You're correct. Well, so the host library should be taken, which works for stage1 lto-plugin: [ 668s] libtool: link: gcc -shared -fPIC -DPIC .libs/lto-plugin.o

[PATCH] Maintain LC SSA when doing SVE vectorization

2022-07-04 Thread Richard Biener via Gcc-patches
The final loop IV use after the loop has that not in LC SSA (and inserts not simplified _2 = _3 - 0 stmts). In particular since it splits the exit edge when there's a virtual PHI in the destination it breaks virtual LC SSA form (but likely also non-virtual). The following properly inserts LC

[PATCH] Revert update-ssa assert in vectorizer

2022-07-04 Thread Richard Biener via Gcc-patches
The following reverts the just added assert that virtual SSA does not need updating. It instead goes for a select whitelist of transforms known to be prone to difficulties with virtual SSA update. Bootstrapped and tested on x86_64-unknown-linux-gnu, tested on aarch64 on the vect.exp testsuite

Re: [PATCH] lto-plugin: Add path to libatomic for riscv64

2022-07-04 Thread Richard Biener via Gcc-patches
On Mon, Jul 4, 2022 at 2:28 PM Richard Biener wrote: > > On Mon, Jul 4, 2022 at 1:32 PM Martin Liška wrote: > > > > Similarly to libgo, we need to provide -L for targets where > > libpthread does depends on libatomic. > > > > Ready for master? > > OK ... but ... is libatomic properly built for

Re: [PATCH] lto-plugin: Add path to libatomic for riscv64

2022-07-04 Thread Richard Biener via Gcc-patches
On Mon, Jul 4, 2022 at 1:32 PM Martin Liška wrote: > > Similarly to libgo, we need to provide -L for targets where > libpthread does depends on libatomic. > > Ready for master? OK > PR bootstrap/106156 > > lto-plugin/ChangeLog: > > * Makefile.am: Use PTHREAD_CFLAGS. > *

[PATCH] lto-plugin: Add path to libatomic for riscv64

2022-07-04 Thread Martin Liška
Similarly to libgo, we need to provide -L for targets where libpthread does depends on libatomic. Ready for master? PR bootstrap/106156 lto-plugin/ChangeLog: * Makefile.am: Use PTHREAD_CFLAGS. * Makefile.in: Regenerate. * configure.ac: Detect if PTHREAD_CFLAGS

Re: [PATCH] Mips: Resolve build issues for the n32 ABI

2022-07-04 Thread Richard Sandiford via Gcc-patches
Xi Ruoyao via Gcc-patches writes: > On Fri, 2022-07-01 at 12:40 +, Dimitrije Milosevic wrote: >> Building the ASAN for the n32 MIPS ABI currently fails, due to a few reasons: >> - defined(__mips64), which is set solely based on the architecture type >> (32-bit/64-bit), >> was still used in

Re: [PATCH] Keep virtual SSA up-to-date in vectorizer

2022-07-04 Thread Richard Biener via Gcc-patches
On Mon, 4 Jul 2022, Richard Biener wrote: > The following removes a FIXME where we fail(ed) to keep virtual > SSA up-to-date, patching up the remaining two cases I managed to > trigger. I've left an assert so that we pick up cases arising > for the cases I wasn't able to trigger. > >

Re: [PATCH 3/12 V2] arm: Add option -mbranch-protection

2022-07-04 Thread Richard Earnshaw via Gcc-patches
On 04/07/2022 10:27, Andrea Corallo via Gcc-patches wrote: Richard Earnshaw writes: [...] +@item +-mbranch-protection=@var{none}|@var{standard}|@var{pac-ret}[+@var{leaf}][+@var{bti}]|@var{bti}[+@var{pac-ret}[+@var{leaf}]] +@opindex mbranch-protection +Enable branch protection features

[PATCH] Keep virtual SSA up-to-date in vectorizer

2022-07-04 Thread Richard Biener via Gcc-patches
The following removes a FIXME where we fail(ed) to keep virtual SSA up-to-date, patching up the remaining two cases I managed to trigger. I've left an assert so that we pick up cases arising for the cases I wasn't able to trigger. Bootstrapped and tested on x86_64-unknown-linux-gnu, I've also

Re: [PATCH] gcc-descr: by default show revision for HEAD

2022-07-04 Thread Jakub Jelinek via Gcc-patches
On Mon, Jul 04, 2022 at 12:15:00PM +0200, Martin Liška wrote: > I've made the mistake multiple times while doing a bisection. > One would expect that gcc-descr w/o an argument would print > revision for the current HEAD and not master. > Thus change it. > > Ready to be installed? > Thanks, >

[PATCH][pushed] MAINTAINERS: fix alphabetic sorting

2022-07-04 Thread Martin Liška
ChangeLog: * MAINTAINERS: fix sorting of names --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index f4a11cdc755..7d9aab76dd9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -463,8 +463,8 @@ Andreas Jaeger

[PATCH] gcc-descr: by default show revision for HEAD

2022-07-04 Thread Martin Liška
I've made the mistake multiple times while doing a bisection. One would expect that gcc-descr w/o an argument would print revision for the current HEAD and not master. Thus change it. Ready to be installed? Thanks, Martin contrib/ChangeLog: * git-descr.sh: By default print revision for

Re: RFA: Another Rust demangler recursion limit

2022-07-04 Thread Nick Clifton via Gcc-patches
Hi Jeff, OK. Thanks. And yes, I wish someone else was looking at this stuff.  Rust isn't really on my radar right now... I have been toying with the idea of putting myself forward as a maintainer for the libiberty sources. I just wish that I had more free time... Cheers Nick

[COMMITTED] Integrate nonzero bits with irange.

2022-07-04 Thread Aldy Hernandez via Gcc-patches
The nonzero bits and integer ranges compliment each other quite well, and it only makes sense to make the mask a first class citizen in the irange. We do a half assed job of keeping ranges and nonzero bits somewhat in sync in SSA_NAME_RANGE_INFO, and the goal has always been to integrate them

[PATCH 3/12 V2] arm: Add option -mbranch-protection

2022-07-04 Thread Andrea Corallo via Gcc-patches
Richard Earnshaw writes: [...] > +@item > +-mbranch-protection=@var{none}|@var{standard}|@var{pac-ret}[+@var{leaf}][+@var{bti}]|@var{bti}[+@var{pac-ret}[+@var{leaf}]] > +@opindex mbranch-protection > +Enable branch protection features (armv8.1-m.main only). > +@samp{none} generate code without

Re: [PATCH] Use default lower bound for vector types in debug info

2022-07-04 Thread Richard Biener via Gcc-patches
On Mon, Jul 4, 2022 at 10:42 AM Eric Botcazou wrote: > > > For late generated vector types this might result in inconsistencies with > > early (user) generated types when using LTO. > > Is that a problem? That's no different with regular array types. I'm not sure - almost all types the user can

Re: [PATCH] Use default lower bound for vector types in debug info

2022-07-04 Thread Eric Botcazou via Gcc-patches
> For late generated vector types this might result in inconsistencies with > early (user) generated types when using LTO. Is that a problem? That's no different with regular array types. > Is there context available somehow so we can do like the is_ overloads > on a decl and use a default

[PATCH] Put virtual operands into loop-closed SSA

2022-07-04 Thread Richard Biener via Gcc-patches
When attempting to manually update SSA form after high-level loop transforms such as loop versioning it is helpful when the loop-closed SSA form includes virtual operands. While we have the special rewrite_virtuals_into_loop_closed_ssa function that doesn't presently scale, invoking update_ssa by

Re: [Patch][v5] OpenMP: Move omp requires checks to libgomp

2022-07-04 Thread Jakub Jelinek via Gcc-patches
On Fri, Jul 01, 2022 at 11:08:16PM +0200, Tobias Burnus wrote: >gomp_mutex_lock (_lock); > > + if (omp_requires_mask && omp_requires_mask != omp_req) I'd use if (omp_req && omp_requires_mask && omp_requires_mask != omp_req) e.g. for the case of mixing GCC <= 12 compiled code with GCC 13,

Re: [PATCH] Use default lower bound for vector types in debug info

2022-07-04 Thread Richard Biener via Gcc-patches
On Mon, Jul 4, 2022 at 10:03 AM Eric Botcazou via Gcc-patches wrote: > > Hi, > > vector types are represented as array types with DW_AT_GNU_vector attribute in > the debug info and a range [0 .. TYPE_VECTOR_SUBPARTS - 1]. That's obviously > skewed toward the C family of languages, therefore the

Re: [PATCH][wwwdocs] gcc-12/changes.html: document LoongArch -m{no-,}check-zero-division default change for 12.2

2022-07-04 Thread Richard Biener via Gcc-patches
On Mon, Jul 4, 2022 at 9:12 AM Xi Ruoyao wrote: > > Document a behavior change in r12-8546. Ok for wwwdocs? OK. > --- > htdocs/gcc-12/changes.html | 26 ++ > 1 file changed, 26 insertions(+) > > diff --git a/htdocs/gcc-12/changes.html b/htdocs/gcc-12/changes.html >

[Ada] Use static stack allocation for small string if-expressions

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
This changes the expanded code generated for if-expressions of 1-dimensional arrays to create a static temporary on the stack if a small upper bound can be computed for the length of a subtype covering the result. Static stack allocation is preferred over dynamic allocation for code generation

[Ada] Enforce deferred constant completion rules

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
If a constrained subtype is given when a deferred constant is declared, then the subtype given in the completion is required (at compile time) to be subject to a statically matching constraint. This rule was not properly enforced in some cases and constructs that should have been rejected were

[Ada] Fix missing error on 'Access of constrained array

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
For X'Access, the designated subtype of the access type must statically match the nominal subtype of X. This patch fixes a bug where the error was not detected when there is an unrelated declaration of the form "Y : T := X;", where T is an unconstrained array subtype. Tested on

[Ada] Call-initialize all controlled objects in place

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
This changes the compiler to build in place almost all objects that need finalization and are initialized with the result of a function call, thus saving a pair of Adjust/Finalize calls for the anonymous return object. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ *

[Ada] Do not make procedure call with only tag-indeternminate actuals dispatching

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
The RM 3.9.2(19) clause says that the controlling tag value is statically determined to be the tag of the tagged type involved. As a matter of fact, the call would be made dispatching only as a by-product of the propagation of the controlling tag value to the tag-indeternminate actuals, but

[Ada] Add Ada 2022 Key function to sets containers

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
This patch adds the new Generic_Keys.Key function to the set children of Ada.Containers. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/a-cbhase.ads, libgnat/a-cborse.ads, libgnat/a-cihase.ads, libgnat/a-ciorse.ads, libgnat/a-cohase.ads,

[PATCH] Use default lower bound for vector types in debug info

2022-07-04 Thread Eric Botcazou via Gcc-patches
Hi, vector types are represented as array types with DW_AT_GNU_vector attribute in the debug info and a range [0 .. TYPE_VECTOR_SUBPARTS - 1]. That's obviously skewed toward the C family of languages, therefore the attached patch changes the lower bound to the default for the language of the

[Ada] vx7r2: do not include s-qnx.ads in the kernel and rtp runtimes

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
Target specific runtime files must be added to a the exclude list so the files don't automatically get copied to other runtimes. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * Makefile.rtl (ADA_EXCLUDE_SRCS): Add s-qnx.ads.diff --git a/gcc/ada/Makefile.rtl

[Ada] Avoid unwanted warnings for statically-known-successful assertions

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
The -gnatwc switch enables warnings for test condition outcomes that are known at compile time. Such warnings are unlikely to be useful in the case of an assertion expression (or a subexpression thereof), so do not generate them in that case. Tested on x86_64-pc-linux-gnu, committed on trunk

[Ada] Small housekeeping work in Expand_N_Object_Declaration

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
The local function Rewrite_As_Renaming can be called twice in certain circumstances, which is both not quite safe and unnecessary, so this replaces it with a local variable whose value is computed only once. No functional changes. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/

[Ada] Fix dispatching call to primitive function with controlling tagged result

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
When a dispatching call is made to a primitive function with a controlling tagged result, the call is dispatching on result and thus must return the class-wide type of the tagged type to accommodate all possible results. This was ensured by Expand_Dispatching_Call only in the common case where

[Ada] Add a RM entry for the functional infinite sequences

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
Modify the RM to take into account the new functional container. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * doc/gnat_rm/the_gnat_library.rst: Add the new entry. * gnat_rm.texi: Regenerate. patch.diff.gz Description: application/gzip

[Ada] Use static stack allocation for small dynamic string concatenations

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
This changes the expanded code generated for dynamic concatenations to use a static array subtype for the temporary created on the stack if a small upper bound can be computed for the length of the result. Static stack allocation is preferred over dynamic allocation for code generation purposes.

[Ada] Refactor duplicated resolution of Count and Index attributes

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
Attribute Index, which was added to Ada 2022 by AI12-0143, is resolved just like attribute Count. However, code duplication rightly triggered a CodePeer warning. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_attr.adb (Resolve_Attribute): Refactor duplicated code for

[Ada] Give missing error on ambiguous operand of equality operator

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
When the code responsible for giving errors on ambiguous operands of comparison and equality operators was moved from the 1st phase (analysis) to the 2nd phase (resolution) of semantic processing, it was incorrectly restricted to the operator case, which was valid during the 1st phase but is not

[Ada] Do not use front-end build-in-place mechanism for nonlimited types

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
It was only used in specific cases for controlled types but no longer provides any significant benefit in practice. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * debug.adb (d.9): Remove usage. * exp_ch6.adb (Expand_Simple_Function_Return): Remove redundant

[Ada] Single character argument in call to Quote_Argument raises error

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
This patch corrects an issue in the compiler whereby calling Quote_Argument with an argument that is of size 1 may lead to a CONSTRAINT_ERROR raised at runtime due to an undersized buffer. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-os_lib.adb

[Ada] Add GNAT specific pragmas to the equivalent Assertion_Policy for -gnata

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
All assertion pragmas are enabled by default when using -gnata. We need to add the GNAT specific ones to the list. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Debugging and Assertion Control): Add GNAT

[Ada] Assertions in Einfo.Utils

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
Add predicates on subtypes E and N. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * einfo-utils.ads, einfo-utils.adb: Add predicates on subtypes E and N. Change some parameters to use the unpredicated subtypes, because they sometimes return e.g. Empty.

[Ada] Add Ada 2022 features to sets containers

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
This patch adds some Ada 2022 features to the set children of Ada.Containers. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/a-cbhase.adb, libgnat/a-cbhase.ads, libgnat/a-cborse.adb, libgnat/a-cborse.ads, libgnat/a-cihase.adb, libgnat/a-cihase.ads,

[Ada] Compiler rejects legal allocator in record component constraint expression

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
In some cases when a legal allocator which defines a new subtype for the allocated object occurs as part of a record component constraint expression, the compiler would incorrectly reject the allocator. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch4.adb

[Ada] Tech debt: Remove code duplication

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
This patch corrects removes some code duplication within the GNAT compiler. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_util.adb (Remove_Side_Effects): Combine identical branches. * sem_attr.adb (Analyze_Attribute): Combine identical cases

[Ada] Update the documentation of functional containers

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
Functional containers are now controlled. Update the documentation accordingly. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * doc/gnat_rm/the_gnat_library.rst: Functional vectors, sets, and maps are now controlled. * gnat_rm.texi: Regenerate.diff --git

[Ada] Create new unbounded functional sequence

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
Add a new unbounded functional sequence. This sequence is indexed by Big_Positive and so is unbounded from the user and spark points view. Hower the actually implemented sequence are bounded by Count_Type'Last. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ *

[Ada] Fix for resolution of overloaded subprogram for Iterable aspect

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
When resolving the Iterable aspect we look for a functions that are declared in the same scope as the annotated type and that have the required number and types formal parameters. However, we didn't guard against functions that have no formal parameter at all. Tested on x86_64-pc-linux-gnu,

[Ada] Incorrect accessibility check on return of discriminated type

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
This patch corrects an error in the compiler whereby the presence of a call to a function returning a type with an access discriminant within an expanded loop condition caused the wrong value to be supplied for the extra- accessibility-of-result actual, thus causing incorrect checks within the

[Ada] Adjust description of Pure_Function pragma

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
The current wording can be read as implying that the result of a call to a pure function does not depend on the context, which is incorrect. The pragma only guarantees the absence of side effects of such a call. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ *

[Ada] Plug loophole for built-in-place return with limited_with clause

2022-07-04 Thread Pierre-Marie de Rodat via Gcc-patches
When the result type of a function requiring built-in-place return is only visible through a limited_with clause, the compiled needs to wait for the nonlimited view to be available in order to compute whether the built-in-place return is needed, and this comprises tagging the function with the

[PATCH][wwwdocs] gcc-12/changes.html: document LoongArch -m{no-,}check-zero-division default change for 12.2

2022-07-04 Thread Xi Ruoyao via Gcc-patches
Document a behavior change in r12-8546. Ok for wwwdocs? --- htdocs/gcc-12/changes.html | 26 ++ 1 file changed, 26 insertions(+) diff --git a/htdocs/gcc-12/changes.html b/htdocs/gcc-12/changes.html index ae03c3c6..ef957204 100644 --- a/htdocs/gcc-12/changes.html +++

[PATCH] tree-optimization/106055 - issue with autopar

2022-07-04 Thread Richard Biener via Gcc-patches
When autopar uses graphites canonicalize_loop_closed_ssa it fails to check whether propagation is allowed and thus it ends up messing up abnormal constraints. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. 2022-07-01 Richard Biener PR tree-optimization/106055 *

[PATCH] HIGH part of symbol ref is invalid for constant pool

2022-07-04 Thread Jiufu Guo via Gcc-patches
The high part of the symbol address is invalid for the constant pool. In function rs6000_cannot_force_const_mem, we already return true for "HIGH with UNSPEC" rtx. During debug GCC, I found that rs6000_cannot_force_const_mem is called for some other HIGH code rtx expressions which also indicate

Re: [PATCH] loongarch: use -mno-check-zero-division as the default for optimized code

2022-07-04 Thread Xi Ruoyao via Gcc-patches
On Mon, 2022-07-04 at 14:25 +0800, Lulu Cheng wrote: > > How do you think about the suggestion from Richard about a backport into > > gcc-12 branch?  Normally we don't backport behavior changes, but making > > 12.1 the only exception seems compelling. > > I agree with you and Richard. > >

Re: [PATCH] aarch64: Fix pure/const function attributes for intrinsics

2022-07-04 Thread Richard Biener via Gcc-patches
On Fri, Jul 1, 2022 at 5:59 PM Andrew Carlotti wrote: > > On Fri, Jul 01, 2022 at 08:42:15AM +0200, Richard Biener wrote: > > On Thu, Jun 30, 2022 at 6:04 PM Andrew Carlotti via Gcc-patches > > wrote: > > > diff --git a/gcc/config/aarch64/aarch64-builtins.cc > > >

Re: [GCC 13][PATCH] PR101836: Add a new option -fstrict-flex-array[=n] and use it in __builtin_object_size

2022-07-04 Thread Richard Biener via Gcc-patches
On Fri, Jul 1, 2022 at 5:32 PM Martin Sebor wrote: > > On 7/1/22 08:01, Qing Zhao wrote: > > > > > >> On Jul 1, 2022, at 8:59 AM, Jakub Jelinek wrote: > >> > >> On Fri, Jul 01, 2022 at 12:55:08PM +, Qing Zhao wrote: > >>> If so, comparing to the current implemenation to have all the checking

Re: [PATCH v2, rs6000] Use CC for BCD operations [PR100736]

2022-07-04 Thread HAO CHEN GUI via Gcc-patches
Hi, Gentle ping this: https://gcc.gnu.org/pipermail/gcc-patches/2022-June/597020.html Thanks. On 22/6/2022 下午 4:26, HAO CHEN GUI wrote: > Hi, > This patch uses CC instead of CCFP for all BCD operations. Thus, infinite > math flag has no impact on BCD operations. To support BCD overflow and >

Ping [PATCH v6, rs6000] Implemented f[min/max]_optab by xs[min/max]dp [PR103605]

2022-07-04 Thread HAO CHEN GUI via Gcc-patches
Hi, Gentle ping this: https://gcc.gnu.org/pipermail/gcc-patches/2022-June/597158.html Thanks. On 24/6/2022 上午 10:02, HAO CHEN GUI wrote: > Hi, > This patch implements optab f[min/max]_optab by xs[min/max]dp on rs6000. > Tests show that outputs of xs[min/max]dp are consistent with the

[PATCH v3, rs6000] Disable TImode from Bool expanders [PR100694, PR93123]

2022-07-04 Thread HAO CHEN GUI via Gcc-patches
Hi, This patch fails TImode for all 128-bit logical operation expanders. So TImode splits to two DI registers during expand. Potential optimizations can be taken after expand pass. Originally, the TImode logical operations are split after reload pass. It's too late. The test case illustrates it.

Re: [PATCH] loongarch: use -mno-check-zero-division as the default for optimized code

2022-07-04 Thread Lulu Cheng
在 2022/7/3 上午11:06, Xi Ruoyao 写道: On Sat, 2022-07-02 at 16:35 +0800, Lulu Cheng wrote: 在 2022/7/2 下午4:24, Xi Ruoyao 写道: I'll commit the patch with the hook removed after another regtest on loongarch64-linux-gnu.  I just rebuilt the entire system on my 3A5000, so I need some time to set it

Re: [PATCH] i386: Extend cvtps2pd to memory

2022-07-04 Thread Uros Bizjak via Gcc-patches
On Mon, Jul 4, 2022 at 7:10 AM Jiang, Haochen wrote: > > Hi all, > > I revised my patch according to all your reviews. > > Regtested on x86_64-pc-linux-gnu. OK. Thanks, Uros. > > BRs, > Haochen > > > -Original Message- > > From: Liu, Hongtao > > Sent: Thursday, June 30, 2022 4:57 PM >

Re: [PATCH] tree-sra: Fix union handling in build_reconstructed_reference (PR 105860)

2022-07-04 Thread Richard Biener via Gcc-patches
On Fri, 1 Jul 2022, Martin Jambor wrote: > Hi, > > As the testcase in PR 105860 shows, the code that tries to re-use the > handled_component chains in SRA can be horribly confused by unions, > where it thinks it has found a compatible structure under which it can > chain the references, but in