Re: [PATCH] Use bit-CCP in range-ops.

2022-11-08 Thread Aldy Hernandez via Gcc-patches
Pushed. I'd still love to hear feedback though ;-). Aldy On Sun, Nov 6, 2022 at 5:14 PM Aldy Hernandez wrote: > > After Jakub and Richi's suggestion of using the same representation > for tracking known bits as we do in CCP, I took a peek at the code and > realized there's a plethora of bit-tra

Re: [PATCH] [PR24021] Implement PLUS_EXPR range-op entry for floats.

2022-11-08 Thread Aldy Hernandez via Gcc-patches
On Tue, Nov 8, 2022 at 3:11 PM Jakub Jelinek wrote: > > On Tue, Nov 08, 2022 at 03:06:53PM +0100, Aldy Hernandez wrote: > > +// If either operand is a NAN, set R to the combination of both NANs > > +// signwise and return TRUE. > > This comment doesn't describe what it does now. > If either operan

Re: [PATCH] [PR24021] Implement PLUS_EXPR range-op entry for floats.

2022-11-08 Thread Jakub Jelinek via Gcc-patches
On Tue, Nov 08, 2022 at 03:06:53PM +0100, Aldy Hernandez wrote: > +// If either operand is a NAN, set R to the combination of both NANs > +// signwise and return TRUE. This comment doesn't describe what it does now. If either operand is a NAN, set R to NAN with unspecified sign bit and return TRUE

Re: [PATCH] [PR24021] Implement PLUS_EXPR range-op entry for floats.

2022-11-08 Thread Aldy Hernandez via Gcc-patches
On Tue, Nov 8, 2022 at 2:50 PM Jakub Jelinek wrote: > > On Tue, Nov 08, 2022 at 02:47:35PM +0100, Aldy Hernandez wrote: > > Well, perhaps we should just nuke update_nan_sign() altogether, and > > always keep the sign varying? > > > > inline bool > > propagate_nans (frange &r, const frange &op1, co

Re: [PATCH] [PR24021] Implement PLUS_EXPR range-op entry for floats.

2022-11-08 Thread Jakub Jelinek via Gcc-patches
On Tue, Nov 08, 2022 at 03:02:40PM +0100, Aldy Hernandez wrote: > From d02ce8eaf16d2fc6db6472268fd962e09c2fd81e Mon Sep 17 00:00:00 2001 > From: Aldy Hernandez > Date: Mon, 7 Nov 2022 14:18:57 +0100 > Subject: [PATCH] Provide normalized and denormal format version of > real_isdenormal. > > Imple

Re: [PATCH] [PR24021] Implement PLUS_EXPR range-op entry for floats.

2022-11-08 Thread Aldy Hernandez via Gcc-patches
On Tue, Nov 8, 2022 at 2:15 PM Jakub Jelinek wrote: > > On Tue, Nov 08, 2022 at 01:47:58PM +0100, Aldy Hernandez wrote: > > On Tue, Nov 8, 2022 at 12:07 PM Jakub Jelinek wrote: > > > > > > On Mon, Nov 07, 2022 at 04:38:29PM +0100, Aldy Hernandez wrote: > > > > From d214bcdff2cb90ad1eb808d29bda6fb

Announcement: Porting the Docs to Sphinx - tomorrow

2022-11-08 Thread Martin Liška
Hi. Tomorrow in the morning (UTC time), I'm going to migrate the documentation to Sphinx. The final version of the branch can be seen here: $ git fetch origin refs/users/marxin/heads/sphinx-final $ git co FETCH_HEAD URL: https://splichal.eu/gccsphinx-final/ TL;DR; After the migration, people

Re: [PATCH] [PR24021] Implement PLUS_EXPR range-op entry for floats.

2022-11-08 Thread Jakub Jelinek via Gcc-patches
On Tue, Nov 08, 2022 at 02:47:35PM +0100, Aldy Hernandez wrote: > Well, perhaps we should just nuke update_nan_sign() altogether, and > always keep the sign varying? > > inline bool > propagate_nans (frange &r, const frange &op1, const frange &op2) > { > if (op1.known_isnan () || op2.known_isnan

Re: [PATCH] [PR24021] Implement PLUS_EXPR range-op entry for floats.

2022-11-08 Thread Aldy Hernandez via Gcc-patches
On Tue, Nov 8, 2022 at 2:25 PM Jakub Jelinek wrote: > > On Tue, Nov 08, 2022 at 02:06:58PM +0100, Aldy Hernandez wrote: > > + gcc_checking_assert (!r.nan_signbit_p (sign1)); > > + if (op1_nan && op2_nan) > > +{ > > + // If boths signs agree, we could use that sign, but IEEE754 > > +

Re: [PATCH] invoke: RISC-V's -march doesn't take ISA strings

2022-11-08 Thread Christoph Müllner
On Mon, Nov 7, 2022 at 8:01 PM Palmer Dabbelt wrote: > The docs say we take ISA strings, but that's never really been the case: > at a bare minimum we've required lower case strings, but there's > generally been some subtle differences as well in things like version > handling and such. We talke

Re: [PATCH][v2] tree-optimization/107389 - honor __builtin_assume_alignment at -O0

2022-11-08 Thread Richard Biener via Gcc-patches
On Tue, 8 Nov 2022, Jakub Jelinek wrote: > On Tue, Nov 08, 2022 at 01:53:48PM +0100, Richard Biener wrote: > > The following makes sure to set alignment information on the LHS > > of __builtin_assume_alignment calls even when not optimizing so > > uses as arguments to builtin functions like memcpy

Re: [PATCH] [PR24021] Implement PLUS_EXPR range-op entry for floats.

2022-11-08 Thread Jakub Jelinek via Gcc-patches
On Tue, Nov 08, 2022 at 02:06:58PM +0100, Aldy Hernandez wrote: > + gcc_checking_assert (!r.nan_signbit_p (sign1)); > + if (op1_nan && op2_nan) > +{ > + // If boths signs agree, we could use that sign, but IEEE754 > + // does not guarantee this for a binary operator. The x86_64 > +

Re: [PATCH v2 16/19] modula2 front end: bootstrap and documentation tools

2022-11-08 Thread Gaius Mulley via Gcc-patches
Martin Liška writes: > 1) I would prefer using ' instead of ": > > $ flake8 ./gcc/m2/tools-src/tidydates.py > ... > ./gcc/m2/tools-src/tidydates.py:124:30: Q000 Double quotes found but single > quotes preferred > ./gcc/m2/tools-src/tidydates.py:127:27: Q000 Double quotes found but single > quot

Re: [PATCH] [PR24021] Implement PLUS_EXPR range-op entry for floats.

2022-11-08 Thread Jakub Jelinek via Gcc-patches
On Tue, Nov 08, 2022 at 01:47:58PM +0100, Aldy Hernandez wrote: > On Tue, Nov 8, 2022 at 12:07 PM Jakub Jelinek wrote: > > > > On Mon, Nov 07, 2022 at 04:38:29PM +0100, Aldy Hernandez wrote: > > > From d214bcdff2cb90ad1eb808d29bda6fb98d510b4c Mon Sep 17 00:00:00 2001 > > > From: Aldy Hernandez >

Re: [PATCH] [PR24021] Implement PLUS_EXPR range-op entry for floats.

2022-11-08 Thread Aldy Hernandez via Gcc-patches
On Tue, Nov 8, 2022 at 12:20 PM Jakub Jelinek wrote: > > On Mon, Nov 07, 2022 at 04:41:23PM +0100, Aldy Hernandez wrote: > > As suggested upthread, I have also adjusted update_nan_sign() to drop > > the NAN sign to VARYING if both operands are NAN. As an optimization > > I keep the sign if both o

Re: [PATCH][v2] tree-optimization/107389 - honor __builtin_assume_alignment at -O0

2022-11-08 Thread Jakub Jelinek via Gcc-patches
On Tue, Nov 08, 2022 at 01:53:48PM +0100, Richard Biener wrote: > The following makes sure to set alignment information on the LHS > of __builtin_assume_alignment calls even when not optimizing so > uses as arguments to builtin functions like memcpy or __atomic_load_n > can be reflected at RTL expa

[PATCH][v2] tree-optimization/107389 - honor __builtin_assume_alignment at -O0

2022-11-08 Thread Richard Biener via Gcc-patches
The following makes sure to set alignment information on the LHS of __builtin_assume_alignment calls even when not optimizing so uses as arguments to builtin functions like memcpy or __atomic_load_n can be reflected at RTL expansion time. Bootstrap and regtest running on x86_64-unknown-linux-gnu,

Re: [PATCH] [PR24021] Implement PLUS_EXPR range-op entry for floats.

2022-11-08 Thread Aldy Hernandez via Gcc-patches
On Tue, Nov 8, 2022 at 12:07 PM Jakub Jelinek wrote: > > On Mon, Nov 07, 2022 at 04:38:29PM +0100, Aldy Hernandez wrote: > > From d214bcdff2cb90ad1eb808d29bda6fb98d510b4c Mon Sep 17 00:00:00 2001 > > From: Aldy Hernandez > > Date: Mon, 7 Nov 2022 14:18:57 +0100 > > Subject: [PATCH] Provide normal

Re: [PATCH] cdce: Fix up get_no_error_domain for new f{16, 32, 64, 128} builtins [PR107547]

2022-11-08 Thread Richard Biener via Gcc-patches
On Tue, 8 Nov 2022, Jakub Jelinek wrote: > Hi! > > I've missed that this function needs to handle all the builtins that > are handled in can_test_argument_range. > The following patch does that. For many of the builtins (like acos, or > log) it is the same range regardless of the floating point

[PATCH][RFC] tree-optimization/99416 - loop distribution wrt vect data dependence

2022-11-08 Thread Richard Biener via Gcc-patches
The following adds additional benefit heuristics for loop distribution for the case where the distributed loop can be vectorized fine but when partitions are merged a data dependence prohibits vectorization. The heuristic computes dependences inside of partitions to determine whether they are good

Re: [PATCH] middle-end IFN_ASSUME support [PR106654]

2022-11-08 Thread Jakub Jelinek via Gcc-patches
On Tue, Nov 08, 2022 at 10:19:50AM +0100, Pilar Latiesa via Gcc-patches wrote: > On Mon, Oct 17, 2022 at 05:32:32AM +0200, Martin Uecker wrote: > > Hm, that already seems to work with > > > > if (!std::isfinite(x)) > > __builtin_unreachable(); > > > > https://godbolt.org/z/hj3WrEhjb > > Not anym

Re: [PATCH] c++: Allow module name to be a single letter on Windows

2022-11-08 Thread Nathan Sidwell via Gcc-patches
On 11/8/22 05:18, Torbjorn SVENSSON wrote: Hi Nathan, On 2022-11-08 00:03, Nathan Sidwell wrote: Yes, something like the above, but I think you're missing "/bob' in the DOS_BASED case?  shouldn't that also be a pathname? if (IS_DIR_SEPARATOR (ptr[ptr[0] == '.']) // ./FOO or /FOO #if HAVE_

[PATCH] testsuite: Fix up pr107541.c test

2022-11-08 Thread Jakub Jelinek via Gcc-patches
On Mon, Nov 07, 2022 at 12:42:38PM +0100, Aldy Hernandez via Gcc-patches wrote: > * gcc.dg/tree-ssa/pr107541.c: New test. The test fails when long is 32-bit rather than 64-bit (say x86_64 with RUNTESTFLAGS='--target_board=unix\{-m32,-m64\} tree-ssa.exp=pr107541.c' ). I've tweaked it to use l

Re: [PATCH] [PR24021] Implement PLUS_EXPR range-op entry for floats.

2022-11-08 Thread Jakub Jelinek via Gcc-patches
On Mon, Nov 07, 2022 at 04:41:23PM +0100, Aldy Hernandez wrote: > As suggested upthread, I have also adjusted update_nan_sign() to drop > the NAN sign to VARYING if both operands are NAN. As an optimization > I keep the sign if both operands are NAN and have the same sign. For NaNs this still rel

Re: [PATCH] [PR24021] Implement PLUS_EXPR range-op entry for floats.

2022-11-08 Thread Jakub Jelinek via Gcc-patches
On Mon, Nov 07, 2022 at 04:38:29PM +0100, Aldy Hernandez wrote: > From d214bcdff2cb90ad1eb808d29bda6fb98d510b4c Mon Sep 17 00:00:00 2001 > From: Aldy Hernandez > Date: Mon, 7 Nov 2022 14:18:57 +0100 > Subject: [PATCH] Provide normalized and denormal format version of > real_isdenormal. > > Imple

[PATCH] cdce: Fix up get_no_error_domain for new f{16,32,64,128} builtins [PR107547]

2022-11-08 Thread Jakub Jelinek via Gcc-patches
Hi! I've missed that this function needs to handle all the builtins that are handled in can_test_argument_range. The following patch does that. For many of the builtins (like acos, or log) it is the same range regardless of the floating point type, but for some (cosh, sinh, exp{,m1,2}) it is diff

Re: [PATCH] i386: Improve vector [GL]E{, U} comparison against vector constants [PR107546]

2022-11-08 Thread Uros Bizjak via Gcc-patches
On Tue, Nov 8, 2022 at 11:42 AM Jakub Jelinek wrote: > > Hi! > > For integer vector comparisons without XOP before AVX512{F,VL} we are > constrained by only GT and EQ being supported in HW. > For GTU we play tricks to implement it using GT or unsigned saturating > subtraction, for LT/LTU we swap t

[PATCH] i386: Improve vector [GL]E{,U} comparison against vector constants [PR107546]

2022-11-08 Thread Jakub Jelinek via Gcc-patches
Hi! For integer vector comparisons without XOP before AVX512{F,VL} we are constrained by only GT and EQ being supported in HW. For GTU we play tricks to implement it using GT or unsigned saturating subtraction, for LT/LTU we swap the operands and thus turn it into GT/GTU. For LE/LEU we handle it

Re: [PATCH] rtl: Try to remove EH edges after {pro, epi}logue generation [PR90259]

2022-11-08 Thread Eric Botcazou via Gcc-patches
> It looks reasonable - OK if the others CCed have no comments. My only comment is that it needs to be tested with languages enabling -fnon- call-exceptions by default (Ada & Go), if not already done. -- Eric Botcazou

Re: [PATCH, v3] Fortran: ordering of hidden procedure arguments [PR107441]

2022-11-08 Thread Mikael Morin
Hello, Le 07/11/2022 à 22:45, Harald Anlauf via Fortran a écrit : Dear all, Am 04.11.22 um 10:53 schrieb Mikael Morin: Le 03/11/2022 à 23:03, Harald Anlauf a écrit : I've spent some time not only staring at create_function_arglist, but trying several variations handling the declared hidden pa

[committed] libstdc++: Uncomment denorm_min test

2022-11-08 Thread Jakub Jelinek via Gcc-patches
Hi! As r13-3609-g6d9dbdf51f9afe8 has been committed, we can now enable even the denorm_min test. Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk as obvious. 2022-11-08 Jakub Jelinek * testsuite/20_util/to_chars/float128_c++23.cc (test): Uncomment den

Re: [PATCH] c++: Allow module name to be a single letter on Windows

2022-11-08 Thread Torbjorn SVENSSON via Gcc-patches
Hi Nathan, On 2022-11-08 00:03, Nathan Sidwell wrote: On 11/3/22 11:06, Torbjorn SVENSSON wrote: On 2022-11-03 15:17, Nathan Sidwell wrote: On 10/28/22 05:15, Torbjörn SVENSSON wrote: On Windows, the ':' character is special and when the module name is a single character, like 'A', then the

Re: [PATCH] rtl: Try to remove EH edges after {pro,epi}logue generation [PR90259]

2022-11-08 Thread Richard Biener via Gcc-patches
On Tue, Nov 8, 2022 at 3:49 AM Kewen.Lin wrote: > > Hi, > > After prologue and epilogue generation, the judgement on whether > one memory access onto stack frame may trap or not could change, > since we get more exact stack information by now. > > As PR90259 shows, some memory access becomes impos

Re: [PATCH] Support Intel prefetchit0/t1

2022-11-08 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 04, 2022 at 03:46:32PM +0800, Haochen Jiang via Gcc-patches wrote: > We will take back the patches which add a new parameter on original > builtin_prefetch and implement instruction prefetch on that. > > Also we consider that since we will only do that on specific backend, > no need to

Re: [RFA] gcc: fix PR rtl-optimization/107482

2022-11-08 Thread Max Filippov via Gcc-patches
On Mon, Nov 7, 2022 at 12:52 PM Vladimir Makarov wrote: > even better patch: > > diff --git a/gcc/ira-color.cc b/gcc/ira-color.cc > index 4a1a325e8e3..ffe73b61c45 100644 > --- a/gcc/ira-color.cc > +++ b/gcc/ira-color.cc > @@ -2209,8 +2209,8 @@ assign_hard_reg (ira_allocno_t a, bool retry_p) >

Re: [PATCH v2] Always use TYPE_MODE instead of DECL_MODE for vector field

2022-11-08 Thread Richard Biener via Gcc-patches
On Mon, Nov 7, 2022 at 9:07 PM H.J. Lu wrote: > > On Mon, Oct 24, 2022 at 11:28 PM Richard Biener > wrote: > > > > On Mon, Oct 24, 2022 at 10:02 PM H.J. Lu wrote: > > > > > > On Mon, Oct 24, 2022 at 12:12 AM Richard Biener > > > wrote: > > > > > > > > On Fri, Oct 21, 2022 at 6:18 PM H.J. Lu wr

[COMMITTED] gcc: fix PR rtl-optimization/107482

2022-11-08 Thread Max Filippov via Gcc-patches
gcc/ PR rtl-optimization/107482 * ira-color.cc (assign_hard_reg): Only call update_costs_from_copies when retry_p is false. --- gcc/ira-color.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/ira-color.cc b/gcc/ira-color.cc index 4a1a325e8e31..f

[PATCH] middle-end IFN_ASSUME support [PR106654]

2022-11-08 Thread Pilar Latiesa via Gcc-patches
On Mon, Oct 17, 2022 at 05:32:32AM +0200, Martin Uecker wrote: > Hm, that already seems to work with > > if (!std::isfinite(x)) > __builtin_unreachable(); > > https://godbolt.org/z/hj3WrEhjb Not anymore. Perhaps after making ranger the VRP default, because I get the mentioned outcome with --para

Re: [PATCH] maintainer-scripts/gcc_release: compress xz in parallel

2022-11-08 Thread Sam James via Gcc-patches
> On 8 Nov 2022, at 08:52, Jakub Jelinek wrote: > > On Tue, Nov 08, 2022 at 07:40:02AM +, Sam James wrote: >>> On 8 Nov 2022, at 07:33, Xi Ruoyao wrote: >>> I'm wondering if running xz -T0 on different machines (with different >>> core numbers) may produce different compressed data. The d

[COMMITTED] ada: Compile-time simplification of 'Image incorrectly ignores Put_Image

2022-11-08 Thread Marc Poulhiès via Gcc-patches
From: Steve Baird In the case of Some_Enumeration_Type'Image (), the compiler will replace this expression in its internal program representation with a corresponding string literal. This is incorrect if the Put_Image aspect has been specified (directly or via inheritance) for the enumeration typ

Re: [PATCH] maintainer-scripts/gcc_release: compress xz in parallel

2022-11-08 Thread Jakub Jelinek via Gcc-patches
On Tue, Nov 08, 2022 at 07:40:02AM +, Sam James wrote: > > On 8 Nov 2022, at 07:33, Xi Ruoyao wrote: > > I'm wondering if running xz -T0 on different machines (with different > > core numbers) may produce different compressed data. The difference can > > cause trouble distributing checksums.

Re: [PATCH] libstdc++: Add _Float128 to_chars/from_chars support for x86, ia64 and ppc64le with glibc

2022-11-08 Thread Jakub Jelinek via Gcc-patches
On Tue, Nov 08, 2022 at 01:41:41AM +, Joseph Myers wrote: > I've committed this further fix for a syntax error as obvious. Thanks and sorry. > libstdc++: Fix syntax error in old-glibc case in floating_from_chars.cc > [PR107562] > > PR libstdc++/107562 > * src/c++17/floating_from

[COMMITTED] ada: Fix oversight in implementation of allocators for storage models

2022-11-08 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou When the allocator is of an unconstrained array type and has an initializing expression, the copy of the initializing expression must be done separately from that of the bounds. gcc/ada/ * gcc-interface/utils2.cc (build_allocator): For unconstrained array typ

[COMMITTED] ada: Clean up call to check if aspects are present

2022-11-08 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ * exp_ch6.adb, exp_put_image.adb, sem_aggr.adb, sem_attr.adb, sem_ch5.adb, sem_type.adb, sem_util.adb: Replace "Present (Find_Aspect (...))" with "Has_Aspect". Tested on x86_64-pc-linux-gnu, committed

[COMMITTED] ada: Propagate aspect Ghost when instantiating null formal procedures

2022-11-08 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek When instantiating generic package that includes a formal subprogram declaration with Ghost aspect and a subprogram_default of null, e.g.: generic with procedure Proc is null with Ghost; package P is ... the Ghost aspect should be propagated to the internally gen

[COMMITTED] ada: Enforce matching of extra formals

2022-11-08 Thread Marc Poulhiès via Gcc-patches
From: Javier Miranda This patch enforces matching of extra formals in overridden subprograms, subprogram renamings, and subprograms to which attributes 'Access, 'Unchecked_Access, or 'Unrestricted_Access is applied (for these access cases the subprogram is checked against its corresponding subpro

[COMMITTED] ada: Adjust classwide contract expression preanalysis

2022-11-08 Thread Marc Poulhiès via Gcc-patches
From: Ronan Desplanques Before this patch, a classwide contract expression was preanalyzed only when its primitive operation's type was frozen. It caused name resolution to be off in the cases where the freezing took place after the end of the declaration list the primitive operation was declared

[COMMITTED] ada: Set Support_Atomic_Primitives for VxWorks 7 runtimes

2022-11-08 Thread Marc Poulhiès via Gcc-patches
From: Johannes Kliemann gcc/ada/ * libgnat/system-vxworks7-aarch64-rtp-smp.ads: Set Support_Atomic_Primitives to True. * libgnat/system-vxworks7-aarch64.ads: Set Support_Atomic_Primitives to True. * libgnat/system-vxworks7-arm-rtp-smp.ads: Set Supp

[COMMITTED] ada: Move warnings switches -- initial work

2022-11-08 Thread Marc Poulhiès via Gcc-patches
From: Bob Duff This patch prepares to move warning switches from Opt into Warnsw. gcc/ada/ * warnsw.ads, warnsw.adb, fe.h, err_vars.ads, errout.ads: Move Warning_Doc_Switch from Err_Vars to Warnsw. Access Warn_On_Questionable_Layout on the C side via a function rather

[COMMITTED] ada: Improve handling of declare expressions in deferred-freezing contexts

2022-11-08 Thread Marc Poulhiès via Gcc-patches
From: Steve Baird In some cases where a declare expression occurs in a deferred-freezing context (e.g., within the default value for a discriminant or for a formal parameter, or within the expression of an expression function), the compiler generates a bugbox. gcc/ada/ * sem_ch3.adb

Re: [r13-3761 Regression] FAIL: g++.dg/warn/Warray-bounds-16.C -std=gnu++98 (test for excess errors) on Linux/x86_64

2022-11-08 Thread Aldy Hernandez via Gcc-patches
It looks like this was failing on x86-64 before my patch: In constructor ‘S::S(int)’, inlined from ‘void __static_initialization_and_destruction_0()’ at a.c:26:7, inlined from ‘(static initializers for a.c)’ at a.c:26:8: a.c:22:24: warning: ‘void* __builtin_memset(void*, int, long unsigned

[COMMITTED] ada: Small consistency fix

2022-11-08 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou gcc/ada/ * fe.h (Get_Warn_On_Questionable_Layout): Add void parameter. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/fe.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/fe.h b/gcc/ada/fe.h index 8102c6d5ec4..12ad15b6d3

[COMMITTED] ada: Minor consistency tweaks in Sem_Ch4

2022-11-08 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This ensures that, during the analysis of the qualified expressions, type conversions and unchecked type conversions, the determination of the type of the node and the analysis of its expression are done in the same order. No functional changes. gcc/ada/ * sem_ch4.a

[COMMITTED] ada: Fix expansion of 'Wide_Image and 'Wide_Wide_Image on composite types

2022-11-08 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Attributes Wide_Image and Wide_Wide_Image applied to composite types are now expanded just like attribute Image. gcc/ada/ * exp_imgv.adb (Expand_Wide_Image_Attribute): Handle just like attribute Image. (Expand_Wide_Wide_Image_Attribute): Likewise.

[COMMITTED] ada: Fix inconsistent whitespace in Ada.Numerics.Generic_Complex_Arrays

2022-11-08 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Cleanup only. gcc/ada/ * libgnat/a-ngcoar.ads, libgnat/a-ngcoar.adb: Remove extra spaces. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/a-ngcoar.adb | 4 ++-- gcc/ada/libgnat/a-ngcoar.ads | 4 ++-- 2 files changed, 4 insertions(+), 4 del

[COMMITTED] ada: Remove redundant line in Analyze_Qualified_Expression

2022-11-08 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou The same statement is present a few lines above. gcc/ada/ * sem_ch4.adb (Analyze_Qualified_Expression): Remove redundant line. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch4.adb | 2 -- 1 file changed, 2 deletions(-) diff --git a/

[COMMITTED] ada: Implement RM 4.5.7(10/3) name resolution rule

2022-11-08 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This rule deals with the specific case of a conditional expression that is the operand of a type conversion and effectively distributes the conversion to the dependent expressions with the help of the dynamic semantics. gcc/ada/ * sem_ch4.adb (Analyze_Case_Expression

[COMMITTED] ada: Preanalyze classwide contracts as spec expressions

2022-11-08 Thread Marc Poulhiès via Gcc-patches
From: Ronan Desplanques Classwide contracts are "spec expressions" as defined in the documentation in sem.ads. Before this patch, the instances of classwide contracts that are destined to class conditions merging were not preanalyzed as spec expressions. That caused preanalysis to emit spurious e

[COMMITTED] ada: Cleanup local variable that is only set as an out parameter

2022-11-08 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Minor improvements; found experimenting with improved detection of unreferenced objects. gcc/ada/ * exp_spark.adb (SPARK_Freeze_Type): Refine type of a local object. * sem_ch3.adb (Derive_Subprograms): Remove initial value for New_Subp, which

[COMMITTED] ada: Remove unneeded code in handling formal type defaults

2022-11-08 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Unneeded code found while experimenting with improved detection of unreferenced objects. gcc/ada/ * sem_ch12.adb (Validate_Formal_Type_Default): Remove call to Collect_Interfaces, which had no effect apart from populating a list that was not used; fi

[COMMITTED] ada: Align -gnatwc's documentation with its behavior

2022-11-08 Thread Marc Poulhiès via Gcc-patches
From: Ronan Desplanques Shortly after the -gnatwc flag was introduced, its behavior was tweaked, but its documentation was not updated accordingly. gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst (-gnatwc): Fix flag documentation. * gnat_ugn.texi: Rege

[COMMITTED] ada: Reject record delta aggregates with limited expressions

2022-11-08 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Implement a missing check related to record delta aggregates. gcc/ada/ * sem_aggr.adb (Resolve_Delta_Record_Aggregate): Reject expressions of a limited types. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_aggr.adb | 10 ++ 1

[COMMITTED] ada: Reject limited objects in array and record delta aggregates

2022-11-08 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek For array delta aggregates the base expression cannot be limited; for record delta aggregates the base expression can only be limited if it is a newly constructed object. gcc/ada/ * sem_aggr.adb (Resolve_Delta_Aggregate): Implement rules related to limited o

[COMMITTED] ada: Remove obsolete code in Resolve_If_Expression

2022-11-08 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou gcc/ada/ * sem_res.adb (Resolve_If_Expression): Remove obsolete special case. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_res.adb | 13 + 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/gcc/ada/sem_res.adb b

[COMMITTED] ada: Missing master of task causing assertion failure

2022-11-08 Thread Marc Poulhiès via Gcc-patches
From: Javier Miranda gcc/ada/ * exp_ch9.adb (Build_Master_Entity): Handle missing case: when the context of the master is a BIP function whose result type has tasks. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch9.adb | 37 ++

[COMMITTED] ada: Allow initialization of limited objects with delta aggregates

2022-11-08 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Objects of a limited type can be initialized with "aggregates", which is a collective term for ordinary aggregates (i.e. record aggregates and array aggregates), extension aggregates and finally for delta aggregates (introduced by Ada 2022). gcc/ada/ * sem_ch3.adb (

[COMMITTED] ada: Raise Tag_Error when Ada.Tags operations are called with No_Tag

2022-11-08 Thread Marc Poulhiès via Gcc-patches
From: Piotr Trojanek Implement missing behavior of RM 13.9 (25.1/3): Tag_Error is raised by a call of Interface_Ancestor_Tags and Is_Descendant_At_Same_Level, if any tag passed is No_Tag. This change also fixes Descendant_Tag, which relies on Is_Descendant_At_Same_Level. The remaining operations

[COMMITTED] ada: Add new -gnatw_q switch to usage message

2022-11-08 Thread Marc Poulhiès via Gcc-patches
From: Bob Duff ...along with -gnatw_Q. gcc/ada/ * usage.adb: Add -gnatw_q and -gnatw_Q. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/usage.adb | 4 1 file changed, 4 insertions(+) diff --git a/gcc/ada/usage.adb b/gcc/ada/usage.adb index 7d11ae53696..642cfda1b

[r13-3761 Regression] FAIL: g++.dg/warn/Warray-bounds-16.C -std=gnu++98 (test for excess errors) on Linux/x86_64

2022-11-08 Thread haochen.jiang via Gcc-patches
On Linux/x86_64, a239a63f868e29e9276088e7c0fb00804c2903ba is the first bad commit commit a239a63f868e29e9276088e7c0fb00804c2903ba Author: Aldy Hernandez Date: Fri Nov 4 22:24:42 2022 +0100 Improve multiplication by powers of 2 in range-ops. caused FAIL: g++.dg/pr71488.C (test for exces

<    1   2