RE: [PATCH] IVOPTS: Add LEN_MASK_{LOAD, STORE} into 'get_alias_ptr_type_for_ptr_address'

2023-06-23 Thread Li, Pan2 via Gcc-patches
Committed as passed bootstrap and regression test, thanks Jeff. Pan -Original Message- From: Gcc-patches On Behalf Of Jeff Law via Gcc-patches Sent: Friday, June 23, 2023 10:59 PM To: juzhe.zh...@rivai.ai; gcc-patches@gcc.gnu.org Cc: rguent...@suse.de; richard.sandif...@arm.com Subject:

[r14-2050 Regression] FAIL: gfortran.dg/value_9.f90 -Os execution test on Linux/x86_64

2023-06-23 Thread haochen.jiang via Gcc-patches
On Linux/x86_64, d130ae8499e0c615e1636258d6901372316dfd93 is the first bad commit commit d130ae8499e0c615e1636258d6901372316dfd93 Author: Harald Anlauf Date: Thu Jun 22 22:07:41 2023 +0200 Fortran: ABI for scalar CHARACTER(LEN=1),VALUE dummy argument [PR110360] caused FAIL: gfortran.dg/v

Re: [PATCH] Introduce hardbool attribute for C

2023-06-23 Thread Alexandre Oliva via Gcc-patches
On Jun 16, 2023, Alexandre Oliva wrote: > On Aug 9, 2022, Alexandre Oliva wrote: >> Ping? > Ping? Refreshed, added setting of ENUM_UNDERLYING_TYPE, retested on > x86_64-linux-gnu (also on gcc-13). Here's a consolidated patch incorporating the doc and test patchlets sent out in response to Qi

[PATCH v6] tree-ssa-sink: Improve code sinking pass

2023-06-23 Thread Ajit Agarwal via Gcc-patches
Hello All: This patch improves code sinking pass to sink statements before call to reduce register pressure. Review comments are incorporated. For example : void bar(); int j; void foo(int a, int b, int c, int d, int e, int f) { int l; l = a + b + c + d +e + f; if (a != 5) { bar(

Re: [PATCH] Introduce hardbool attribute for C

2023-06-23 Thread Alexandre Oliva via Gcc-patches
On Jun 22, 2023, Bernhard Reutner-Fischer wrote: > On Wed, 21 Jun 2023 22:08:55 -0300 > Alexandre Oliva wrote: >> Thanks for the test. >> >> Did you mean for me to incorporate it into the patch, or do you mean to >> contribute it separately, if the feature happens to be accepted? > These were

Re: [PATCH] Introduce hardbool attribute for C

2023-06-23 Thread Alexandre Oliva via Gcc-patches
On Jun 23, 2023, Qing Zhao via Gcc-patches wrote: > -ftrivial-auto-var-init has been in GCC since GCC12. *nod*. IIRC I started designing hardbool in GCC10, but the first complete implementation was for GCC11. > The decision to use 0x00 for zero-initiation, 0xfe for pattern-initiation > has b

Re: [PATCH v3] i386: Allow -mlarge-data-threshold with -mcmodel=large

2023-06-23 Thread Fangrui Song via Gcc-patches
On Tue, Jun 13, 2023 at 2:49 PM Fangrui Song wrote: > On Mon, Jun 12, 2023 at 11:16 PM Jan Beulich wrote: > >> On 13.06.2023 05:28, Fangrui Song wrote: >> > --- /dev/null >> > +++ b/gcc/testsuite/gcc.target/i386/large-data.c >> > @@ -0,0 +1,13 @@ >> > +/* { dg-do compile } */ >> > +/* { dg-requi

Re: [PATCH] RISC-V: Refactor the integer ternary autovec pattern

2023-06-23 Thread 钟居哲
Is this patch ok for trunk ? Tests are all passed. juzhe.zh...@rivai.ai From: Juzhe-Zhong Date: 2023-06-22 06:38 To: gcc-patches CC: kito.cheng; palmer; rdapp.gcc; jeffreyalaw; Juzhe-Zhong Subject: [PATCH] RISC-V: Refactor the integer ternary autovec pattern Long time ago, I encounter ICE when

Re: [PATCH V2] LOOP IVOPTS: Apply LEN_MASK_{LOAD,STORE}

2023-06-23 Thread Jeff Law via Gcc-patches
On 6/23/23 17:41, juzhe.zh...@rivai.ai wrote: From: Ju-Zhe Zhong Hi, Jeff. I fix format as you suggested. Ok for trunk ? gcc/ChangeLog: * tree-ssa-loop-ivopts.cc (get_mem_type_for_internal_fn): Apply LEN_MASK_{LOAD,STORE}. Yes. Sorry I wasn't explicit that it was OK with the fo

[pushed: v2] text-art: remove explicit #include of C++ standard library headers

2023-06-23 Thread David Malcolm via Gcc-patches
On Fri, 2023-06-23 at 16:35 +0100, Alex Coplan wrote: > Thanks for the fix! I can confirm this fixes bootstrap on > x86_64-apple-darwin for me. Thanks Alex Unfortunately the patch I posted broke the build of the plugin in the testsuite, so I had to tweak things slightly. Here's v2 of the patch,

RE: [PATCH V6] VECT: Apply LEN_MASK_{LOAD,STORE} into vectorizer

2023-06-23 Thread Li, Pan2 via Gcc-patches
Committed as passed both bootstrap and regression tests. Pan -Original Message- From: Gcc-patches On Behalf Of Bernhard Reutner-Fischer via Gcc-patches Sent: Friday, June 23, 2023 5:39 PM To: Richard Sandiford Cc: juzhe.zh...@rivai.ai; gcc-patches@gcc.gnu.org; rguent...@suse.de Subject

[PATCH V2] LOOP IVOPTS: Apply LEN_MASK_{LOAD,STORE}

2023-06-23 Thread juzhe . zhong
From: Ju-Zhe Zhong Hi, Jeff. I fix format as you suggested. Ok for trunk ? gcc/ChangeLog: * tree-ssa-loop-ivopts.cc (get_mem_type_for_internal_fn): Apply LEN_MASK_{LOAD,STORE}. --- gcc/tree-ssa-loop-ivopts.cc | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff

[PATCH v3] Add leafy mode for zero-call-used-regs

2023-06-23 Thread Alexandre Oliva via Gcc-patches
On Jun 23, 2023, Qing Zhao via Gcc-patches wrote: > It’s better to add this definition earlier in the list of the “three > basic values”, to make it “four basic values”, like the following: Oh, my, sorry for being so dense, I had managed to miss that bit all this time somehow :-( > The sentence

[r14-2047 Regression] FAIL: gcc.target/i386/pr78904-1b.c scan-assembler [ \t]xorb on Linux/x86_64

2023-06-23 Thread haochen.jiang via Gcc-patches
On Linux/x86_64, d0e891406b16dc28905717de2333f5637cf71d3e is the first bad commit commit d0e891406b16dc28905717de2333f5637cf71d3e Author: Roger Sayle Date: Fri Jun 23 15:23:20 2023 +0100 Improved SUBREG simplifications in simplify-rtx.cc's simplify_subreg. caused FAIL: gcc.target/i386/pr

Re: Re: [PATCH] SSA ALIAS: Apply LEN_MASK_{LOAD, STORE} into SSA alias analysis

2023-06-23 Thread 钟居哲
Not sure since I saw MASK_STORE/LEN_STORE didn't compute size. juzhe.zh...@rivai.ai From: Jeff Law Date: 2023-06-24 03:20 To: juzhe.zhong; gcc-patches CC: rguenther; richard.sandiford Subject: Re: [PATCH] SSA ALIAS: Apply LEN_MASK_{LOAD, STORE} into SSA alias analysis On 6/23/23 07:56, ju

Re: Re: [PATCH] LOOP IVOPTS: Apply LEN_MASK_{LOAD,STORE}

2023-06-23 Thread 钟居哲
Ok will send V2 soon. juzhe.zh...@rivai.ai From: Jeff Law Date: 2023-06-24 03:14 To: juzhe.zhong; gcc-patches CC: rguenther; richard.sandiford Subject: Re: [PATCH] LOOP IVOPTS: Apply LEN_MASK_{LOAD,STORE} On 6/23/23 08:05, juzhe.zh...@rivai.ai wrote: > From: Ju-Zhe Zhong > > gcc/ChangeLo

Re: Re: [PATCH] SSA ALIAS: Apply LEN_MASK_STORE to 'ref_maybe_used_by_call_p_1'

2023-06-23 Thread 钟居哲
Not sure since I saw MASK_STORE/LEN_STORE didn't compute size. juzhe.zh...@rivai.ai From: Jeff Law Date: 2023-06-24 00:27 To: juzhe.zhong; gcc-patches CC: rguenther; richard.sandiford Subject: Re: [PATCH] SSA ALIAS: Apply LEN_MASK_STORE to 'ref_maybe_used_by_call_p_1' On 6/23/23 08:15,

Re: Re: [PATCH] DSE: Add LEN_MASK_STORE analysis into DSE

2023-06-23 Thread 钟居哲
Address comment. juzhe.zh...@rivai.ai From: Jeff Law Date: 2023-06-23 22:57 To: juzhe.zhong; gcc-patches CC: rguenther; richard.sandiford Subject: Re: [PATCH] DSE: Add LEN_MASK_STORE analysis into DSE On 6/23/23 08:48, juzhe.zh...@rivai.ai wrote: > From: Ju-Zhe Zhong > > gcc/ChangeLog: >

Go patch committed: Support bootstrapping Go 1.21

2023-06-23 Thread Ian Lance Taylor via Gcc-patches
compiler, libgo: support bootstrapping gc compiler In the Go 1.21 release the package internal/profile imports internal/lazyregexp. That works when bootstrapping with Go 1.17, because that compiler has internal/lazyregep and permits importing it. We also have internal/lazyregexp in libgo, but sin

[PATCH] c++: fix error reporting routines re-entered ICE [PR110175]

2023-06-23 Thread Marek Polacek via Gcc-patches
Here we get the "error reporting routines re-entered" ICE because of an unguarded use of warning_at. While at it, I added a check for a warning_at just above it. Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? PR c++/110175 gcc/cp/ChangeLog: * typeck.cc (cp_build_u

[pushed] c++: provide #include hint for missing includes [PR110164]

2023-06-23 Thread David Malcolm via Gcc-patches
> On Fri, 2023-06-23 at 12:08 -0400, Jason Merrill wrote: > > On 6/22/23 11:50, Marek Polacek wrote: > > > On Wed, Jun 21, 2023 at 04:44:00PM -0400, David Malcolm via Gcc-patches > > > wrote: > > > I'd like to ping this C++ FE patch for review: > > > https://gcc.gnu.org/pipermail/gcc-patches/2023-

Re: [PATCH] Introduce hardbool attribute for C

2023-06-23 Thread Qing Zhao via Gcc-patches
> On Jun 21, 2023, at 10:35 PM, Alexandre Oliva wrote: > > On Jun 21, 2023, Qing Zhao wrote: > >> I see that you have testing case to check the above built_in_trap call >> is generated by FE. >> Do you have a testing case to check the trap is happening at runtime? > > I have written such te

GCC nvptx: Silence warning?

2023-06-23 Thread Jan-Benedict Glaw
Hi Tom! Building with newer GCC versions (I'm doing CI builds with -Werror), we might see warnings like this: /usr/lib/gcc-snapshot/bin/g++ -fno-PIE -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-stri

Re: [PATCH 1/1] libcpp: allow UCS_LIMIT codepoints in UTF-8 strings

2023-06-23 Thread Jason Merrill via Gcc-patches
On 6/21/23 14:58, Ben Boeckel wrote: libcpp/ * charset.cc: Allow `UCS_LIMIT` in UTF-8 strings. Reported-by: Damien Guibouret Fixes: c1dbaa6656a (libcpp: reject codepoints above 0x10, 2023-06-06) Signed-off-by: Ben Boeckel Applied, moving the Fixes line up and changing the commit

Re: [PATCH v2] c++: Add support for -std={c,gnu}++2{c,6}

2023-06-23 Thread Jason Merrill via Gcc-patches
On 6/23/23 13:22, Marek Polacek wrote: On Fri, Jun 23, 2023 at 10:58:54AM -0400, Jason Merrill wrote: On 6/22/23 20:25, Marek Polacek wrote: It seems prudent to add C++26 now that the first C++26 papers have been approved. I followed commit r11-6920 as well as r8-3237. I was puzzled to see th

Re: [PATCH][RFC] Prevent TYPE_PRECISION on VECTOR_TYPEs

2023-06-23 Thread Jeff Law via Gcc-patches
On 6/23/23 02:26, Richard Biener via Gcc-patches wrote: The following makes sure that using TYPE_PRECISION on VECTOR_TYPE ICEs when tree checking is enabled. This should avoid wrong-code in cases like PR110182 and instead ICE. It also introduces a TYPE_PRECISION_RAW accessor and adjusts plac

Re: [PATCH] RISC-V: Split VF iterators for Zvfh(min).

2023-06-23 Thread Jeff Law via Gcc-patches
On 6/23/23 06:54, Li, Pan2 wrote: Thanks Robine for the explanation, it is very clear to me. Totally agree below parts and I think we can leave it to the maintainers of the RTL/Machine Descriptions. Now we could argue that combine's behavior should change here and an insn without any alter

Re: [PATCH] SSA ALIAS: Apply LEN_MASK_{LOAD, STORE} into SSA alias analysis

2023-06-23 Thread Jeff Law via Gcc-patches
On 6/23/23 07:56, juzhe.zh...@rivai.ai wrote: From: Ju-Zhe Zhong gcc/ChangeLog: * tree-ssa-alias.cc (ref_maybe_used_by_call_p_1): Apply LEN_MASK_{LOAD,STORE} --- gcc/tree-ssa-alias.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/tree-ssa-alias.cc b/gcc/tree-ssa-al

Re: [PATCH] LOOP IVOPTS: Apply LEN_MASK_{LOAD,STORE}

2023-06-23 Thread Jeff Law via Gcc-patches
On 6/23/23 08:05, juzhe.zh...@rivai.ai wrote: From: Ju-Zhe Zhong gcc/ChangeLog: * tree-ssa-loop-ivopts.cc (get_mem_type_for_internal_fn): Apply LEN_MASK_{LOAD,STORE}. --- gcc/tree-ssa-loop-ivopts.cc | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/t

Re: [PATCH v5 3/5] p1689r5: initial support

2023-06-23 Thread Jason Merrill via Gcc-patches
On 6/20/23 15:46, Ben Boeckel wrote: On Tue, Feb 14, 2023 at 16:50:27 -0500, Jason Merrill wrote: On 1/25/23 13:06, Ben Boeckel wrote: Header units (including the standard library headers) are 100% unsupported right now because the `-E` mechanism wants to import their BMIs. A new mode (i.e.,

Re: [PATCH] libstdc++: Use RAII in std::vector::_M_realloc_insert

2023-06-23 Thread Jonathan Wakely via Gcc-patches
On Fri, 23 Jun 2023 at 17:44, Jan Hubicka wrote: > > I intend to push this to trunk once testing finishes. > > > > I generated the diff with -b so the whitespace changes aren't shown, > > because there was some re-indenting that makes the diff look larger than > > it really is. > > > > Honza, I do

[PATCH v2] c++: Add support for -std={c,gnu}++2{c,6}

2023-06-23 Thread Marek Polacek via Gcc-patches
On Fri, Jun 23, 2023 at 10:58:54AM -0400, Jason Merrill wrote: > On 6/22/23 20:25, Marek Polacek wrote: > > It seems prudent to add C++26 now that the first C++26 papers have been > > approved. I followed commit r11-6920 as well as r8-3237. > > > > I was puzzled to see that -std=c++23 was marked

Re: [PATCH v2 3/3] c++: Improve location information in constexpr evaluation

2023-06-23 Thread Patrick Palka via Gcc-patches
On Wed, 29 Mar 2023, Nathaniel Shead via Gcc-patches wrote: > This patch caches the current expression's location information in the > constexpr_global_ctx struct, which allows subexpressions that have lost > location information to still provide accurate diagnostics. Also > rewrites a number of '

Re: [PATCH v2 2/3] c++: Improve constexpr error for dangling local variables

2023-06-23 Thread Patrick Palka via Gcc-patches
On Wed, 29 Mar 2023, Nathaniel Shead via Gcc-patches wrote: > Currently, when typeck discovers that a return statement will refer to a > local variable it rewrites to return a null pointer. This causes the > error messages for using the return value in a constant expression to be > unhelpful, espe

[PATCH] rs6000: Change GPR2 to volatile & non-fixed register for function that does not use TOC [PR110320]

2023-06-23 Thread P Jeevitha via Gcc-patches
Hi All, The following patch has been bootstrapped and regtested on powerpc64le-linux. Normally, GPR2 is the TOC pointer and is defined as a fixed and non-volatile register. However, it can be used as volatile for PCREL addressing. Therefore, if the code is PCREL and the user is not explicitly req

Re: [PATCH] libstdc++: Use RAII in std::vector::_M_realloc_insert

2023-06-23 Thread Jan Hubicka via Gcc-patches
> I intend to push this to trunk once testing finishes. > > I generated the diff with -b so the whitespace changes aren't shown, > because there was some re-indenting that makes the diff look larger than > it really is. > > Honza, I don't think this is likely to make much difference for the PR >

Re: [PATCH v2 1/3] c++: Track lifetimes in constant evaluation [PR70331, PR96630, PR98675]

2023-06-23 Thread Patrick Palka via Gcc-patches
On Wed, 29 Mar 2023, Nathaniel Shead via Gcc-patches wrote: > This adds rudimentary lifetime tracking in C++ constexpr contexts, > allowing the compiler to report errors with using values after their > backing has gone out of scope. We don't yet handle other ways of ending > lifetimes (e.g. explic

Re: Tiny phiprop compile time optimization

2023-06-23 Thread Richard Biener via Gcc-patches
> Am 23.06.2023 um 18:10 schrieb Jan Hubicka via Gcc-patches > : > > Hi, > here is updated version with TODO_update_ssa_only_virtuals. > bootstrapped/regtested x86_64-linux. OK? Ok Richard > gcc/ChangeLog: > >* tree-ssa-phiprop.cc (propagate_with_phi): Compute post dominators on >

Re: [PATCH] SSA ALIAS: Apply LEN_MASK_STORE to 'ref_maybe_used_by_call_p_1'

2023-06-23 Thread Jeff Law via Gcc-patches
On 6/23/23 08:15, juzhe.zh...@rivai.ai wrote: From: Ju-Zhe Zhong gcc/ChangeLog: * tree-ssa-alias.cc (call_may_clobber_ref_p_1): Add LEN_MASK_STORE. Doesn't this need to extract/compute the size argument in a manner similar to what DSE does? Jeff

Re: [PATCH 2/2] arm: Add support for MVE Tail-Predicated Low Overhead Loops

2023-06-23 Thread Andre Vieira (lists) via Gcc-patches
+ /* In order to find out if the loop is of type A or B above look for the + loop counter: it will either be incrementing by one per iteration or + it will be decrementing by num_of_lanes. We can find the loop counter + in the condition at the end of the loop. */ + rtx_insn *loop_c

Re: [PATCH] c++: redundant targ coercion for var/alias tmpls

2023-06-23 Thread Patrick Palka via Gcc-patches
On Fri, 23 Jun 2023, Jason Merrill wrote: > On 6/21/23 13:19, Patrick Palka wrote: > > When stepping through the variable/alias template specialization code > > paths, I noticed we perform template argument coercion twice: first from > > instantiate_alias_template / finish_template_variable and ag

Re: [PATCH] c++: Report invalid id-expression in decltype [PR100482]

2023-06-23 Thread Patrick Palka via Gcc-patches
On Sun, 30 Apr 2023, Nathaniel Shead via Gcc-patches wrote: > This patch ensures that any errors raised by finish_id_expression when > parsing a decltype expression are properly reported, rather than > potentially going ignored and causing invalid code to be accepted. > > We can also now remove t

Re: Tiny phiprop compile time optimization

2023-06-23 Thread Jan Hubicka via Gcc-patches
Hi, here is updated version with TODO_update_ssa_only_virtuals. bootstrapped/regtested x86_64-linux. OK? gcc/ChangeLog: * tree-ssa-phiprop.cc (propagate_with_phi): Compute post dominators on demand. (pass_phiprop::execute): Do not compute it here; return update_ssa

Re: PING: Re: [PATCH] c++: provide #include hint for missing includes [PR110164]

2023-06-23 Thread Jason Merrill via Gcc-patches
On 6/22/23 11:50, Marek Polacek wrote: On Wed, Jun 21, 2023 at 04:44:00PM -0400, David Malcolm via Gcc-patches wrote: I'd like to ping this C++ FE patch for review: https://gcc.gnu.org/pipermail/gcc-patches/2023-June/621779.html Not an approval, but LGTM, though some nits below: On We

Re: [PATCH] c++: Fix ICE with parameter pack of decltype(auto) [PR103497]

2023-06-23 Thread Patrick Palka via Gcc-patches
Hi, On Sat, 22 Apr 2023, Nathaniel Shead via Gcc-patches wrote: > Bootstrapped and tested on x86_64-pc-linux-gnu. > > -- 8< -- > > This patch raises an error early when the decltype(auto) specifier is > used as a parameter of a function. This prevents any issues with an > unexpected tree type l

Re: [PATCH] text-art: remove explicit #include of C++ standard library headers

2023-06-23 Thread Alex Coplan via Gcc-patches
Hi Dave, On 23/06/2023 10:36, David Malcolm wrote: > On Fri, 2023-06-23 at 12:52 +0100, Alex Coplan wrote: > > Hi David, > > > > It looks like this patch breaks bootstrap on Darwin. I tried a > > bootstrap on > > x86_64-apple-darwin and got errors building selftest-run-tests.cc: > > > > In file

Re: [PATCH] c++: redundant targ coercion for var/alias tmpls

2023-06-23 Thread Jason Merrill via Gcc-patches
On 6/21/23 13:19, Patrick Palka wrote: When stepping through the variable/alias template specialization code paths, I noticed we perform template argument coercion twice: first from instantiate_alias_template / finish_template_variable and again from tsubst_decl (during instantiate_template). It

Re: [PATCH] c++: Add support for -std={c,gnu}++2{c,6}

2023-06-23 Thread Jason Merrill via Gcc-patches
On 6/22/23 20:25, Marek Polacek wrote: It seems prudent to add C++26 now that the first C++26 papers have been approved. I followed commit r11-6920 as well as r8-3237. I was puzzled to see that -std=c++23 was marked Undocumented but -std=c++2b wasn't. I think it should be the other way round,

Re: [PATCH] IVOPTS: Add LEN_MASK_{LOAD, STORE} into 'get_alias_ptr_type_for_ptr_address'

2023-06-23 Thread Jeff Law via Gcc-patches
On 6/23/23 08:21, juzhe.zh...@rivai.ai wrote: From: Ju-Zhe Zhong gcc/ChangeLog: * tree-ssa-loop-ivopts.cc (get_alias_ptr_type_for_ptr_address): Add LEN_MASK_{LOAD,STORE}. OK jeff

Re: [PATCH] DSE: Add LEN_MASK_STORE analysis into DSE

2023-06-23 Thread Jeff Law via Gcc-patches
On 6/23/23 08:48, juzhe.zh...@rivai.ai wrote: From: Ju-Zhe Zhong gcc/ChangeLog: * tree-ssa-dse.cc (initialize_ao_ref_for_dse): Add LEN_MASK_STORE. (dse_optimize_stmt): Ditto. --- gcc/tree-ssa-dse.cc | 18 ++ 1 file changed, 18 insertions(+) diff --git

Re: [PATCH 1/6] Avoid shorten_binary_op on VECTOR_TYPE

2023-06-23 Thread Jeff Law via Gcc-patches
On 6/23/23 02:26, Richard Biener via Gcc-patches wrote: When we disallow TYPE_PRECISION on VECTOR_TYPEs it shows that shorten_binary_op performs some checks on that that are likely harmless in the end. The following bails out early for VECTOR_TYPE operations to avoid those questionable checks

Re: [PATCH 2/6] Fix TYPE_PRECISION use in hashable_expr_equal_p

2023-06-23 Thread Jeff Law via Gcc-patches
On 6/23/23 02:27, Richard Biener via Gcc-patches wrote: While the checks look unnecessary they probably are quick and thus done early. The following avoids using TYPE_PRECISION on VECTOR_TYPEs by making the code match the comment which talks about precision and signedness. An alternative wou

[PATCH] DSE: Add LEN_MASK_STORE analysis into DSE

2023-06-23 Thread juzhe . zhong
From: Ju-Zhe Zhong gcc/ChangeLog: * tree-ssa-dse.cc (initialize_ao_ref_for_dse): Add LEN_MASK_STORE. (dse_optimize_stmt): Ditto. --- gcc/tree-ssa-dse.cc | 18 ++ 1 file changed, 18 insertions(+) diff --git a/gcc/tree-ssa-dse.cc b/gcc/tree-ssa-dse.cc index 3c7a2

Re: [PATCH zero-call-used-regs] Add leafy mode for zero-call-used-regs

2023-06-23 Thread Qing Zhao via Gcc-patches
Hi, Alexandre, > On Jun 21, 2023, at 9:16 PM, Alexandre Oliva wrote: > > Hello, Qing, > > On Jun 16, 2023, Qing Zhao wrote: > >> As I mentioned in the previous round of review, I think that the >> documentation >> might need to add more details on what’s the LEAFY mode, >> The purpose of it

Re: [PATCH v5 5/5] c++modules: report module mapper files as a dependency

2023-06-23 Thread Jason Merrill via Gcc-patches
On 1/25/23 16:06, Ben Boeckel wrote: It affects the build, and if used as a static file, can reliably be tracked using the `-MF` mechanism. Hmm, this seems a bit like making all .o depend on the Makefile; it shouldn't be necessary to rebuild all TUs that use modules when we add another module

[pushed] testsuite,objective-c++: Fix imported NSObjCRuntime.h.

2023-06-23 Thread Iain Sandoe via Gcc-patches
Tested on x86_64-darwin, pushed to trunk, thanks Iain --- 8< --- We have imported some headers from the GNUStep project to allow us to maintain the testsuite independent to changing versions of system headers. One of these headers has a macro that (now we have support for __has_feature) expands

[PATCH] text-art: remove explicit #include of C++ standard library headers

2023-06-23 Thread David Malcolm via Gcc-patches
On Fri, 2023-06-23 at 12:52 +0100, Alex Coplan wrote: > Hi David, > > It looks like this patch breaks bootstrap on Darwin. I tried a > bootstrap on > x86_64-apple-darwin and got errors building selftest-run-tests.cc: > > In file included from > /Users/alecop01/toolchain/src/gcc/gcc/selftest-run-t

[PATCH] IVOPTS: Add LEN_MASK_{LOAD, STORE} into 'get_alias_ptr_type_for_ptr_address'

2023-06-23 Thread juzhe . zhong
From: Ju-Zhe Zhong gcc/ChangeLog: * tree-ssa-loop-ivopts.cc (get_alias_ptr_type_for_ptr_address): Add LEN_MASK_{LOAD,STORE}. --- gcc/tree-ssa-loop-ivopts.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/tree-ssa-loop-ivopts.cc b/gcc/tree-ssa-loop-ivopts.cc index 2b66fe66bc

[PATCH] SSA ALIAS: Apply LEN_MASK_STORE to 'ref_maybe_used_by_call_p_1'

2023-06-23 Thread juzhe . zhong
From: Ju-Zhe Zhong gcc/ChangeLog: * tree-ssa-alias.cc (call_may_clobber_ref_p_1): Add LEN_MASK_STORE. --- gcc/tree-ssa-alias.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/tree-ssa-alias.cc b/gcc/tree-ssa-alias.cc index 92dc1bb9987..f31fd042c2a 100644 --- a/gcc/tree-ssa-ali

[PATCH] LOOP IVOPTS: Apply LEN_MASK_{LOAD,STORE}

2023-06-23 Thread juzhe . zhong
From: Ju-Zhe Zhong gcc/ChangeLog: * tree-ssa-loop-ivopts.cc (get_mem_type_for_internal_fn): Apply LEN_MASK_{LOAD,STORE}. --- gcc/tree-ssa-loop-ivopts.cc | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/tree-ssa-loop-ivopts.cc b/gcc/tree-ssa-loop-ivopts.cc i

[PATCH] SSA ALIAS: Apply LEN_MASK_{LOAD, STORE} into SSA alias analysis

2023-06-23 Thread juzhe . zhong
From: Ju-Zhe Zhong gcc/ChangeLog: * tree-ssa-alias.cc (ref_maybe_used_by_call_p_1): Apply LEN_MASK_{LOAD,STORE} --- gcc/tree-ssa-alias.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/tree-ssa-alias.cc b/gcc/tree-ssa-alias.cc index e1bc04b82ba..92dc1bb9987 100644 --- a/gcc

[PATCH] GIMPLE_FOLD: Apply LEN_MASK_{LOAD,STORE} into GIMPLE_FOLD

2023-06-23 Thread juzhe . zhong
From: Ju-Zhe Zhong Hi, since we are going to have LEN_MASK_{LOAD,STORE} into loopVectorizer. Currenly, 1. we can fold MASK_{LOAD,STORE} into MEM when mask is all ones. 2. we can fold LEN_{LOAD,STORE} into MEM when (len - bias) is VF. Now, I think it makes sense that we can support fold LEN_MA

Re: Do not account __builtin_unreachable guards in inliner

2023-06-23 Thread Jan Hubicka via Gcc-patches
> > So you need to feed it with extra info on the optimized out stmts because > as-is it will not remove __builtin_unreachable (). That means you're My plan was to add entry point to tree-ssa-dce that will take an set of stmts declared dead by external force and will do the usual mark stage bypa

RE: [PATCH] RISC-V: Split VF iterators for Zvfh(min).

2023-06-23 Thread Li, Pan2 via Gcc-patches
Thanks Robine for the explanation, it is very clear to me. Totally agree below parts and I think we can leave it to the maintainers of the RTL/Machine Descriptions. > Now we could argue that combine's behavior should change here and an > insn without any alternatives is not actually available bu

[PATCH] narrowing initializers and initializer_constant_valid_p_1

2023-06-23 Thread Richard Biener via Gcc-patches
initializer_constant_valid_p_1 attempts to handle narrowing differences and sums but fails to handle when the overall value looks like VIEW_CONVERT_EXPR(NON_LVALUE_EXPR - VEC_COND_EXPR < { 0, 0 } == { 0, 0 } , { -1, -1 } , { 0, 0 } > ) where endtype is scalar integer but value is a vector

[PATCH] Fix initializer_constant_valid_p_1 TYPE_PRECISION use

2023-06-23 Thread Richard Biener via Gcc-patches
initializer_constant_valid_p_1 is letting through all conversions of float vector types that have the same number of elements but that's of course not valid. The following restricts the code to scalar floating point types as was probably intended (only scalar integer types are handled as well). B

[PATCH] Deal with vector typed operands in conversions

2023-06-23 Thread Richard Biener via Gcc-patches
The following avoids using TYPE_PRECISION on VECTOR_TYPE when looking for bit-precision changes in vectorizable_assignment. We didn't anticipate a stmt like _21 = VIEW_CONVERT_EXPR(vect__1.7_28); and the following makes sure to handle that. Bootstrapped and tested on x86_64-unknown-linux-gnu,

Re: [PATCH v5 4/5] c++modules: report imported CMI files as dependencies

2023-06-23 Thread Nathan Sidwell via Gcc-patches
On 6/22/23 22:45, Ben Boeckel wrote: On Thu, Jun 22, 2023 at 17:21:42 -0400, Jason Merrill wrote: On 1/25/23 16:06, Ben Boeckel wrote: They affect the build, so report them via `-MF` mechanisms. Why isn't this covered by the existing code in preprocessed_module? It appears as though it is n

Re: Do not account __builtin_unreachable guards in inliner

2023-06-23 Thread Richard Biener via Gcc-patches
On Fri, Jun 23, 2023 at 12:11 PM Jan Hubicka wrote: > > > On Mon, Jun 19, 2023 at 12:15 PM Jan Hubicka wrote: > > > > > > > On Mon, Jun 19, 2023 at 9:52 AM Jan Hubicka via Gcc-patches > > > > wrote: > > > > > > > > > > Hi, > > > > > this was suggested earlier somewhere, but I can not find the th

GCC 10.4.1 Status Report (2023-06-23)

2023-06-23 Thread Richard Biener via Gcc-patches
Status == The gcc-10 branch is open for regression and documentation fixes. The last release from the branch, GCC 10.5, before it is being closed is due. There will be a release candidate next week, Friday, June 30th followed by the actual release a week later on July 7th. Please check if

Re: [PATCH, OpenACC 2.7] Implement default clause support for data constructs

2023-06-23 Thread Thomas Schwinge
Hi Chung-Lin! On 2023-06-06T23:11:55+0800, Chung-Lin Tang wrote: > this patch implements the OpenACC 2.7 addition of default(none|present) > support > for data constructs. Thanks! It wasn't clear to me what is supposed to happen, for example, for: #pragma acc data default(none) {

Re: [PATCH][RFC] Prevent TYPE_PRECISION on VECTOR_TYPEs

2023-06-23 Thread Richard Biener via Gcc-patches
On Fri, 23 Jun 2023, Richard Biener wrote: > The following makes sure that using TYPE_PRECISION on VECTOR_TYPE > ICEs when tree checking is enabled. This should avoid wrong-code > in cases like PR110182 and instead ICE. > > It also introduces a TYPE_PRECISION_RAW accessor and adjusts > places I

Re: Ping [PATCH v4] Add condition coverage profiling

2023-06-23 Thread Jan Hubicka via Gcc-patches
> > > > gcc/ChangeLog: > > > > * builtins.cc (expand_builtin_fork_or_exec): Check > > profile_condition_flag. > > * collect2.cc (main): Add -fno-profile-conditions to OBSTACK. > > * common.opt: Add new options -fprofile-conditions and > > * doc/gcov.texi: Add --conditions

[PATCH] tree-optimization/96208 - SLP of non-grouped loads

2023-06-23 Thread Richard Biener via Gcc-patches
The following extends SLP discovery to handle non-grouped loads in loop vectorization in the case the same load appears in all lanes. Code generation is adjusted to mimick what we do for the case of single element interleaving (when the load is not unit-stride) which is already handled by SLP. Th

Re: [PATCH V1] RISC-V:Add float16 tuple type support

2023-06-23 Thread Andreas Schwab
../../gcc/lto-streamer-out.cc: In function 'void lto_output_init_mode_table()': ../../gcc/lto-streamer-out.cc:3177:10: error: 'void* memset(void*, int, size_t)' forming offset [256, 283] is out of the bounds [0, 256] of object 'streamer_mode_table' with type 'unsigned char [256]' [-Werror=array-b

Re: [PATCH 2/2] arm: Add support for MVE Tail-Predicated Low Overhead Loops

2023-06-23 Thread Andre Vieira (lists) via Gcc-patches
+ if (insn != arm_mve_get_loop_vctp (body)) +{ probably a good idea to invert the condition here and return false, helps reducing the indenting in this function. + /* Starting from the current insn, scan backwards through the insn + chain until BB_HEAD: "for each insn in t

Ping [PATCH v4] Add condition coverage profiling

2023-06-23 Thread Jørgen Kvalsvik via Gcc-patches
On 13/06/2023 09:59, Jørgen Kvalsvik wrote: > This patch adds support in gcc+gcov for modified condition/decision > coverage (MC/DC) with the -fprofile-conditions flag. MC/DC is a type of > test/code coverage and it is particularly important in the avation and > automotive industries for safety-cri

Re: Do not account __builtin_unreachable guards in inliner

2023-06-23 Thread Jan Hubicka via Gcc-patches
> On Mon, Jun 19, 2023 at 12:15 PM Jan Hubicka wrote: > > > > > On Mon, Jun 19, 2023 at 9:52 AM Jan Hubicka via Gcc-patches > > > wrote: > > > > > > > > Hi, > > > > this was suggested earlier somewhere, but I can not find the thread. > > > > C++ has assume attribute that expands int > > > > if

Re: [SVE][match.pd] Fix ICE observed in PR110280

2023-06-23 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 23 Jun 2023 at 14:58, Richard Biener wrote: > > On Fri, Jun 23, 2023 at 11:09 AM Prathamesh Kulkarni > wrote: > > > > On Thu, 22 Jun 2023 at 18:06, Richard Biener > > wrote: > > > > > > On Thu, Jun 22, 2023 at 11:08 AM Prathamesh Kulkarni > > > wrote: > > > > > > > > On Tue, 20 Jun 202

GCC 13.1.1 Status Report (2023-06-23)

2023-06-23 Thread Richard Biener via Gcc-patches
Status == The gcc-13 branch is open for regression and documentation fixes. It's time to plan for a GCC 13.2 release which should follow roughly two to three months after the .1 release. The plan is to do a release candidate for GCC 13.2 on Thursday, Jul 20th with the release following a w

Re: [PATCH V6] VECT: Apply LEN_MASK_{LOAD,STORE} into vectorizer

2023-06-23 Thread Bernhard Reutner-Fischer via Gcc-patches
On 23 June 2023 10:03:45 CEST, Richard Sandiford wrote: >> Fuse the block below into the one above as the condition seems to be >> identical? > >Yeah, true, but I think the idea is that the code above “Arguments are >ready” is calculating argument values, and the code after it is creating >code

Re: [SVE][match.pd] Fix ICE observed in PR110280

2023-06-23 Thread Richard Biener via Gcc-patches
On Fri, Jun 23, 2023 at 11:09 AM Prathamesh Kulkarni wrote: > > On Thu, 22 Jun 2023 at 18:06, Richard Biener > wrote: > > > > On Thu, Jun 22, 2023 at 11:08 AM Prathamesh Kulkarni > > wrote: > > > > > > On Tue, 20 Jun 2023 at 16:47, Richard Biener > > > wrote: > > > > > > > > On Tue, Jun 20, 2

Re: [SVE][match.pd] Fix ICE observed in PR110280

2023-06-23 Thread Prathamesh Kulkarni via Gcc-patches
On Thu, 22 Jun 2023 at 18:06, Richard Biener wrote: > > On Thu, Jun 22, 2023 at 11:08 AM Prathamesh Kulkarni > wrote: > > > > On Tue, 20 Jun 2023 at 16:47, Richard Biener > > wrote: > > > > > > On Tue, Jun 20, 2023 at 11:56 AM Prathamesh Kulkarni via Gcc-patches > > > wrote: > > > > > > > > Hi

Re: Re: [PATCH V6] VECT: Apply LEN_MASK_{LOAD,STORE} into vectorizer

2023-06-23 Thread 钟居哲
Oh. Ok Thanks Richard so much. I will merge V6 after I finished regression. Previously, I didn't understand whether you want V7 (I tried use google translator to translate your words :) Now I understand you are happy with V6. Thanks. juzhe.zh...@rivai.ai From: Richard Sandiford Date: 2023-06

[PATCH 5/6] Bogus and missed folding on vector compares

2023-06-23 Thread Richard Biener via Gcc-patches
fold_binary tries to transform (double)float1 CMP (double)float2 into float1 CMP float2 but ends up using TYPE_PRECISION on the argument types. For vector types that compares the number of lanes which should be always equal (so it's harmless as to not generating wrong code). The following instead

[PATCH 6/6] Use element_precision for match.pd arith conversion optimization

2023-06-23 Thread Richard Biener via Gcc-patches
The simplification (outertype)((innertype0)a+(innertype1)b) to ((newtype)a+(newtype)b) ends up using TYPE_PRECISION to check whether it can elide a conversion but in some paths there can be VECTOR_TYPEs where this instead compares the number of lanes. The following fixes the missed optimizations an

[PATCH 3/6] Properly guard vect_look_through_possible_promotion

2023-06-23 Thread Richard Biener via Gcc-patches
The function ends up getting called on VECTOR_TYPEs which it really isn't prepared for and with the TYPE_PRECISION checking changes will ICE. The following exits early when the type to work on isn't scalar integral. Bootstrap and regtest ongoing on x86_64-unknown-linux-gnu, will push after that f

[PATCH 4/6] Fix tree_simple_nonnegative_warnv_p for VECTOR_TYPEs

2023-06-23 Thread Richard Biener via Gcc-patches
tree_simple_nonnegative_warnv_p ends up being called on VECTOR_TYPEs which I think even gets the wrong answer here for tcc_comparison since vector bools are signed. The following properly guards that with !VECTOR_TYPE_P. Bootstrap and regtest ongoing on x86_64-unknown-linux-gnu, will push after t

[PATCH 2/6] Fix TYPE_PRECISION use in hashable_expr_equal_p

2023-06-23 Thread Richard Biener via Gcc-patches
While the checks look unnecessary they probably are quick and thus done early. The following avoids using TYPE_PRECISION on VECTOR_TYPEs by making the code match the comment which talks about precision and signedness. An alternative would be to only retain the ERROR_MARK and TYPE_MODE checks or u

[PATCH 1/6] Avoid shorten_binary_op on VECTOR_TYPE

2023-06-23 Thread Richard Biener via Gcc-patches
When we disallow TYPE_PRECISION on VECTOR_TYPEs it shows that shorten_binary_op performs some checks on that that are likely harmless in the end. The following bails out early for VECTOR_TYPE operations to avoid those questionable checks. Bootstrap and regtest ongoing on x86_64-unknown-linux-gnu.

[PATCH][RFC] Prevent TYPE_PRECISION on VECTOR_TYPEs

2023-06-23 Thread Richard Biener via Gcc-patches
The following makes sure that using TYPE_PRECISION on VECTOR_TYPE ICEs when tree checking is enabled. This should avoid wrong-code in cases like PR110182 and instead ICE. It also introduces a TYPE_PRECISION_RAW accessor and adjusts places I found that are eligible to use that. This patch require

[PATCH] Optimize vector codegen for invariant loads, fix SLP support

2023-06-23 Thread Richard Biener via Gcc-patches
The following avoids creating duplicate stmts for invariant loads which was necessary when the vector stmts were in a linked list. It also fixes SLP support which didn't correctly create the appropriate number of copies. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. * tree-

Re: Re: [PATCH V6] VECT: Apply LEN_MASK_{LOAD,STORE} into vectorizer

2023-06-23 Thread 钟居哲
Hi, Richard. I saw Berhard comments. Should I send a V7 to fuse 2 if (final_len) together which is the final version to be merged? Thanks. juzhe.zh...@rivai.ai From: Richard Sandiford Date: 2023-06-23 16:08 To: juzhe.zhong CC: gcc-patches; rguenther; rep.dot.nop Subject: Re: [PATCH V6] VEC

Re: [PATCH V6] VECT: Apply LEN_MASK_{LOAD,STORE} into vectorizer

2023-06-23 Thread Richard Sandiford via Gcc-patches
juzhe.zh...@rivai.ai writes: > From: Ju-Zhe Zhong > > Address comments from Richard and Bernhard from V5 patch. > V6 fixed all issues according their comments. > > gcc/ChangeLog: > > * internal-fn.cc (expand_partial_store_optab_fn): Adapt for > LEN_MASK_STORE. > (internal_load_fn_

Re: [PATCH] Fortran: ABI for scalar CHARACTER(LEN=1),VALUE dummy argument [PR110360]

2023-06-23 Thread Mikael Morin
Le 22/06/2023 à 22:23, Harald Anlauf via Fortran a écrit : Dear all, gfortran's ABI specifies that actual arguments to CHARACTER(LEN=1),VALUE dummy arguments are passed by value in the scalar case. That did work for constant strings being passed, but not in several other cases, where pointers w

Re: [PATCH V6] VECT: Apply LEN_MASK_{LOAD,STORE} into vectorizer

2023-06-23 Thread Richard Sandiford via Gcc-patches
Bernhard Reutner-Fischer writes: > On 23 June 2023 01:51:12 CEST, juzhe.zh...@rivai.ai wrote: >>From: Ju-Zhe Zhong > > I am sorry but I somehow overlooked a trivial spot in V5. > Nit which does not warrant an immediate next version, but please consider it > before pushing iff approved: > >>+

Re: [PATCH V6] VECT: Apply LEN_MASK_{LOAD,STORE} into vectorizer

2023-06-23 Thread Bernhard Reutner-Fischer via Gcc-patches
On 23 June 2023 01:51:12 CEST, juzhe.zh...@rivai.ai wrote: >From: Ju-Zhe Zhong I am sorry but I somehow overlooked a trivial spot in V5. Nit which does not warrant an immediate next version, but please consider it before pushing iff approved: >+if (final_len) >+ { >+

Re: [PATCH v5] tree-ssa-sink: Improve code sinking pass

2023-06-23 Thread Ajit Agarwal via Gcc-patches
On 23/06/23 7:44 am, Peter Bergner wrote: > On 6/1/23 11:54 PM, Ajit Agarwal via Gcc-patches wrote: >> >> >> On 01/06/23 2:06 pm, Bernhard Reutner-Fischer wrote: >>> On 1 June 2023 09:20:08 CEST, Ajit Agarwal wrote: Hello All: This patch improves code sinking pass to sink stateme

Re: Re: [PATCH V5] VECT: Apply LEN_MASK_{LOAD,STORE} into vectorizer

2023-06-23 Thread 钟居哲
Thanks Richi so much. I am gonna wait for Richard's final approve for V6 for : https://gcc.gnu.org/pipermail/gcc-patches/2023-June/622560.html which has some small fixes for his comments on V5. And Bootstrap has passed, regression is running. I am gonna wait for regression too. Thanks. juzhe