[Ada] Missing accessibility check when returning discriminated types

2021-10-20 Thread Pierre-Marie de Rodat via Gcc-patches
In some cases where a function result type has an access discriminant part, Ada requires that the execution of a return statement include a check that the access discriminant does not designate an object whose accessibility level is too deep (Ada RM 6.5(21)). This check was being incorrectly omitte

[Ada] Reject boxes in delta record aggregates

2021-10-20 Thread Pierre-Marie de Rodat via Gcc-patches
Implement Ada 2022 4.3.1(17.3/5), prevents box compound delimiter <> to appear in record delta aggregates. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_aggr.adb (Resolve_Delta_Record_Aggregate): Reject boxes in record delta aggregates.diff --git a/gcc/ada/sem_

[Ada] Factor out machine rounding operations

2021-10-20 Thread Pierre-Marie de Rodat via Gcc-patches
The RM 4.9(38/2) clause specifies that the rounding to be applied to a real static expression that is not part of a larger static expression is implementation defined, so it makes sense to have a single function implementing the operation. The change also sets the Is_Machine_Number flag more consi

[Ada] Fix problematic conversion of real literal in static context

2021-10-20 Thread Pierre-Marie de Rodat via Gcc-patches
This gets rid of a bogus error issued for the conversion to a static floating-point subtype of a named number which is not a machine number of this floating-point subtype but happens to be very close (or equal) to one of the nominal bounds of the subtype. This conversion may not change the value o

[Ada] Provide dummy body for big integers library used in reduced runtimes

2021-10-20 Thread Pierre-Marie de Rodat via Gcc-patches
The version of Ada.Numerics.Big_Numbers.Big_Integers used in the light and embedded runtimes is only meant for proof, not execution. As a result, all subprograms were previously marked as imported, but this leads to a spurious compilation error in GNAT. Work around that bug for now by providing a d

[Ada] Proof of the runtime support for attribute 'Width

2021-10-20 Thread Pierre-Marie de Rodat via Gcc-patches
This proves the absence of runtime errors and the functional spec of function System.Width_U which implements the runtime support for attribute 'Width. It requires using the library unit Ada.Numerics.Big_Numbers.Big_Integers because it was not possible to achieve even absence of runtime errors by

[Ada] Remove unnecessary call to No_Uint_To_0

2021-10-20 Thread Pierre-Marie de Rodat via Gcc-patches
This call to No_Uint_To_0 was unnecessary. We should try to remove all calls to No_Uint_To_0; they are all questionable. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * gcc-interface/decl.c (gnat_to_gnu_entity): Remove unnecessary call to No_Uint_To_0.diff --git a/gc

Re: [PATCH] calls.c: Remove some dead code and target hooks

2021-10-20 Thread Jeff Law via Gcc-patches
On 10/20/2021 8:18 AM, Alex Coplan via Gcc-patches wrote: Hi all, Looking at calls.c:initialize_argument_information, I spotted some dead code that seems to have been left behind from when MPX support was removed. This patch removes that code as well as the associated target hooks (which app

Re: [PATCH 4/4] Improve maybe_remove_writeonly_store to do a simple DCE for defining statement

2021-10-20 Thread Jeff Law via Gcc-patches
On 10/20/2021 12:58 AM, Richard Biener wrote: On Wed, Oct 20, 2021 at 1:14 AM Jeff Law via Gcc-patches wrote: On 10/18/2021 10:54 PM, apinski--- via Gcc-patches wrote: From: Andrew Pinski Instead of putting a full blow DCE after execute_fixup_cfg, it makes sense to try to remove the def

Re: [PATCH 4/4] Improve maybe_remove_writeonly_store to do a simple DCE for defining statement

2021-10-20 Thread Andrew Pinski via Gcc-patches
On Wed, Oct 20, 2021 at 12:54 PM Jeff Law via Gcc-patches wrote: > > > > On 10/20/2021 12:58 AM, Richard Biener wrote: > > On Wed, Oct 20, 2021 at 1:14 AM Jeff Law via Gcc-patches > > wrote: > >> > >> > >> On 10/18/2021 10:54 PM, apinski--- via Gcc-patches wrote: > >>> From: Andrew Pinski > >>>

Re: [PATCH] Try to resolve paths in threader without looking further back.

2021-10-20 Thread Jeff Law via Gcc-patches
On 10/20/2021 9:15 AM, Aldy Hernandez wrote: On Wed, Oct 20, 2021 at 4:35 PM Martin Sebor wrote: I appreciate the heads up. I'm happy that the threader has improved. I'm obviously not pleased that it has led to regressions in warnings but I understand that in some cases they might be due

[PATCH] Fortran: Fixes and additional tests for shape/ubound/size [PR94070]

2021-10-20 Thread Sandra Loosemore
This patch started out as some additional testcases for the SHAPE, UBOUND, and SIZE intrinsic extensions for assumed-rank arrays added by TS29113; I realized a while ago that I had not added test coverage for polymorphic arguments. My guess that this was a likely trouble spot was correct as th

Re: [PATCH] Try to resolve paths in threader without looking further back.

2021-10-20 Thread Jeff Law via Gcc-patches
On 10/20/2021 4:28 AM, Aldy Hernandez wrote: Sometimes we can solve a candidate path without having to recurse further back. This can mostly happen in fully resolving mode, because we can ask the ranger what the range on entry to the path is, but there's no reason this can't always apply. Th

Re: [PATCH] Convert strlen pass from evrp to ranger.

2021-10-20 Thread Jeff Law via Gcc-patches
On 10/18/2021 2:17 AM, Aldy Hernandez wrote: On 10/18/21 12:52 AM, Jeff Law wrote: On 10/8/2021 9:12 AM, Aldy Hernandez via Gcc-patches wrote: The following patch converts the strlen pass from evrp to ranger, leaving DOM as the last remaining user. So is there any reason why we can't con

Re: [PATCH v4] Fix ICE when mixing VLAs and statement expressions [PR91038]

2021-10-20 Thread Jason Merrill via Gcc-patches
On 10/20/21 01:58, Uecker, Martin wrote: Am Montag, den 18.10.2021, 12:35 -0400 schrieb Jason Merrill: On 10/17/21 09:52, Uecker, Martin wrote: Here is the 4th version of the patch. I tried to implement Jason's suggestion and this also fixes the problem. But I am not sure I understand the cond

[PATCH] c++: tweak parsing of invalid types

2021-10-20 Thread Jason Merrill via Gcc-patches
cp_parser_parse_and_diagnose_invalid_type_name is called during declaration parsing, so it should pass 'true' for the declarator_p argument. But that caused a diagnostic regression on template/pr84789.C due to undesired lookup in dependent scopes. To fix that, cp_parser_nested_name_specifier_opt

Re: [PATCH] Fortran: Fixes and additional tests for shape/ubound/size [PR94070]

2021-10-20 Thread Tobias Burnus
Hi Sandra, On 20.10.21 22:03, Sandra Loosemore wrote: The one that was most concerning was an ICE when calling the SHAPE intrinsic with an assumed-rank class type argument ... In this case, SHAPE was calling a library function and trying to copy the array contents to a temporary, which is really

Re: [PATCH, v2] c++: Diagnose taking address of an immediate member function [PR102753]

2021-10-20 Thread Jason Merrill via Gcc-patches
On 10/19/21 08:00, Jakub Jelinek wrote: On Mon, Oct 18, 2021 at 12:42:00PM -0400, Jason Merrill wrote: --- gcc/cp/typeck.c.jj 2021-10-05 09:53:55.382734051 +0200 +++ gcc/cp/typeck.c 2021-10-15 19:28:38.034213437 +0200 @@ -6773,9 +6773,21 @@ cp_build_addr_expr_1 (tree arg, bool str

Re: [PATCH] c++: Reject addresses of immediate functions in constexpr vars inside of immediate functions or consteval if [PR102753]

2021-10-20 Thread Jason Merrill via Gcc-patches
On 10/19/21 09:24, Jakub Jelinek wrote: On Tue, Oct 19, 2021 at 02:00:21PM +0200, Jakub Jelinek via Gcc-patches wrote: And another thing isn't in a patch, but I'm wondering whether we don't handle it incorrectly. constexpr.c has: /* Check that immediate invocation does not return an expressi

Re: [PATCH] doc: Fix documentation around 'asm' keyword in C++

2021-10-20 Thread Jason Merrill via Gcc-patches
On 10/20/21 08:28, Jonathan Wakely wrote: The documentation on asm statements suggests asm is always a GNU extension, but it's been part of ISO C++ since the first standard. The documentation of -fno-asm is wrong for C++ as it states that it only affects typeof, but actually it affects typeof an

[committed] libstdc++: Remove constraints from std::optional monadic ops [PR102863]

2021-10-20 Thread Jonathan Wakely via Gcc-patches
The constraints on transform and and_then can cause errors when checking satisfaction. The constraints that were present in R6 of the paper were moved for he final F8 revision, and so should have been included in the implementation. libstdc++-v3/ChangeLog: PR libstdc++/102863 * in

Re: [committed] libstdc++: Remove constraints from std::optional monadic ops [PR102863]

2021-10-20 Thread Jonathan Wakely via Gcc-patches
On 21/10/21 01:23 +0100, Jonathan Wakely wrote: The constraints on transform and and_then can cause errors when checking satisfaction. The constraints that were present in R6 of the paper were moved for he final F8 revision, and so should have been included in the Bah, I meant "removed for the

Re: [PATCH] Adjust testcase for O2 vectorization.

2021-10-20 Thread Hongtao Liu via Gcc-patches
On Wed, Oct 20, 2021 at 7:34 PM Christophe Lyon via Gcc-patches wrote: > > Hi, > > > On Tue, Oct 19, 2021 at 11:03 AM liuhongt via Gcc-patches < > gcc-patches@gcc.gnu.org> wrote: > > > updated patch: > > 1. Add documents in doc/sourcebuild.texi (Effective-Target Keywords). > > 2. Reduce -novec

[r12-4559 Regression] FAIL: gcc.dg/vect/bb-slp-57.c scan-tree-dump-times slp1 "transform load" 1 on Linux/x86_64

2021-10-20 Thread sunil.k.pandey via Gcc-patches
On Linux/x86_64, 914045dff10fbd27de27b90a0ac78a0058b2c86e is the first bad commit commit 914045dff10fbd27de27b90a0ac78a0058b2c86e Author: Andre Simoes Dias Vieira Date: Wed Oct 20 13:12:09 2021 +0100 [Patch][GCC][middle-end] - Generate FRINTZ for (double)(int) under -ffast-math on aarch64

[r12-4523 Regression] FAIL: gcc.dg/Wstringop-overflow-14.c (test for excess errors) on Linux/x86_64

2021-10-20 Thread sunil.k.pandey via Gcc-patches
On Linux/x86_64, 3c8d8c0be95e99dc0cba7f6fad2429243582119f is the first bad commit commit 3c8d8c0be95e99dc0cba7f6fad2429243582119f Author: liuhongt Date: Thu Oct 14 09:31:03 2021 +0800 Adjust testcase for O2 vectorization. caused FAIL: gcc.dg/Warray-bounds-51.c (test for excess errors) FA

[r12-4531 Regression] FAIL: gcc.target/i386/pr57106.c (test for excess errors) on Linux/x86_64

2021-10-20 Thread sunil.k.pandey via Gcc-patches
On Linux/x86_64, 972ee845f54839e9bd2e4611bb268d75440f3845 is the first bad commit commit 972ee845f54839e9bd2e4611bb268d75440f3845 Author: Eric Botcazou Date: Wed Oct 20 10:42:56 2021 +0200 Fix PR middle-end/102764 caused FAIL: gcc.dg/asan/pr78832.c -O1 (test for excess errors) FAIL: g

[PATCH] rs6000: Add Power10 optimization for _mm_blendv*

2021-10-20 Thread Paul A. Clarke via Gcc-patches
Power10 ISA added `xxblendv*` instructions which are realized in the `vec_blendv` instrinsic. Use `vec_blendv` for `_mm_blendv_epi8`, `_mm_blendv_ps`, and `_mm_blendv_pd` compatibility intrinsics, when `_ARCH_PWR10`. Also, copy a test from i386 for testing `_mm_blendv_ps`. This should have come w

Re: [PATCH] Adjust testcase for O2 vectorization.

2021-10-20 Thread Hongtao Liu via Gcc-patches
On Thu, Oct 21, 2021 at 9:20 AM Hongtao Liu wrote: > > On Wed, Oct 20, 2021 at 7:34 PM Christophe Lyon via Gcc-patches > wrote: > > > > Hi, > > > > > > On Tue, Oct 19, 2021 at 11:03 AM liuhongt via Gcc-patches < > > gcc-patches@gcc.gnu.org> wrote: > > > > > updated patch: > > > 1. Add documents

Re: [PATCH] Adjust testcase for O2 vectorization.

2021-10-20 Thread Hongtao Liu via Gcc-patches
On Thu, Oct 21, 2021 at 10:06 AM Hongtao Liu wrote: > > On Thu, Oct 21, 2021 at 9:20 AM Hongtao Liu wrote: > > > > On Wed, Oct 20, 2021 at 7:34 PM Christophe Lyon via Gcc-patches > > wrote: > > > > > > Hi, > > > > > > > > > On Tue, Oct 19, 2021 at 11:03 AM liuhongt via Gcc-patches < > > > gcc-pa

Re: [PATCH] Fortran: Fixes and additional tests for shape/ubound/size [PR94070]

2021-10-20 Thread Sandra Loosemore
On 10/20/21 3:41 PM, Tobias Burnus wrote: Hi Sandra, On 20.10.21 22:03, Sandra Loosemore wrote: The one that was most concerning was an ICE when calling the SHAPE intrinsic with an assumed-rank class type argument ... In this case, SHAPE was calling a library function and trying to copy the ar

Re: [PATCH] i386: Fix wrong codegen for V8HF move without TARGET_AVX512F

2021-10-20 Thread Hongtao Liu via Gcc-patches
On Wed, Oct 20, 2021 at 1:31 PM Hongyu Wang via Gcc-patches wrote: > > Since _Float16 type is enabled under sse2 target, returning > V8HFmode vector without AVX512F target would generate wrong > vmovdqa64 instruction. Adjust ix86_get_ssemov to avoid this. > > Bootstraped/regtested on x86_64-pc-lin

[PATCH] Improve maybe_remove_writeonly_store to do a simple DCE for defining statement

2021-10-20 Thread apinski--- via Gcc-patches
From: Andrew Pinski Instead of putting a full blow DCE after execute_fixup_cfg, it makes sense to try to remove the defining statement for the store that is being removed. Using simple_dce_from_worklist makes this easier, just mark the ssa_name on the rhs side of the store (if it was one) in a bi

Re: [PATCH] i386: Fix wrong codegen for V8HF move without TARGET_AVX512F

2021-10-20 Thread Hongyu Wang via Gcc-patches
Yes, updated patch. gcc/ChangeLog: PR target/102812 * config/i386/i386.c (ix86_get_ssemov): Adjust HFmode vector move to use the same logic as HImode. gcc/testsuite/ChangeLog: PR target/102812 * gcc.target/i386/pr102812.c: New test. --- gcc/config/i386/i386.c | 15 -

Re: [Patch][GCC][middle-end] - Lower store and load neon builtins to gimple

2021-10-20 Thread Christophe LYON via Gcc-patches
On 20/10/2021 12:16, Richard Biener via Gcc-patches wrote: On Wed, 20 Oct 2021, Andre Vieira (lists) wrote: On 27/09/2021 12:54, Richard Biener via Gcc-patches wrote: On Mon, 27 Sep 2021, Jirui Wu wrote: Hi all, I now use the type based on the specification of the intrinsic instead of typ

Re: [PATCH, rs6000] Disable gimple fold for float or double vec_minmax when fast-math is not set

2021-10-20 Thread HAO CHEN GUI via Gcc-patches
On 21/10/2021 上午 12:19, Segher Boessenkool wrote: > Hi! > > On Wed, Oct 20, 2021 at 05:04:56PM +0800, HAO CHEN GUI wrote: >> This patch disables gimple folding for float or double vec_min/max when  >> fast-math is not set. It makes vec_min/max conform with the guide. >> >> Bootstrapped and tested

<    1   2