[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

[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

[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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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

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: 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

[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: 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: 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: 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: 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: 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: 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

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

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.

[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 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

[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

[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

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

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] 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: [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] 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

[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, 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

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

[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] 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] 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] [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

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

[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] 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_

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

[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] 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

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

[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][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

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] [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 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 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] 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] 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] [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] [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

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 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

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: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: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 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] 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] diagnostics: Allow FEs to keep customizations for middle end [PR101551, PR106274]

2022-11-08 Thread Richard Biener via Gcc-patches
On Thu, Nov 3, 2022 at 9:07 PM Lewis Hyatt wrote: > > On Fri, Oct 28, 2022 at 10:28:21AM +0200, Richard Biener wrote: > > Yes, the idea was also to free up memory but then that part never > > really materialized - the idea was to always run free-lang-data, not > > just when later outputting LTO by

[PATCH] CCP: handle division by a power of 2 as a right shift.

2022-11-08 Thread Aldy Hernandez via Gcc-patches
We have some code in range-ops that sets better maybe nonzero bits for TRUNC_DIV_EXPR by a power of 2 than CCP does, by just shifting the mask. I'd like to offload this functionality into the CCP mask tracking code, which already does the right thing for right shifts. The testcase for this change

[PATCH] amdgcn: Add builtins for vectorized native versions of abs, floorf and floor

2022-11-08 Thread Kwok Cheung Yeung
Hello This patch adds three extra builtins for the vectorized forms of the abs, floorf and floor math functions, which are implemented by native GCN instructions. I have also added a test to check that they generate the expected assembler instructions. Okay for trunk? Thanks KwokFrom 37f49

Re: [PATCH] Optimize VEC_PERM_EXPR with same permutation index and operation [PR98167]

2022-11-08 Thread Richard Biener via Gcc-patches
On Fri, Nov 4, 2022 at 7:44 AM Prathamesh Kulkarni via Gcc-patches wrote: > > On Fri, 4 Nov 2022 at 05:36, Hongyu Wang via Gcc-patches > wrote: > > > > Hi, > > > > This is a follow-up patch for PR98167 > > > > The sequence > > c1 = VEC_PERM_EXPR (a, a, mask) > > c2 = VEC_PERM_EXPR (b, b

[RFC PATCH] c++: Minimal handling of carries_dependency attribute

2022-11-08 Thread Jakub Jelinek via Gcc-patches
Hi! A comment in D2552R1: "The only questionable (but still conforming) case we found was [[carries_dependency(some_argument)]] on GCC, where the emitted diagnostic said that the carries_dependency attribute is not supported, but did not specifically call out the syntax error in the argument cla

Re: [PATCH] amdgcn: Add builtins for vectorized native versions of abs, floorf and floor

2022-11-08 Thread Andrew Stubbs
On 08/11/2022 14:35, Kwok Cheung Yeung wrote: Hello This patch adds three extra builtins for the vectorized forms of the abs, floorf and floor math functions, which are implemented by native GCN instructions. I have also added a test to check that they generate the expected assembler instruct

[PATCH 2/2] Add a new warning option -Wstrict-flex-arrays.

2022-11-08 Thread Qing Zhao via Gcc-patches
'-Wstrict-flex-arrays' Warn about inproper usages of flexible array members according to the LEVEL of the 'strict_flex_array (LEVEL)' attribute attached to the trailing array field of a structure if it's available, otherwise according to the LEVEL of the option '-fstrict-fl

[PATCH 0/2] Add a new warning option -Wstrict-flex-array

2022-11-08 Thread Qing Zhao via Gcc-patches
This patch serie include two changes: 1. Change the name of array_at_struct_end_p to array_ref_flexible_size_p. 2. Add a new warning option -Wstrict-flex-arrays and at the same time keep -Warray-bounds unchanged from -fstrict-flex-arrays. The new warning -Wstrict-flex-arrays is implemented a

Re: [PATCH 9/15] arm: Set again stack pointer as CFA reg when popping if necessary

2022-11-08 Thread Richard Earnshaw via Gcc-patches
On 26/10/2022 09:49, Andrea Corallo via Gcc-patches wrote: Richard Earnshaw writes: On 27/09/2022 16:24, Kyrylo Tkachov via Gcc-patches wrote: -Original Message- From: Andrea Corallo Sent: Tuesday, September 27, 2022 11:06 AM To: Kyrylo Tkachov Cc: Andrea Corallo via Gcc-patche

Re: [PATCH] [PHIOPT] Add A ? B + CST : B match and simplify optimizations

2022-11-08 Thread Richard Biener via Gcc-patches
On Sat, Nov 5, 2022 at 10:03 AM Zhongyunde via Gcc-patches wrote: > > > > -Original Message- > > From: Andrew Pinski [mailto:pins...@gcc.gnu.org] > > Sent: Saturday, November 5, 2022 2:34 PM > > To: Zhongyunde > > Cc: hongtao@intel.com; gcc-patches@gcc.gnu.org; Zhangwen(Esan) > > ; We

Re: [PATCH] CCP: handle division by a power of 2 as a right shift.

2022-11-08 Thread Richard Biener via Gcc-patches
On Tue, Nov 8, 2022 at 3:25 PM Aldy Hernandez wrote: > > We have some code in range-ops that sets better maybe nonzero bits for > TRUNC_DIV_EXPR by a power of 2 than CCP does, by just shifting the > mask. I'd like to offload this functionality into the CCP mask > tracking code, which already does

[COMMITTED] amdgcn: Fix expansion of GCN_BUILTIN_LDEXPV builtin

2022-11-08 Thread Kwok Cheung Yeung
Hello This patch fixes a bug in the expansion of GCN_BUILTIN_LDEXPV. As this is a double-precision operation, the first argument should be expanded as a V64DF expression (instead of V64SF). Committed to trunk as obvious. KwokFrom cb0a2b1f28cf0c231bf38fcd02c40689739df7bb Mon Sep 17 00:00:00 2

Re: [OG12] [committed] amdgcn: Enable SIMD vectorization of math library functions

2022-11-08 Thread Kwok Cheung Yeung
Hello These additional patches were pushed onto the devel/omp/gcc-12 branch to fix various issues with the SIMD math library: ecf1603b7ad amdgcn: Fix expansion of GCN_BUILTIN_LDEXPV builtin 6c40e3f5daa amdgcn: Various fixes for SIMD math library 8e6c5b18e10 amdgcn: Fixed intermittent failure i

[PATCH 1/2] Change the name of array_at_struct_end_p to array_ref_flexible_size_p

2022-11-08 Thread Qing Zhao via Gcc-patches
The name of the utility routine "array_at_struct_end_p" is misleading and should be changed to a new name that more accurately reflects its real meaning. The routine "array_at_struct_end_p" is used to check whether an array reference is to an array whose actual size might be larger than its upper

Re:Re: [PATCH] [PHIOPT] Add A ? B + CST : B match and simplify optimizations

2022-11-08 Thread 钟云德 via Gcc-patches
At 2022-11-08 22:58:34, "Richard Biener" wrote: >On Sat, Nov 5, 2022 at 10:03 AM Zhongyunde via Gcc-patches > wrote: >> >> >> > -Original Message- >> > From: Andrew Pinski [mailto:pins...@gcc.gnu.org] >> > Sent: Saturday, November 5, 2022 2:34 PM >> > To: Zhongyunde >> > Cc: hongtao@

[PATCH] Use toplevel configure for GMP and MPFR for gdb

2022-11-08 Thread apinski--- via Gcc-patches
From: Andrew Pinski This patch uses the toplevel configure parts for GMP/MPFR for gdb. The only thing is that gdb now requires MPFR for building. Before it was a recommended but not required library. Also this allows building of GMP and MPFR with the toplevel directory just like how it is done fo

Re: [PATCH] sched1: Fix -fcompare-debug issue in schedule_region [PR105586]

2022-11-08 Thread Surya Kumari Jangala via Gcc-patches
Hi Richard, On 21/09/22 1:03 pm, Richard Biener wrote: > On Tue, Sep 20, 2022 at 9:18 AM Surya Kumari Jangala via Gcc-patches > wrote: >> >> Hi Jeff, Richard, >> Thank you for reviewing the patch! >> I have committed the patch to the gcc repo. >> Can I backport this patch to prior versions of gcc

Re: [PATCH] Use toplevel configure for GMP and MPFR for gdb

2022-11-08 Thread Andreas Schwab via Gcc-patches
On Nov 08 2022, apinski--- via Gcc-patches wrote: > diff --git a/configure b/configure > index 7bcb894d1fe..9ee7a1a3abe 100755 > --- a/configure > +++ b/configure > @@ -769,6 +769,7 @@ infodir > docdir > oldincludedir > includedir > +runstatedir > localstatedir > sharedstatedir > sysconfdir

Re: [PATCH] Use toplevel configure for GMP and MPFR for gdb

2022-11-08 Thread Andrew Pinski via Gcc-patches
On Tue, Nov 8, 2022 at 8:46 AM Andreas Schwab via Gdb-patches wrote: > > On Nov 08 2022, apinski--- via Gcc-patches wrote: > > > diff --git a/configure b/configure > > index 7bcb894d1fe..9ee7a1a3abe 100755 > > --- a/configure > > +++ b/configure > > @@ -769,6 +769,7 @@ infodir > > docdir > > old

Re: [PATCH] sched1: Fix -fcompare-debug issue in schedule_region [PR105586]

2022-11-08 Thread Richard Biener via Gcc-patches
On Tue, Nov 8, 2022 at 5:37 PM Surya Kumari Jangala wrote: > > Hi Richard, > > On 21/09/22 1:03 pm, Richard Biener wrote: > > On Tue, Sep 20, 2022 at 9:18 AM Surya Kumari Jangala via Gcc-patches > > wrote: > >> > >> Hi Jeff, Richard, > >> Thank you for reviewing the patch! > >> I have committed t

RE: [PATCH 1/4]middle-end Support not decomposing specific divisions during vectorization.

2022-11-08 Thread Tamar Christina via Gcc-patches
Ping. > -Original Message- > From: Tamar Christina > Sent: Monday, October 31, 2022 11:35 AM > To: Richard Biener > Cc: gcc-patches@gcc.gnu.org; nd ; jeffreya...@gmail.com > Subject: RE: [PATCH 1/4]middle-end Support not decomposing specific > divisions during vectorization. > > > > > Th

Re: [PATCH] libstdc++: Refactor implementation of operator+ for std::string

2022-11-08 Thread Jonathan Wakely via Gcc-patches
On Thu, 20 Oct 2022 at 01:06, Will Hawkins wrote: > > Sorry for the delay. Tested on x86-64 Linux. > > -->8-- > > After consultation with Jonathan, it seemed like a good idea to create a > single function that performed one-allocation string concatenation that > could be used by various different v

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

2022-11-08 Thread Andrew Waterman
On Tue, Nov 8, 2022 at 3:20 AM Jakub Jelinek via Gcc-patches 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

Re: [PATCH v2] libstdc++: basic_filebuf: don't flush more often than necessary.

2022-11-08 Thread Jonathan Wakely via Gcc-patches
On Mon, 7 Nov 2022 at 17:00, Jonathan Wakely wrote: > > On Thu, 6 Oct 2022 at 20:03, Charles-Francois Natali via Libstdc++ > wrote: > > > > `basic_filebuf::xsputn` would bypass the buffer when passed a chunk of > > size 1024 and above, seemingly as an optimisation. > > > > This can have a signific

[committed] libstdc++: Add always_inline to most allocator functions

2022-11-08 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux. Pushed to trunk. -- >8 -- This reduces the abstraction penalty for allocator support in unoptimized code. Constructing and using allocators in containers calls many one-line (or completely empty) inline functions. Those can all be inlined to reduce code size and function

[committed] libstdc++: Fix -Wsystem-headers warnings

2022-11-08 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- Fix some problems noticed with -Wsystem-headers. libstdc++-v3/ChangeLog: * include/bits/stl_tempbuf.h (_Temporary_buffer): Disable warnings about get_temporary_buffer being deprecated. * include/ext/functional (mem_fun1, mem

[committed] libstdc++: Fix -Wsystem-headers warnings in tests

2022-11-08 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * testsuite/18_support/new_nothrow.cc: Add missing noexcept to operator delete replacements. * testsuite/20_util/any/cons/92156.cc: Disable -Winit-list-lifetime warnings from instantiating inva

[PATCH 1/3] Compute a table of DWARF register sizes at compile

2022-11-08 Thread Florian Weimer via Gcc-patches
The sizes are compile-time constants. Create a vector with them, so that they can be inspected at compile time. * gcc/dwarf2cfi.cc (init_return_column_size): Remove. (init_one_dwarf_reg_size): Adjust. (generate_dwarf_reg_sizes): New function. Extracted from expand

[PATCH 0/3] Further libgcc unwinder improvements

2022-11-08 Thread Florian Weimer via Gcc-patches
This series makes some further unwinder improvements. Unfortunately, not many targets define __LIBGCC_DWARF_REG_SIZES_CONSTANT__; x86-64 does, and it makes uw_install_context_1 quite a bit faster because GCC no longer has to emit generic memcpy code for it. In general, it may be worthwhile to rep

[PATCH 3/3] libgcc: Specialize execute_cfa_program in DWARF unwinder for alignments

2022-11-08 Thread Florian Weimer via Gcc-patches
The parameters fs->data_align and fs->code_align always have fixed values for a particular target in GCC-generated code. Specialize execute_cfa_program for these values, to avoid multiplications. gcc/ * c-family/c-cppbuiltin.c (c_cpp_builtins): Define __LIBGCC_DWARF_CIE_DATA_ALIG

[PATCH 2/3] Define __LIBGCC_DWARF_REG_SIZES_CONSTANT__ if DWARF register size is constant

2022-11-08 Thread Florian Weimer via Gcc-patches
And use that to speed up the libgcc unwinder. * gcc/debug.h (dwarf_reg_sizes_constant): Declare. * gcc/dwarf2cfi.cc (dwarf_reg_sizes_constant): New function. * gcc/c-family/c-cppbuiltin.c (__LIBGCC_DWARF_REG_SIZES_CONSTANT__): Define if constant is known. l

  1   2   >