Re: [RFC PATCH] Detecting lifetime-dse issues via Valgrind

2023-11-21 Thread Alexander Monakov
On Tue, 21 Nov 2023, Alexander Monakov wrote: > I am concerned that if GCC ever learns to leave out the following access > to 'this->foo', leaving tmp uninitialized, we will end up with: > > this->foo = 42; Sorry, this store will be DSE'd out, of course, but my question stands.

Re: [PATCH] builtins: Fix fold_builtin_query clzg/ctzg side-effects handling [PR112639]

2023-11-21 Thread Richard Biener
On Tue, 21 Nov 2023, Jakub Jelinek wrote: > Hi! > > As the testcase shows, I've missed one spot where initially the code thinks > it could use 2 argument IFN_CLZ/IFN_CTZ form, but then verifies it can't > because it doesn't have the right target value and turns it into the > arg0 ? arg1 :

Re: [PATCH] testsuite: Fix up pr111309-2.c on arm [PR111309]

2023-11-21 Thread Richard Biener
On Tue, 21 Nov 2023, Jakub Jelinek wrote: > Hi! > > ARM defaults to -fshort-enums and the following testcase FAILs there in 2 > lines. The difference is that in C++, E0 has enum E type, which normally > has unsigned int underlying type, so it isn't int nor something that > promotes to int,

RE: [PATCH]AArch64 docs: update -mcpu=generic definition on aarch64

2023-11-21 Thread Tamar Christina
> -Original Message- > From: Richard Biener > Sent: Tuesday, November 21, 2023 9:41 AM > To: Richard Earnshaw > Cc: Tamar Christina ; gcc-patches@gcc.gnu.org; > nd ; Richard Earnshaw ; > Marcus Shawcroft ; Kyrylo Tkachov > ; Richard Sandiford > > Subject: Re: [PATCH]AArch64 docs: update

[COMMITTED] ada: Deep delta aggregates in postconditions

2023-11-21 Thread Marc Poulhiès
From: Steve Baird Fix a bug in handling array-valued deep delta aggregates occurring in postconditions. The bug could result in a spurious compilation failure. gcc/ada/ * sem_aggr.adb (Resolve_Delta_Array_Aggregate): In the case of a deep delta choice, the expected type for the

[COMMITTED] ada: Fix miscompilation of loop over boolean range

2023-11-21 Thread Marc Poulhiès
From: Eric Botcazou The optimized form generated in this case turns out to be problematic. gcc/ada/ * gcc-interface/trans.cc (Loop_Statement_to_gnu): Always use the simpler form for a loop with a boolean iteration variable. Tested on x86_64-pc-linux-gnu, committed on master.

Re: [RFC PATCH] Detecting lifetime-dse issues via Valgrind

2023-11-21 Thread Richard Biener
On Tue, Nov 21, 2023 at 8:59 AM Alexander Monakov wrote: > > > On Tue, 21 Nov 2023, Alexander Monakov wrote: > > > I am concerned that if GCC ever learns to leave out the following access > > to 'this->foo', leaving tmp uninitialized, we will end up with: > > > > this->foo = 42; > > Sorry,

Re: [PATCH] middle-end, v2: Add new value for vector types for __builtin_classify_type

2023-11-21 Thread Jakub Jelinek
On Mon, Nov 20, 2023 at 08:03:18AM +, Richard Biener wrote: > OK. Do we have to adjust any of our documentation for this? I've done it this way. We don't really document the exact values in the documentation, so I think it is sufficient like that. Committed to trunk. 2023-11-20 Jakub

Re: [PATCH] c: Add __builtin_stdc_bit_{width,floor,ceil} builtins

2023-11-21 Thread Jakub Jelinek
On Mon, Nov 20, 2023 at 02:55:33PM +, Joseph Myers wrote: > On Sat, 18 Nov 2023, Jakub Jelinek wrote: > > > +@defbuiltin{@var{type} __builtin_stdc_bit_ceil (@var{type} @var{arg})} > > +The @code{__builtin_stdc_bit_ceil} function is available only > > +in C. It is type-generic, the argument

Re: [PATCH 2/2] gcov: Fix integer types in gen_counter_update()

2023-11-21 Thread Jakub Jelinek
On Mon, Nov 20, 2023 at 03:33:31PM +0100, Sebastian Huber wrote: > This change fixes issues like this: > > gcc.dg/gomp/pr27573.c: In function ‘main._omp_fn.0’: > gcc.dg/gomp/pr27573.c:19:1: error: non-trivial conversion in ‘ssa_name’ > 19 | } > | ^ > long int > long unsigned

RE: [ARC PATCH] Consistent use of whitespace in assembler templates.

2023-11-21 Thread Claudiu Zissulescu
Hi Roger, Apologizes for late reply, I was in a short vacation. Please proceed with your commit. BTW, I consider this type of contribution as obvious, and you can always push it without waiting for my feedback. Thank you for your contribution, Claudiu -Original Message- From: Roger

Re: [PATCH]AArch64 docs: update -mcpu=generic definition on aarch64

2023-11-21 Thread Richard Biener
On Tue, Nov 21, 2023 at 10:38 AM Richard Earnshaw wrote: > > > > On 20/11/2023 21:49, Tamar Christina wrote: > >> -Original Message- > >> From: Richard Earnshaw > >> Sent: Monday, November 20, 2023 12:53 PM > >> To: Tamar Christina ; gcc-patches@gcc.gnu.org > >> Cc: nd ; Richard Earnshaw

[COMMITTED] ada: Trivial typo fix in comment

2023-11-21 Thread Marc Poulhiès
gcc/ada/ * exp_util.ads: Typo fix. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_util.ads | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/exp_util.ads b/gcc/ada/exp_util.ads index 95ea4403c5d..932bf3fdcbc 100644 ---

[COMMITTED] ada: Fix SCOs generation for aspect specifications

2023-11-21 Thread Marc Poulhiès
From: Pierre-Marie de Rodat The recent overhaul for the representation of aspect specifications in the tree broke SCOs generation: decisions that appeared in aspects were processed twice, leading to the emission of erroneous obligations. Tweak SCOs generation to skip aspect specifications the

[COMMITTED] ada: Always use -gnatg in run-time GPR files

2023-11-21 Thread Marc Poulhiès
From: Ronan Desplanques This patch makes it so -gnatg is always passed to the compiler when rebuilding the run-time library with the dedicated GPR files. Before this patch, if a user rebuilt the run-time with -XADAFLAGS=XXX where XXX didn't include "-gnatg", the build would immediately fail.

[COMMITTED] ada: Compiler crash on container aggregate with loop_parameter_specifications

2023-11-21 Thread Marc Poulhiès
From: Gary Dismukes The compiler crashes on a container aggregate with more than one iterated_element_association given by a loop_parameter_specification. In such a case, the tree contains N_Iterated_Component_Association nodes rather than N_Iterated_Element_Association nodes, and the code for

[COMMITTED] ada: Fix issue with indefinite vector of overaligned unconstrained array

2023-11-21 Thread Marc Poulhiès
From: Eric Botcazou The problem is that the aligning machinery is not consistently triggered, depending on whether a constrained view or the nominal unconstrained view of the element type is used to perform the allocations and deallocations. gcc/ada/ * gcc-interface/decl.cc

[COMMITTED] ada: Another couple of cleanups in the finalization machinery

2023-11-21 Thread Marc Poulhiès
From: Eric Botcazou For package specs and bodies that need finalizers, Build_Finalizer is invoked from the Standard scope so it needs to adjust the scope stack before creating new objects; this changes it to do so only once. For other kinds of scopes, it is invoked from Expand_Cleanup_Actions,

[COMMITTED] ada: Fix internal error on 'Address of task component

2023-11-21 Thread Marc Poulhiès
From: Eric Botcazou This happens when the prefix of the selected component is of an access type, i.e. there is an implicit dereference. because the prefix is not resolved. gcc/ada/ * sem_attr.adb (Resolve_Attribute) : Remove the bypass for prefixes with task type. Tested on

Re: [PATCH v3 1/2] c++: Initial support for P0847R7 (Deducing This) [PR102609]

2023-11-21 Thread waffl3x
On Monday, November 20th, 2023 at 7:35 AM, Jason Merrill wrote: > > > On 11/19/23 16:44, waffl3x wrote: > > > On Sunday, November 19th, 2023 at 1:34 PM, Jason Merrill ja...@redhat.com > > wrote: > > > > > On 11/19/23 13:36, waffl3x wrote: > > > > > > > I'm having trouble fixing the

[BUG FIX] RISC-V: Disallow COSNT_VECTOR for DI on RV32

2023-11-21 Thread Juzhe-Zhong
This bug is exposed when testing on zvl512b RV32 system. The rootcause is RA reload DI CONST_VECTOR into vmv.v.x then it ICE. So disallow DI CONST_VECTOR on RV32. PR target/112598 gcc/ChangeLog: * config/riscv/riscv.cc (riscv_const_insns): Disallow DI CONST_VECTOR on RV32.

[COMMITTED] ada: Fix type for SPARK expansion on deep delta aggregates

2023-11-21 Thread Marc Poulhiès
From: Yannick Moy gcc/ada/ * exp_spark.adb (Expand_SPARK_Delta_Or_Aggregate): Fix type. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_spark.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/exp_spark.adb b/gcc/ada/exp_spark.adb

[PATCH v2] gcov: Fix integer types in gen_counter_update()

2023-11-21 Thread Sebastian Huber
This change fixes issues like this: gcc.dg/gomp/pr27573.c: In function ‘main._omp_fn.0’: gcc.dg/gomp/pr27573.c:19:1: error: non-trivial conversion in ‘ssa_name’ 19 | } | ^ long int long unsigned int # .MEM_19 = VDEF <.MEM_18> __gcov7.main._omp_fn.0[0] =

Re: [PATCH 1/1] sched-deps.cc (find_modifiable_mems): Avoid exponential behavior

2023-11-21 Thread Alexander Monakov
On Tue, 21 Nov 2023, Maxim Kuvyrkov wrote: > This patch avoids sched-deps.cc:find_inc() creating exponential number > of dependencies, which become memory and compilation time hogs. > Consider example (simplified from PR96388) ... > === > sp=sp-4 // sp_insnA >

Fix 'gcc.dg/tree-ssa/return-value-range-1.c' (was: Propagate value ranges of return values)

2023-11-21 Thread Thomas Schwinge
Hi! On 2023-11-19T16:05:42+0100, Jan Hubicka wrote: > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/tree-ssa/return-value-range-1.c > @@ -0,0 +1,22 @@ > +/* { dg-do ling } */ ERROR: gcc.dg/tree-ssa/return-value-range-1.c: 1: syntax error for " dg-do 1 ling " With that fixed into 'dg-do

Re: [PATCH] Fix PR ada/111909 On Darwin, determine filesystem case sensitivity at runtime

2023-11-21 Thread Iain Sandoe
Hello Simon, Arno, > On 17 Nov 2023, at 13:43, Simon Wright wrote: > >> >>> Apple’s naming is definitely confusing in this area! >>> >>> In current SDKs, TARGET_OS_MAC means code is being generated for a Mac OS X >>> variant, >>> which covers OSX, IOS, Watch … ; to determine which kind of

[PATCH] builtins: Fix fold_builtin_query clzg/ctzg side-effects handling [PR112639]

2023-11-21 Thread Jakub Jelinek
Hi! As the testcase shows, I've missed one spot where initially the code thinks it could use 2 argument IFN_CLZ/IFN_CTZ form, but then verifies it can't because it doesn't have the right target value and turns it into the arg0 ? arg1 : .C[LT]Z (arg0) form. That form evaluates the argument twice

Re: [PATCH] c: Add __builtin_stdc_bit_{width,floor,ceil} builtins

2023-11-21 Thread Jakub Jelinek
On Mon, Nov 20, 2023 at 02:55:33PM +, Joseph Myers wrote: > On Sat, 18 Nov 2023, Jakub Jelinek wrote: > > > +@defbuiltin{@var{type} __builtin_stdc_bit_ceil (@var{type} @var{arg})} > > +The @code{__builtin_stdc_bit_ceil} function is available only > > +in C. It is type-generic, the argument

Re: [PATCH] c: Add __builtin_stdc_bit_{width,floor,ceil} builtins

2023-11-21 Thread Jakub Jelinek
On Mon, Nov 20, 2023 at 04:03:07PM +0100, Jakub Jelinek wrote: > > Note that stdc_bit_ceil now has defined behavior (return 0) on overflow: > > CD2 comment FR-135 was accepted for the DIS at the June WG14 meeting. > > This affects both the documentation and the implementation, as they need > >

Re: [PATCH v5] gcc: Introduce -fhardened

2023-11-21 Thread Jakub Jelinek
On Thu, Nov 16, 2023 at 03:51:22PM -0500, Marek Polacek wrote: > Thanks, that's a good point. In this version I've added a target hook. > > On my system, -D_FORTIFY_SOURCE=3 will be used, and if I remove > linux_fortify_source_default_level it's =2 as expected. > > The only problem was that it

Re: [PATCH 2/2] gcov: Fix integer types in gen_counter_update()

2023-11-21 Thread Jakub Jelinek
On Tue, Nov 21, 2023 at 10:46:13AM +0100, Sebastian Huber wrote: > > > --- a/gcc/tree-profile.cc > > > +++ b/gcc/tree-profile.cc > > > @@ -284,7 +284,9 @@ gen_assign_counter_update (gimple_stmt_iterator *gsi, > > > gcall *call, tree func, > > > tree tmp = make_temp_ssa_name (result_type,

Re: [PATCH 1/1] sched-deps.cc (find_modifiable_mems): Avoid exponential behavior

2023-11-21 Thread Maxim Kuvyrkov
> On Nov 20, 2023, at 20:30, Alexander Monakov wrote: > > > On Mon, 20 Nov 2023, Maxim Kuvyrkov wrote: > >>> On Nov 20, 2023, at 17:52, Alexander Monakov wrote: >>> >>> >>> On Mon, 20 Nov 2023, Maxim Kuvyrkov wrote: >>> This patch avoids sched-deps.cc:find_inc() creating exponential

Re: [PATCH v2] gcov: Fix integer types in gen_counter_update()

2023-11-21 Thread Jakub Jelinek
On Tue, Nov 21, 2023 at 11:29:58AM +0100, Sebastian Huber wrote: > This change fixes issues like this: > > gcc.dg/gomp/pr27573.c: In function ‘main._omp_fn.0’: > gcc.dg/gomp/pr27573.c:19:1: error: non-trivial conversion in ‘ssa_name’ > 19 | } > | ^ > long int > long unsigned

Re: [PATCH v2] gcov: Fix integer types in gen_counter_update()

2023-11-21 Thread Sebastian Huber
On 21.11.23 11:34, Jakub Jelinek wrote: --- a/gcc/tree-profile.cc +++ b/gcc/tree-profile.cc @@ -281,10 +281,13 @@ gen_assign_counter_update (gimple_stmt_iterator *gsi, gcall *call, tree func, if (result) { tree result_type = TREE_TYPE (TREE_TYPE (func)); - tree tmp =

Re: [PATCH] c: Add __builtin_stdc_bit_{width,floor,ceil} builtins

2023-11-21 Thread Jakub Jelinek
On Mon, Nov 20, 2023 at 04:29:47PM +0100, Jakub Jelinek wrote: > On Mon, Nov 20, 2023 at 04:03:07PM +0100, Jakub Jelinek wrote: > > > Note that stdc_bit_ceil now has defined behavior (return 0) on overflow: > > > CD2 comment FR-135 was accepted for the DIS at the June WG14 meeting. > > > This

Re: [PATCH] rtl-optimization: Modify loop live data with livein of loop header

2023-11-21 Thread Richard Biener
On Tue, Nov 21, 2023 at 9:30 AM Ajit Agarwal wrote: > > Hello All: > > This patch marked LOOP_DATA->live as the livein at the loop header basic > block. This is because Livein at each basic block is live in at the loop > header. The current code does the same, you now have fewer regs live. In

Re: [RFC PATCH] Detecting lifetime-dse issues via Valgrind

2023-11-21 Thread Richard Biener
On Tue, Nov 21, 2023 at 9:56 AM Alexander Monakov wrote: > > > On Tue, 21 Nov 2023, Richard Biener wrote: > > > and this, too, btw. - the DSE actually happens, the latter transform not. > > We specifically "opt out" of doing that for QOI to not make undefined > > behavior worse. The more correct

Re: [PATCH] rtl-optimization: Modify loop live data with livein of loop header

2023-11-21 Thread Ajit Agarwal
On 21/11/23 3:15 pm, Ajit Agarwal wrote: > > > On 21/11/23 3:02 pm, Richard Biener wrote: >> On Tue, Nov 21, 2023 at 9:30 AM Ajit Agarwal wrote: >>> >>> Hello All: >>> >>> This patch marked LOOP_DATA->live as the livein at the loop header basic >>> block. This is because Livein at each basic

[COMMITTED] ada: Deep delta aggregates

2023-11-21 Thread Marc Poulhiès
From: Steve Baird Add support for "deep" delta aggregates, a GNAT-defined language extension conditionally enabled via the -gnatX0 switch. In a deep delta aggregate, a delta choice may specify a subcomponent (as opposed to just a component). gcc/ada/ * par.adb: Add new Boolean variable

[COMMITTED] ada: Fix misplaced index directive in documentation

2023-11-21 Thread Marc Poulhiès
The index directive must be located before the indexed element, at least for the generated texinfo to be correct. See: https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-index This was reported along with changes done in

[COMMITTED] ada: Runtime recompilation instructions improvements.

2023-11-21 Thread Marc Poulhiès
From: Doug Rupp Revise instructions to work on both cross and native targets hosted on Linux gcc/ada/ * libgnat/libada.gpr: Revise section 1 Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/libada.gpr | 13 +++-- 1 file changed, 7 insertions(+), 6

[COMMITTED] ada: Use CLOCK_MONOTONIC on VxWorks

2023-11-21 Thread Marc Poulhiès
From: Doug Rupp The monotonic clock keeps track of the time that has elapsed since system startup; that is, the value returned by clock_gettime() is the amount of time (in seconds and nanoseconds) that has passed since the system booted. The monotonic clock cannot be reset. As a result, time

[COMMITTED] ada: Further cleanup in finalization machinery

2023-11-21 Thread Marc Poulhiès
From: Eric Botcazou This removes the specific treatment of transient scopes in initialization procedures, which is obsolete. gcc/ada/ * exp_aggr.adb (Convert_To_Assignments): Do not treat initialization procedures specially when it comes to creating a transient scope. *

[COMMITTED] ada: Small cleanup in finalization machinery

2023-11-21 Thread Marc Poulhiès
From: Eric Botcazou This removes an obsolete flag and adjusts a couple of obsolete comments. gcc/ada/ * gen_il-fields.ads (Opt_Field_Enum): Remove Is_Finalization_Wrapper * gen_il-gen-gen_nodes.adb (N_Block_Statement): Likewise. * sinfo.ads (Is_Finalization_Wrapper):

[COMMITTED] ada: Fix spurious error on call with default parameter in generic package

2023-11-21 Thread Marc Poulhiès
From: Eric Botcazou This occurs when the default value is a function call returning a private type, and is caused by a bad interaction between two internal mechanisms. gcc/ada/ * sem_ch12.adb (Save_Global_References.Set_Global_Type): Beef up comment about the setting of the

[COMMITTED] ada: Deep delta aggregates cleanup.

2023-11-21 Thread Marc Poulhiès
From: Steve Baird Cleanup after the introduction of deep delta aggregates. Eliminate a new gnatcheck message. gcc/ada/ * sem_aggr.adb: Replace "not Present (...)" call with "No (...)" call. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_aggr.adb | 2 +- 1 file

[PATCH] rtl-optimization: Modify loop live data with livein of loop header

2023-11-21 Thread Ajit Agarwal
Hello All: This patch marked LOOP_DATA->live as the livein at the loop header basic block. This is because Livein at each basic block is live in at the loop header. Bootstrapped and regtested on powerpc64-linux-gnu. SPEC CPU 2017 benchmarks score is better than trunk wit this change for INT and

Re: [PATCH 2/2] gcov: Fix integer types in gen_counter_update()

2023-11-21 Thread Sebastian Huber
On 20.11.23 15:56, Jakub Jelinek wrote: On Mon, Nov 20, 2023 at 03:33:31PM +0100, Sebastian Huber wrote: This change fixes issues like this: gcc.dg/gomp/pr27573.c: In function ‘main._omp_fn.0’: gcc.dg/gomp/pr27573.c:19:1: error: non-trivial conversion in ‘ssa_name’ 19 | }

[COMMITTED] ada: Avoid Style_Checks pragmas affecting other units

2023-11-21 Thread Marc Poulhiès
From: Viljar Indus gcc/ada/ * par.adb: Restore Style_Checks after parsing each unit. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/par.adb | 17 + 1 file changed, 17 insertions(+) diff --git a/gcc/ada/par.adb b/gcc/ada/par.adb index

[COMMITTED] ada: Fix Ada.Text_IO.Delete with "encoding=8bits" form

2023-11-21 Thread Marc Poulhiès
From: Ronan Desplanques Before this patch, on Windows, file with non-ASCII Latin1 names could be created with Ada.Text_IO.Create by passing "encoding=8bits" through the Form parameter and a Latin1-encoded string through the Name parameter, but calling Ada.Text_IO.Delete on them raised an

[COMMITTED] ada: Small improvement to Null_Status function

2023-11-21 Thread Marc Poulhiès
From: Eric Botcazou The function is used to optimize away access checks. gcc/ada/ * sem_util.adb (Null_Status): Deal with unchecked type conversions. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_util.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[COMMITTED] ada: Fix string indexing within GNAT.Calendar.Time_IO.Value

2023-11-21 Thread Marc Poulhiès
From: Justin Squirek The patch fixes an issue in the compiler whereby calls to GNAT.Calendar.Time_IO.Value where the actual for formal String Date with indexing starting at any value besides one would result in a spurious runtime exception. gcc/ada/ * libgnat/g-catiio.adb (Value):

[COMMITTED] ada: Further cleanup in finalization machinery

2023-11-21 Thread Marc Poulhiès
From: Eric Botcazou The bodies of generic units are instantiated separately by GNAT at the end of the processing of the compilation unit. This requires the deferral of the generation of cleanups and finalization actions in enclosing scopes, except for instantiations in generic units where they

Re: [PATCH v2] gcov: Fix integer types in gen_counter_update()

2023-11-21 Thread Jakub Jelinek
On Tue, Nov 21, 2023 at 11:42:06AM +0100, Sebastian Huber wrote: > > > On 21.11.23 11:34, Jakub Jelinek wrote: > > > --- a/gcc/tree-profile.cc > > > +++ b/gcc/tree-profile.cc > > > @@ -281,10 +281,13 @@ gen_assign_counter_update (gimple_stmt_iterator > > > *gsi, gcall *call, tree func, > > >

Re: [PATCH, v2] Fortran: restrictions on integer arguments to SYSTEM_CLOCK [PR112609]

2023-11-21 Thread Mikael Morin
Hello, Le 20/11/2023 à 20:02, Steve Kargl a écrit : Harald, Sorry about delayed response. Got side-tracked by Family this weekend. On Sun, Nov 19, 2023 at 09:46:46PM +0100, Harald Anlauf wrote: On 11/19/23 01:04, Steve Kargl wrote: On Sat, Nov 18, 2023 at 11:12:55PM +0100, Harald Anlauf

Re: [PATCH] tree-ssa-math-opts: popcount (X) == 1 to (X ^ (X - 1)) > (X - 1) optimization for direct optab [PR90693]

2023-11-21 Thread Jakub Jelinek
On Mon, Nov 20, 2023 at 08:01:45AM +, Richard Biener wrote: > > On Fri, Nov 17, 2023 at 03:01:04PM +0100, Jakub Jelinek wrote: > > > As a follow-up, I'm considering changing in this routine the popcount > > > call to IFN_POPCOUNT with 2 arguments and during expansion test costs. > > > > Here

Re: [PATCH] c-family, middle-end: Add __builtin_c[lt]zg (arg, 0ULL) exception

2023-11-21 Thread Jakub Jelinek
On Tue, Nov 21, 2023 at 12:12:18AM +, Joseph Myers wrote: > On Mon, 20 Nov 2023, Jakub Jelinek wrote: > > > and be done with that. If there is an agreement we should do that > > for all 14 rather than just those 3 + the 2 ugly hacks (__builtin_c{l,t}zg > > with > > 0ULL second argument and

[PATCH] testsuite: Fix up pr111309-2.c on arm [PR111309]

2023-11-21 Thread Jakub Jelinek
Hi! ARM defaults to -fshort-enums and the following testcase FAILs there in 2 lines. The difference is that in C++, E0 has enum E type, which normally has unsigned int underlying type, so it isn't int nor something that promotes to int, which is why we diagnose it (in C it is promoted to int).

Re: [RFC PATCH] Detecting lifetime-dse issues via Valgrind

2023-11-21 Thread Alexander Monakov
On Tue, 21 Nov 2023, Richard Biener wrote: > and this, too, btw. - the DSE actually happens, the latter transform not. > We specifically "opt out" of doing that for QOI to not make undefined > behavior worse. The more correct transform would be to replace the > load with a __builtin_trap ()

Re: [PATCH]AArch64 docs: update -mcpu=generic definition on aarch64

2023-11-21 Thread Richard Earnshaw
On 20/11/2023 21:49, Tamar Christina wrote: -Original Message- From: Richard Earnshaw Sent: Monday, November 20, 2023 12:53 PM To: Tamar Christina ; gcc-patches@gcc.gnu.org Cc: nd ; Richard Earnshaw ; Marcus Shawcroft ; Kyrylo Tkachov ; Richard Sandiford Subject: Re: [PATCH]AArch64

Re: [PATCH] rtl-optimization: Modify loop live data with livein of loop header

2023-11-21 Thread Ajit Agarwal
On 21/11/23 3:02 pm, Richard Biener wrote: > On Tue, Nov 21, 2023 at 9:30 AM Ajit Agarwal wrote: >> >> Hello All: >> >> This patch marked LOOP_DATA->live as the livein at the loop header basic >> block. This is because Livein at each basic block is live in at the loop >> header. > > The

RE: [PATCH]AArch64 docs: update -mcpu=generic definition on aarch64

2023-11-21 Thread Tamar Christina
> > On 20/11/2023 21:49, Tamar Christina wrote: > >> -Original Message- > >> From: Richard Earnshaw > >> Sent: Monday, November 20, 2023 12:53 PM > >> To: Tamar Christina ; > >> gcc-patches@gcc.gnu.org > >> Cc: nd ; Richard Earnshaw ; > >> Marcus Shawcroft ; Kyrylo Tkachov > >> ; Richard

Re: [PATCH 4/4] gcov: Improve -fprofile-update=atomic

2023-11-21 Thread Jakub Jelinek
On Wed, Nov 15, 2023 at 06:51:10AM +0100, Sebastian Huber wrote: > sorry, in the patch I should use targetm.have_atomic instead of > TARGET_HAVE_LIBATOMIC. I've noticed the r14-5579 commit introduced some formatting issues, this patch fixes what I saw. In particular, operators don't go at the

[COMMITTED] ada: Small consistency fix for -gnatwv warning

2023-11-21 Thread Marc Poulhiès
From: Eric Botcazou The goal is to arrange for the warning to be issued consistently between objects whose address is taken and objects whose address is not taken. gcc/ada/ * sem_warn.adb (Check_References.Type_OK_For_No_Value_Assigned): New predicate.

[COMMITTED] ada: Compiler error reporting illegal prefix on legal loop iterator with "in"

2023-11-21 Thread Marc Poulhiès
From: Gary Dismukes During semantic analysis, the compiler fails to determine the cursor type in the case of a generalized iterator loop with "in", in the case where the iterator type has a parent type that is a controlled type (for example) and its ancestor iterator interface type is given

Re: [PATCH 2/2] gcov: Fix integer types in gen_counter_update()

2023-11-21 Thread Jakub Jelinek
On Tue, Nov 21, 2023 at 11:07:47AM +0100, Jakub Jelinek wrote: > > static inline void > > gen_assign_counter_update (gimple_stmt_iterator *gsi, gcall *call, tree > > func, > >tree result, const char *name) > > { > > if (result) > > { > > tree result_type =

Re: [PATCH]AArch64 Add pattern for unsigned widenings (uxtl) to zip{1, 2}

2023-11-21 Thread Richard Sandiford
Tamar Christina writes: > Hi All, > > This changes unpack instructions to use zip{1,2} when doing a zero-extending > widening operation. Permutes generally have a higher throughput than the > widening operations. Zeros are shuffled into the top half of the registers. > > The testcase > > void d2

Re: [PATCH v2] gcov: Fix integer types in gen_counter_update()

2023-11-21 Thread Sebastian Huber
On 21.11.23 11:46, Jakub Jelinek wrote: On Tue, Nov 21, 2023 at 11:42:06AM +0100, Sebastian Huber wrote: On 21.11.23 11:34, Jakub Jelinek wrote: --- a/gcc/tree-profile.cc +++ b/gcc/tree-profile.cc @@ -281,10 +281,13 @@ gen_assign_counter_update (gimple_stmt_iterator *gsi, gcall *call, tree

Re: [PATCH 02/11] rtl-ssa: Add some helpers for removing accesses

2023-11-21 Thread Richard Sandiford
Alex Coplan writes: > This adds some helpers to access-utils.h for removing accesses from an > access_array. This is needed by the upcoming aarch64 load/store pair > fusion pass. > > Bootstrapped/regtested as a series on aarch64-linux-gnu, OK for trunk? > > gcc/ChangeLog: > > *

Re: libstdc++: Speed up push_back

2023-11-21 Thread Jan Hubicka
> > + // RAII type to destroy initialized elements. > > There's only one initialized element, not "elements". > > > + struct _Guard_elts > > + { > > + pointer _M_first, _M_last; // Elements to destroy > > We only need to store one pointer here, call it

[Committed] RISC-V: Add missing dump check of pr112438.c

2023-11-21 Thread Juzhe-Zhong
Notice the dump check is missing, add it. Committed as it is obvious. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/pr112438.c: Add missing dump check. --- gcc/testsuite/gcc.target/riscv/rvv/autovec/pr112438.c | 1 + 1 file changed, 1 insertion(+) diff --git

Re: [BUG FIX] RISC-V: Disallow COSNT_VECTOR for DI on RV32

2023-11-21 Thread Robin Dapp
Hi Juzhe, > This bug is exposed when testing on zvl512b RV32 system. > > The rootcause is RA reload DI CONST_VECTOR into vmv.v.x then it ICE. > > So disallow DI CONST_VECTOR on RV32. OK. Regards Robin

Re: [PATCH] vect: Allow reduc_index != 1 for COND_OPs.

2023-11-21 Thread Richard Biener
On Tue, 21 Nov 2023, Robin Dapp wrote: > Hi, > > in PR112406 Tamar found another problem with COND_OP reductions. > I wrongly assumed that the reduction variable will always remain in > operand 1, just as we create the COND_OP in ifcvt. But of course, > addition being commutative, we are free

Re: [PATCH 03/11] aarch64, testsuite: Fix up auto-init-padding tests

2023-11-21 Thread Richard Sandiford
Alex Coplan writes: > The tests currently depending on memcpy lowering forming stps at -O0, > but we no longer want to form stps during memcpy lowering, but instead > in the load/store pair fusion pass. > > This patch therefore tweaks affected tests to enable optimizations > (-O1), and adjusts

Re: libstdc++: Speed up push_back

2023-11-21 Thread Jonathan Wakely
On Tue, 21 Nov 2023 at 12:50, Jan Hubicka wrote: > > > > + // RAII type to destroy initialized elements. > > > > There's only one initialized element, not "elements". > > > > > + struct _Guard_elts > > > + { > > > + pointer _M_first, _M_last; // Elements

Re: [PATCH] RISC-V: testsuite: Add rv64 requirement for bug-9 and bug-14.

2023-11-21 Thread Robin Dapp
> /* { dg-do run { target { { {riscv_v} && {rv64} } } } } */ > > Seems you should remove rv64 here ? sicne I think it is redundant here. Going to commit with that removed. Regards Robin

Re: [PATCH] RISC-V: testsuite: Fix popcount test.

2023-11-21 Thread Robin Dapp
> Mhm, not so obvious after all. We vectorize 250 instances with > rv32gcv, 229 with rv64gcv and 250 with rv64gcv_zbb. Will have > another look tomorrow. The problem is that tree-vect-patterns is more restrictive than necessary and does not vectorize everything it could. Therefore I'm going to

Re: Propagate value ranges of return values

2023-11-21 Thread Christophe Lyon
Hi! On Sun, 19 Nov 2023 at 16:05, Jan Hubicka wrote: > > Hi, > this is updated version which also adds testuiste compensation > I lost earlier while maintaining the patch in my testing tree. > There are quite few testcases that use constant return values to hide > something from optimizer. > >

Re: GCC/Rust libgrust-v2/to-submit branch

2023-11-21 Thread Arthur Cohen
Hi Thomas! A newer version of the library has been force-pushed to the branch `libgrust-v2/to-submit`. On 11/20/23 15:55, Thomas Schwinge wrote: Hi! Arthur and Pierre-Emmanuel have prepared a GCC/Rust libgrust-v2/to-submit branch:

Re: [PATCH 01/11] rtl-ssa: Support for inserting new insns

2023-11-21 Thread Richard Sandiford
Alex Coplan writes: > N.B. this is just a rebased (but otherwise unchanged) version of the > same patch already posted here: > > https://gcc.gnu.org/pipermail/gcc-patches/2023-October/633348.html > > this is the only unreviewed dependency from the previous series, so it > seemed easier just to

Re: [PATCH 04/11] aarch64, testsuite: Allow ldp/stp on SVE regs with -msve-vector-bits=128

2023-11-21 Thread Richard Sandiford
Alex Coplan writes: > Later patches in the series allow ldp and stp to use SVE modes if > -msve-vector-bits=128 is provided. This patch therefore adjusts tests > that pass -msve-vector-bits=128 to allow ldp/stp to save/restore SVE > registers. > > OK for trunk? > > gcc/testsuite/ChangeLog: > >

Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext

2023-11-21 Thread Arsen Arsenović
Arsen Arsenović writes: > Bruno Haible writes: > >> Arsen Arsenović wrote: >>> Comparing stages 2 and 3 >>> Bootstrap comparison failure! >>> gettext/libasprintf/autosprintf.o differs >>> make[2]: *** [Makefile:23435: compare] Error 1 >> >> You should be able to work around this by

Re: Propagate value ranges of return values

2023-11-21 Thread Jan Hubicka
> After this patch in addition to the problem already reported about > vlda1.c and return-value-range-1.c, we have noticed these regressions > on aarch64: > Running gcc:gcc.target/aarch64/aarch64.exp ... > FAIL: gcc.target/aarch64/movk.c scan-assembler movk\tx[0-9]+, 0x4667, lsl 16 > FAIL:

Re: [PATCH] RISC-V: testsuite: Fix popcount test.

2023-11-21 Thread juzhe.zhong
ok Replied Message FromRobin DappDate11/21/2023 21:35 Togcc-patches,palmer,Kito Cheng,jeffreyalaw,juzhe.zh...@rivai.ai Ccrdapp@gmail.comSubjectRe: [PATCH] RISC-V: testsuite: Fix popcount test.> Mhm, not so obvious after all.  We vectorize 250 instances with > rv32gcv, 229 with rv64gcv

Re: Pushed: LoongArch: Fix libgcc build failure when libc is not available (was Re: genopts: Add infrastructure to generate code for new features in ISA evolution)

2023-11-21 Thread Jeff Law
On 11/20/23 20:09, Xi Ruoyao wrote: On Tue, 2023-11-21 at 08:00 +0800, Xi Ruoyao wrote: /* snip */ This has broken libgcc builds when target libc isn't yet available. In file included from /scratch/jmyers/glibc-bot/src/gcc/libgcc/../gcc/config/loongarch/loongarch-def.h:49,   

Re: [PATCH 1/4] libsanitizer: merge from upstream (c425db2eb558c263)

2023-11-21 Thread Iain Sandoe
Hi FX > On 17 Nov 2023, at 11:57, FX Coudert wrote: > >> If they accept it say within a day, wait for it + cherry-pick to GCC, >> otherwise apply to GCC as a local patch in anticipation they accept it. >> If it is all that fixes Darwin support, great. > > With that patch, I can finish

Re: [PATCH 06/11] aarch64: Fix up aarch64_print_operand xzr/wzr case

2023-11-21 Thread Richard Sandiford
Alex Coplan writes: > This adjusts aarch64_print_operand to recognize zero rtxes in modes other than > VOIDmode. This allows us to use xzr/wzr for zero vectors, for example. > > Bootstrapped/regtested as a series on aarch64-linux-gnu, OK for trunk? > > gcc/ChangeLog: > > *

Re: [PATCH 07/11] aarch64: Fix up printing of ldp/stp with -msve-vector-bits=128

2023-11-21 Thread Richard Sandiford
Alex Coplan writes: > Later patches allow using SVE modes in ldp/stp with -msve-vector-bits=128, > so we need to make sure that we don't use SVE addressing modes when > printing the address for the ldp/stp. > > This patch does that. > > Bootstrapped/regtested as a series on aarch64-linux-gnu, OK

Re: [PATCH 1/4] libsanitizer: merge from upstream (c425db2eb558c263)

2023-11-21 Thread FX
> I see that the fix was applied locally (and my bootstraps on various Darwin > versions worked OK), > but I’m not clear if you submitted a PR upstream (or just the bug report). > If the fix is to remain > local-only, it should be added to the list in LOCAL_PATCHES. Patch was submitted

RE: [PATCH] aarch64: Add support for Ampere-1B (-mcpu=ampere1b) CPU

2023-11-21 Thread Tamar Christina
Hi Philipp, Could you rebase this patch on top of master please. Essentially we put each tuning model in its own file now. Thanks, Tamar > -Original Message- > From: Philipp Tomsich > Sent: Thursday, November 16, 2023 6:16 AM > To: gcc-patches@gcc.gnu.org > Cc: Kyrylo Tkachov ;

Re: [PATCH] tree-optimization/112623 - forwprop VEC_PACK_TRUNC generation

2023-11-21 Thread Jakub Jelinek
On Tue, Nov 21, 2023 at 02:35:02PM +, Richard Biener wrote: > For vec_pack_trunc patterns there can be an ambiguity for the > source mode for BFmode vs HFmode. The vectorizer checks > the insns operand mode for this, the following makes forwprop > do the same. That of course doesn't help if

[PATCH] vect: Allow reduc_index != 1 for COND_OPs.

2023-11-21 Thread Robin Dapp
Hi, in PR112406 Tamar found another problem with COND_OP reductions. I wrongly assumed that the reduction variable will always remain in operand 1, just as we create the COND_OP in ifcvt. But of course, addition being commutative, we are free to swap operand 1 and 2 and can end up with e.g.

Re: [PATCH 05/11] aarch64, testsuite: Fix up pr103147-10 tests

2023-11-21 Thread Richard Sandiford
Alex Coplan writes: > For the ret function, allow the loads to be emitted in either order in > the codegen. The order gets inverted with the new load/store pair pass. > > OK for trunk? > > gcc/testsuite/ChangeLog: > > * g++.target/aarch64/pr103147-10.C (ret): Allow loads in either order.

Re: Fix 'gcc.dg/tree-ssa/return-value-range-1.c' (was: Propagate value ranges of return values)

2023-11-21 Thread Jan Hubicka
> Hi! > > On 2023-11-19T16:05:42+0100, Jan Hubicka wrote: > > --- /dev/null > > +++ b/gcc/testsuite/gcc.dg/tree-ssa/return-value-range-1.c > > @@ -0,0 +1,22 @@ > > +/* { dg-do ling } */ > > ERROR: gcc.dg/tree-ssa/return-value-range-1.c: 1: syntax error for " > dg-do 1 ling " > > With that

Re: [PATCH v4] [tree-optimization/110279] Consider FMA in get_reassociation_width

2023-11-21 Thread Richard Biener
On Thu, Nov 9, 2023 at 6:53 PM Di Zhao OS wrote: > > > -Original Message- > > From: Richard Biener > > Sent: Tuesday, October 31, 2023 9:48 PM > > To: Di Zhao OS > > Cc: gcc-patches@gcc.gnu.org > > Subject: Re: [PATCH v4] [tree-optimization/110279] Consider FMA in > >

Re: [PATCH 0/4] v2 of Option handling: add documentation URLs

2023-11-21 Thread David Malcolm
On Tue, 2023-11-21 at 02:09 +0100, Hans-Peter Nilsson wrote: > > From: David Malcolm > > Date: Thu, 16 Nov 2023 09:28:54 -0500 > > > How is this looking for trunk? > > > > Thanks > > Dave > > > > > > David Malcolm (4): > >   options: add gcc/regenerate-opt-urls.py > >   Add generated

Re: [PATCH] testsuite: Fix up pr111309-2.c on arm [PR111309]

2023-11-21 Thread Christophe Lyon
On Tue, 21 Nov 2023 at 09:48, Jakub Jelinek wrote: > > Hi! > > ARM defaults to -fshort-enums and the following testcase FAILs there in 2 > lines. The difference is that in C++, E0 has enum E type, which normally > has unsigned int underlying type, so it isn't int nor something that > promotes to

Re: [PATCH 0/4] v2 of Option handling: add documentation URLs

2023-11-21 Thread Tobias Burnus
On 21.11.23 14:57, David Malcolm wrote: On Tue, 2023-11-21 at 02:09 +0100, Hans-Peter Nilsson wrote: Sorry for barging in though I did try finding the relevant discussion, but is committing this generated stuff necessary? Is it because we don't want to depend on Python being present at build

[PATCH] tree-optimization/112623 - forwprop VEC_PACK_TRUNC generation

2023-11-21 Thread Richard Biener
For vec_pack_trunc patterns there can be an ambiguity for the source mode for BFmode vs HFmode. The vectorizer checks the insns operand mode for this, the following makes forwprop do the same. That of course doesn't help if the target supports both conversions. Bootstrapped and tested on

[PATCH] Move VF based dependence check

2023-11-21 Thread Richard Biener
The following moves the check whether the maximum vectorization factor determined by data dependence analysis is in conflict with the chosen vectorization factor to after the point where we applied both the SLP and the unrolling adjustment to the vectorization factor. We check the latter before

  1   2   >