[PATCH] PR target/103069: Relax cmpxchg loop for x86 target

2021-11-12 Thread Hongyu Wang via Gcc-patches
Hi, >From the CPU's point of view, getting a cache line for writing is more expensive than reading. See Appendix A.2 Spinlock in: https://www.intel.com/content/dam/www/public/us/en/documents/white-papers/ xeon-lock-scaling-analysis-paper.pdf The full compare and swap will grab the cache line

Fix modref and hadnling of some builtins

2021-11-12 Thread Jan Hubicka via Gcc-patches
Hi, ipa-modref gets confused by EAF flags of memcpy becuase parameter 1 is escaping but used only directly. In modref we do not track values saved to memory and thus we clear all other flags on each store. This needs to also happen when called function escapes parameter. gcc/ChangeLog:

Re: [COMMITTED] path solver: Solve PHI imports first for ranges.

2021-11-12 Thread Andrew MacLeod via Gcc-patches
On 11/12/21 14:50, Richard Biener via Gcc-patches wrote: On November 12, 2021 8:46:25 PM GMT+01:00, Aldy Hernandez via Gcc-patches wrote: PHIs must be resolved first while solving ranges in a block, regardless of where they appear in the import bitmap. We went through a similar exercise for

Re: [PATCH] libstdc++: Use GCC_TRY_COMPILE_OR_LINK for getentropy, arc4random

2021-11-12 Thread Jonathan Wakely via Gcc-patches
On Fri, 12 Nov 2021, 20:24 Hans-Peter Nilsson via Libstdc++, < libstd...@gcc.gnu.org> wrote: > Since r12-5056-g3439657b0286, there has been a regression in > test results; an additional 100 FAILs running the g++ and > libstdc++ testsuite on cris-elf, a newlib target. The > failures are linker

Re: [PATCH] PR middle-end/103059: reload: Also accept ASHIFT with indexed addressing

2021-11-12 Thread Hans-Peter Nilsson
On Mon, 8 Nov 2021, Maciej W. Rozycki wrote: > On Sun, 7 Nov 2021, Hans-Peter Nilsson wrote: > > (I thought you'd use 6cb68940dcf9 and do the same for VAX.) > > I could, easily, but being confined to gcc/config/cris I don't expect it > to be included in the build let alone trigger anything.

Fix wrong code with pure functions

2021-11-12 Thread Jan Hubicka via Gcc-patches
Fix wrong code with pure functions I introduced bug into find_func_aliases_for_call in handling pure functions. Instead of reading global memory pure functions are believed to write global memory. This results in misoptimization of the testcase at -O1. The change to pta-callused.c updates the

Re: [RFC PATCH] or1k: Fix clobbering of _mcount argument if fPIC is enabled

2021-11-12 Thread Stafford Horne via Gcc-patches
I have committed this as is. -Stafford On Tue, Nov 09, 2021 at 09:13:08PM +0900, Stafford Horne wrote: > Recently we changed the PROFILE_HOOK _mcount call to pass in the link > register as an argument. This actually does not work when the _mcount > call uses a PLT because the GOT register setup

Re: [PATCH] options: Make -Ofast switch off -fsemantic-interposition

2021-11-12 Thread Martin Jambor
Hi, On Fri, Nov 12 2021, Martin Jambor wrote: > Hi, > > using -fno-semantic-interposition has been reported by various people > to bring about considerable speed up at the cost of strict compliance > to the ELF symbol interposition rules See for example >

[PATCH] fixincludes: simplify handling for access() failure [PR21283, PR80047]

2021-11-12 Thread Xi Ruoyao via Gcc-patches
POSIX says: On some implementations, if buf is a null pointer, getcwd() may obtain size bytes of memory using malloc(). In this case, the pointer returned by getcwd() may be used as the argument in a subsequent call to free(). Invoking getcwd() with buf as a null pointer is not

Re: [PATCH] libgomp, nvptx, v3: Honor OpenMP 5.1 num_teams lower bound

2021-11-12 Thread Alexander Monakov via Gcc-patches
On Fri, 12 Nov 2021, Jakub Jelinek via Gcc-patches wrote: > On Fri, Nov 12, 2021 at 08:47:09PM +0100, Jakub Jelinek wrote: > > The problem is that the argument of the num_teams clause isn't always known > > before target is launched. > > There was a design mistake that the clause has been put

[r12-5201 Regression] FAIL: g++.dg/pr98499.C -std=gnu++98 execution test on Linux/x86_64

2021-11-12 Thread sunil.k.pandey via Gcc-patches
On Linux/x86_64, 4526ec20f17a6182f754da9460d9d944dd123cc0 is the first bad commit commit 4526ec20f17a6182f754da9460d9d944dd123cc0 Author: Jan Hubicka Date: Fri Nov 12 16:34:03 2021 +0100 Fix ICE in tree-ssa-structalias.c caused FAIL: g++.dg/pr98499.C -std=gnu++14 execution test FAIL:

Re: [PATCH] Combine malloc + memset to calloc

2021-11-12 Thread Arnaud Charlet via Gcc-patches
> I apologize this is the diff I meant to send: Thanks for sending this diff. Note that in order to allow a review (and approval) of your change, you need to send also an explanation of your change, as well as the corresponding commit log. Thanks in advance! Arno

Re: [PATCH] libgomp, nvptx, v3: Honor OpenMP 5.1 num_teams lower bound

2021-11-12 Thread Alexander Monakov via Gcc-patches
On Fri, 12 Nov 2021, Jakub Jelinek via Gcc-patches wrote: > --- libgomp/config/nvptx/team.c.jj2021-05-25 13:43:02.793121350 +0200 > +++ libgomp/config/nvptx/team.c 2021-11-12 17:49:02.847341650 +0100 > @@ -32,6 +32,7 @@ > #include > > struct gomp_thread *nvptx_thrs

Re: [PATCH] fixincludes: fix portability issues about getcwd() [PR21283, PR80047]

2021-11-12 Thread Xi Ruoyao via Gcc-patches
On Fri, 2021-11-12 at 12:59 -0800, Bruce Korb wrote: > If you are going to be excruciatingly, painfully correct, free() is > going to be unhappy about freeing a static string in the event > getcwd() fails for some inexplicable reason. I'd replace the free() + > return with a call to exit. Maybe

[PATCH] Combine malloc + memset to calloc

2021-11-12 Thread Seija K. via Gcc-patches
I apologize this is the diff I meant to send: diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c index a2dd4895d48..25d9acda752 100644 --- a/gcc/ada/terminals.c +++ b/gcc/ada/terminals.c @@ -609,8 +609,7 @@ __gnat_setup_communication (struct TTY_Process** process_out) /* output param */ {

[PATCH] Combine malloc + memset to calloc

2021-11-12 Thread Seija K. via Gcc-patches
diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c index a2dd4895d48..25d9acda752 100644 --- a/gcc/ada/terminals.c +++ b/gcc/ada/terminals.c @@ -609,8 +609,7 @@ __gnat_setup_communication (struct TTY_Process** process_out) /* output param */ { struct TTY_Process* process; - process =

Re: [PATCH] fixincludes: fix portability issues about getcwd() [PR21283, PR80047]

2021-11-12 Thread Bruce Korb via Gcc-patches
If you are going to be excruciatingly, painfully correct, free() is going to be unhappy about freeing a static string in the event getcwd() fails for some inexplicable reason. I'd replace the free() + return with a call to exit. Maybe even: if (VERY_UNLIKELY (access (pz_curr_file, R_OK) !=

Re: [PATCH] PR fortran/102368 - Failure to compile program using the C_SIZEOF function in ISO_C_BINDING

2021-11-12 Thread Harald Anlauf via Gcc-patches
Hi Bernhard, Am 12.11.21 um 21:18 schrieb Bernhard Reutner-Fischer via Fortran: On Fri, 12 Nov 2021 18:39:48 +0100 Harald Anlauf via Fortran wrote: Sounds plausible. this is what I thought, too. And nvfortran and flang accept the testcase, as well as crayftn (cce/12.0.2). Intel accepts

[PATCH] Combine malloc + memset to calloc

2021-11-12 Thread Seija K. via Gcc-patches
diff --git a/gcc/ada/terminals.c b/gcc/ada/terminals.c index a2dd4895d48..25d9acda752 100644 --- a/gcc/ada/terminals.c +++ b/gcc/ada/terminals.c @@ -609,8 +609,7 @@ __gnat_setup_communication (struct TTY_Process** process_out) /* output param */ { struct TTY_Process* process; - process =

[PATCH] libstdc++: Use GCC_TRY_COMPILE_OR_LINK for getentropy, arc4random

2021-11-12 Thread Hans-Peter Nilsson via Gcc-patches
Since r12-5056-g3439657b0286, there has been a regression in test results; an additional 100 FAILs running the g++ and libstdc++ testsuite on cris-elf, a newlib target. The failures are linker errors, not finding a definition for getentropy. It appears newlib has since 2017-12-03 declarations of

Re: [PATCH] PR fortran/102368 - Failure to compile program using the C_SIZEOF function in ISO_C_BINDING

2021-11-12 Thread Bernhard Reutner-Fischer via Gcc-patches
On Fri, 12 Nov 2021 18:39:48 +0100 Harald Anlauf via Fortran wrote: Sounds plausible. Nits: > diff --git a/gcc/testsuite/gfortran.dg/c_sizeof_7.f90 > b/gcc/testsuite/gfortran.dg/c_sizeof_7.f90 > new file mode 100644 > index 000..3cfa3371f72 > --- /dev/null > +++

Re: [COMMITTED] path solver: Solve PHI imports first for ranges.

2021-11-12 Thread Aldy Hernandez via Gcc-patches
On Fri, Nov 12, 2021, 20:50 Richard Biener wrote: > On November 12, 2021 8:46:25 PM GMT+01:00, Aldy Hernandez via Gcc-patches < > gcc-patches@gcc.gnu.org> wrote: > >PHIs must be resolved first while solving ranges in a block, > >regardless of where they appear in the import bitmap. We went

Re: [wwwdocs][PATCH] Document deprecation of OpenMP MIC offloading in GCC 12

2021-11-12 Thread Richard Biener via Gcc-patches
On November 12, 2021 8:26:40 PM GMT+01:00, "H.J. Lu via Gcc-patches" wrote: >--- > htdocs/gcc-12/changes.html | 4 > 1 file changed, 4 insertions(+) Ok. Thanks, Richard. >diff --git a/htdocs/gcc-12/changes.html b/htdocs/gcc-12/changes.html >index 5f12fb42..c133786d 100644 >---

Re: [PATCH] Remove dead code.

2021-11-12 Thread Richard Biener via Gcc-patches
On November 12, 2021 8:18:59 PM GMT+01:00, "H.J. Lu" wrote: >On Fri, Nov 12, 2021 at 11:15 AM Richard Biener > wrote: >> >> On November 12, 2021 3:41:41 PM GMT+01:00, "H.J. Lu via Gcc-patches" >> wrote: >> >On Fri, Nov 12, 2021 at 6:27 AM Martin Liška wrote: >> >> >> >> On 11/8/21 15:19, Jeff

Re: [COMMITTED] path solver: Solve PHI imports first for ranges.

2021-11-12 Thread Richard Biener via Gcc-patches
On November 12, 2021 8:46:25 PM GMT+01:00, Aldy Hernandez via Gcc-patches wrote: >PHIs must be resolved first while solving ranges in a block, >regardless of where they appear in the import bitmap. We went through >a similar exercise for the relational code, but missed these. Must not all

PING: [PATCH] rs6000: MMA test case emits wrong code when building a vector pair

2021-11-12 Thread Peter Bergner via Gcc-patches
I'd like to ping the following patch. Peter On 10/27/21 8:37 PM, Peter Bergner via Gcc-patches wrote: > PR102976 shows a test case where we generate wrong code when building > a vector pair from 2 vector registers. The bug here is that with unlucky > register assignments, we can clobber one of

Re: [PATCH] libgomp, nvptx, v3: Honor OpenMP 5.1 num_teams lower bound

2021-11-12 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 12, 2021 at 08:47:09PM +0100, Jakub Jelinek wrote: > The problem is that the argument of the num_teams clause isn't always known > before target is launched. There was a design mistake that the clause has been put on teams rather than on target (well, for host teams we need it on

Re: [PATCH] libgomp, nvptx, v3: Honor OpenMP 5.1 num_teams lower bound

2021-11-12 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 12, 2021 at 10:16:11PM +0300, Alexander Monakov wrote: > I suspect there may be a misunderstanding here, or maybe your explanation is > incomplete. I don't think the intention of the standard was to force such > complexity. You can launch as many blocks on the GPU as you like, limited

[COMMITTED] path solver: Solve PHI imports first for ranges.

2021-11-12 Thread Aldy Hernandez via Gcc-patches
PHIs must be resolved first while solving ranges in a block, regardless of where they appear in the import bitmap. We went through a similar exercise for the relational code, but missed these. Tested on x86-64 & ppc64le Linux. gcc/ChangeLog: PR tree-optimization/103202 *

[wwwdocs][PATCH] Document deprecation of OpenMP MIC offloading in GCC 12

2021-11-12 Thread H.J. Lu via Gcc-patches
--- htdocs/gcc-12/changes.html | 4 1 file changed, 4 insertions(+) diff --git a/htdocs/gcc-12/changes.html b/htdocs/gcc-12/changes.html index 5f12fb42..c133786d 100644 --- a/htdocs/gcc-12/changes.html +++ b/htdocs/gcc-12/changes.html @@ -49,6 +49,10 @@ a work-in-progress. which still

Re: [PATCH] Remove dead code.

2021-11-12 Thread H.J. Lu via Gcc-patches
On Fri, Nov 12, 2021 at 11:15 AM Richard Biener wrote: > > On November 12, 2021 3:41:41 PM GMT+01:00, "H.J. Lu via Gcc-patches" > wrote: > >On Fri, Nov 12, 2021 at 6:27 AM Martin Liška wrote: > >> > >> On 11/8/21 15:19, Jeff Law wrote: > >> > > >> > > >> > On 11/8/2021 2:59 AM, Jakub Jelinek

Re: Enable pure/const discovery in modref

2021-11-12 Thread Jan Hubicka via Gcc-patches
> Hi Honza, > > On Thu, 11 Nov 2021 17:39:18 +0100 > Jan Hubicka via Gcc-patches wrote: > > > diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c > > index 422b52fba4b..550bdeded16 100644 > > --- a/gcc/ipa-pure-const.c > > +++ b/gcc/ipa-pure-const.c > > @@ -1513,6 +1611,9 @@

Re: [PATCH] Replace more DEBUG_EXPR_DECL creations with build_debug_expr_decl

2021-11-12 Thread Richard Biener via Gcc-patches
On November 12, 2021 3:39:56 PM GMT+01:00, Martin Jambor wrote: >Hi, > >On Tue, Nov 09 2021, Richard Biener wrote: >> On Mon, 8 Nov 2021, Martin Jambor wrote: >>> this patch introduces a helper function build_debug_expr_decl to build >>> DEBUG_EXPR_DECL tree nodes in the most common way and

Re: [PATCH] libgomp, nvptx, v3: Honor OpenMP 5.1 num_teams lower bound

2021-11-12 Thread Alexander Monakov via Gcc-patches
Hello Jakub, On Fri, 12 Nov 2021, Jakub Jelinek via Gcc-patches wrote: > On Fri, Nov 12, 2021 at 02:27:16PM +0100, Jakub Jelinek via Gcc-patches wrote: > > On Fri, Nov 12, 2021 at 02:20:23PM +0100, Jakub Jelinek via Gcc-patches > > wrote: > > > This patch assumes that .shared variables are

Re: [PATCH] Remove dead code.

2021-11-12 Thread Richard Biener via Gcc-patches
On November 12, 2021 3:41:41 PM GMT+01:00, "H.J. Lu via Gcc-patches" wrote: >On Fri, Nov 12, 2021 at 6:27 AM Martin Liška wrote: >> >> On 11/8/21 15:19, Jeff Law wrote: >> > >> > >> > On 11/8/2021 2:59 AM, Jakub Jelinek via Gcc-patches wrote: >> >> On Mon, Nov 08, 2021 at 09:45:39AM +0100,

Re: [PATCH 2/5] vect: Use generalised accessors to build SLP nodes

2021-11-12 Thread Richard Biener via Gcc-patches
On November 12, 2021 6:59:22 PM GMT+01:00, Richard Sandiford via Gcc-patches wrote: >This patch adds: > >- gimple_num_args >- gimple_arg >- gimple_arg_ptr > >for accessing rhs operands of an assignment, call or PHI. This is >similar to the existing gimple_get_lhs. > >I guess there's a danger

Re: [PATCH 1/5] vect: Use code_helper when building SLP nodes

2021-11-12 Thread Richard Biener via Gcc-patches
On November 12, 2021 6:57:29 PM GMT+01:00, Richard Sandiford via Gcc-patches wrote: >This patch uses code_helper to represent the common (and >alternative) operations when building an SLP node. It's not >much of a saving on its own, but it helps with later patches. > >Regstrapped on

Re: [PATCH] vect: Fix SVE mask_gather_load/store_store tests

2021-11-12 Thread Richard Biener via Gcc-patches
On November 12, 2021 6:55:47 PM GMT+01:00, Richard Sandiford via Gcc-patches wrote: >If-conversion now applies rewrite_to_defined_overflow to the >address calculation in an IFN_MASK_LOAD. This means that we >end up with: > >cast_base = (uintptr_t) base; >uncast_sum = cast_base + offset;

Re: [PATCH] vect: Fix vect_is_reduction

2021-11-12 Thread Richard Biener via Gcc-patches
On November 12, 2021 6:54:29 PM GMT+01:00, Richard Sandiford via Gcc-patches wrote: >The current definition of vect_is_reduction (provided for target >costing) misses some pattern statements. > >Regstrapped on aarch64-linux-gnu and x86_64-linux-gnu. OK to install? This now will return true for

[committed] analyzer: "__analyzer_dump_state" has no side-effects

2021-11-12 Thread David Malcolm via Gcc-patches
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as 72f1c1c452198ba1df6f70959180b201cedc506e. gcc/analyzer/ChangeLog: * engine.cc (exploded_node::on_stmt_pre): Return when handling "__analyzer_dump_state". Signed-off-by: David Malcolm ---

Re: [PATCH] vect: Pass mode to gather/scatter tests

2021-11-12 Thread Richard Biener via Gcc-patches
On November 12, 2021 6:53:04 PM GMT+01:00, Richard Sandiford via Gcc-patches wrote: >vect_check_gather_scatter had a binary “does this target support >internal gather/scatter functions” test. This dates from the time when >we only handled gathers and scatters via direct target support, with

[r12-5194 Regression] FAIL: c-c++-common/goacc/firstprivate-mappings-1.c scan-tree-dump omplower "(?n)#pragma omp target oacc_parallel firstprivate\\(array_li.[0-9]+\\) map\\(from:array_so \\[len: 4\\

2021-11-12 Thread sunil.k.pandey via Gcc-patches
On Linux/x86_64, b7e20480630e3eeb9eed8b3941da3b3f0c22c969 is the first bad commit commit b7e20480630e3eeb9eed8b3941da3b3f0c22c969 Author: Chung-Lin Tang Date: Fri Nov 12 20:29:00 2021 +0800 openmp: Relax handling of implicit map vs. existing device mappings caused FAIL:

[PATCH v2] Check optab before transforming atomic bit test and operations

2021-11-12 Thread H.J. Lu via Gcc-patches
On Fri, Nov 12, 2021 at 8:13 AM Jakub Jelinek wrote: > > On Fri, Nov 12, 2021 at 07:55:26AM -0800, H.J. Lu wrote: > > > I have following patch queued for testing for this... > > > > > > 2021-11-12 Jakub Jelinek > > > > > > PR target/103205 > > > * config/i386/sync.md

[PATCH 5/5] vect: Support masked gather loads with SLP

2021-11-12 Thread Richard Sandiford via Gcc-patches
This patch extends the previous SLP gather load support so that it can handle masked loads too. Regstrapped on aarch64-linux-gnu and x86_64-linux-gnu. OK to install? Richard gcc/ * tree-vect-slp.c (arg1_arg4_map): New variable. (vect_get_operand_map): Handle

[PATCH 4/5] if-conv: Apply VN to hoisted conversions

2021-11-12 Thread Richard Sandiford via Gcc-patches
This patch is a prerequisite for a later one. At the moment, if-conversion converts predicated POINTER_PLUS_EXPRs into non-wrapping forms, which for: … = base + offset becomes: tmp = (unsigned long) base … = tmp + offset It then hoists these conversions out of the loop where

[PATCH v2][GCC] arm: Add support for dwarf debug directives and pseudo hard-register for PAC feature.

2021-11-12 Thread Srinath Parvathaneni via Gcc-patches
Hello, This patch teaches the DWARF support in gcc about RA_AUTH_CODE pseudo hard-register and also .save {ra_auth_code} and .cfi_offset ra_auth_code dwarf directives for the PAC feature in Armv8.1-M architecture. RA_AUTH_CODE register number is 107 and it's dwarf register number is 143.

[PATCH 3/5] vect: Support gather loads with SLP

2021-11-12 Thread Richard Sandiford via Gcc-patches
This patch adds SLP support for IFN_GATHER_LOAD. Like the SLP support for IFN_MASK_LOAD, it works by treating only some of the arguments as child nodes. Unlike IFN_MASK_LOAD, it requires the other arguments (base, scale, and extension type) to be the same for all calls in the group. It does not

[PATCH 2/5] vect: Use generalised accessors to build SLP nodes

2021-11-12 Thread Richard Sandiford via Gcc-patches
This patch adds: - gimple_num_args - gimple_arg - gimple_arg_ptr for accessing rhs operands of an assignment, call or PHI. This is similar to the existing gimple_get_lhs. I guess there's a danger that these routines could be overused, such as in cases where gimple_assign_rhs1 etc. would be

[PATCH] libgomp, nvptx, v3: Honor OpenMP 5.1 num_teams lower bound

2021-11-12 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 12, 2021 at 02:27:16PM +0100, Jakub Jelinek via Gcc-patches wrote: > On Fri, Nov 12, 2021 at 02:20:23PM +0100, Jakub Jelinek via Gcc-patches wrote: > > This patch assumes that .shared variables are initialized to 0, > > https://docs.nvidia.com/cuda/parallel-thread-execution/index.html

[PATCH 1/5] vect: Use code_helper when building SLP nodes

2021-11-12 Thread Richard Sandiford via Gcc-patches
This patch uses code_helper to represent the common (and alternative) operations when building an SLP node. It's not much of a saving on its own, but it helps with later patches. Regstrapped on aarch64-linux-gnu and x86_64-linux-gnu. OK to install? Richard gcc/ * tree-vect-slp.c

[PATCH] vect: Fix SVE mask_gather_load/store_store tests

2021-11-12 Thread Richard Sandiford via Gcc-patches
If-conversion now applies rewrite_to_defined_overflow to the address calculation in an IFN_MASK_LOAD. This means that we end up with: cast_base = (uintptr_t) base; uncast_sum = cast_base + offset; sum = (orig_type *) uncast_sum; If the target supports IFN_MASK_GATHER_LOAD with

[PATCH] vect: Fix vect_is_reduction

2021-11-12 Thread Richard Sandiford via Gcc-patches
The current definition of vect_is_reduction (provided for target costing) misses some pattern statements. Regstrapped on aarch64-linux-gnu and x86_64-linux-gnu. OK to install? Richard gcc/ * tree-vectorizer.h (vect_is_reduction): Use STMT_VINFO_REDUC_IDX. gcc/testsuite/ *

[PATCH] vect: Pass mode to gather/scatter tests

2021-11-12 Thread Richard Sandiford via Gcc-patches
vect_check_gather_scatter had a binary “does this target support internal gather/scatter functions” test. This dates from the time when we only handled gathers and scatters via direct target support, with x86_64 using built-in functions and aarch64 using IFNs. But now that we can emulate

[committed] aarch64: Remove redundant costing code

2021-11-12 Thread Richard Sandiford via Gcc-patches
Previous patches made some of the complex parts of the issue rate code redundant. Tested on aarch64-linux-gnu & applied. Richard gcc/ * config/aarch64/aarch64.c (aarch64_vector_op::n_advsimd_ops): Delete. (aarch64_vector_op::m_seen_loads): Likewise.

[committed] aarch64: Use new hooks for vector comparisons

2021-11-12 Thread Richard Sandiford via Gcc-patches
Previously we tried to account for the different issue rates of the various vector modes by guessing what the Advanced SIMD version of an SVE loop would look like and what its issue rate was likely to be. We'd then increase the cost of the SVE loop if the Advanced SIMD loop might issue more

[committed] aarch64: Add vf_factor to aarch64_vec_op_count

2021-11-12 Thread Richard Sandiford via Gcc-patches
-mtune=neoverse-512tvb sets the likely SVE vector length to 128 bits, but it also takes into account Neoverse V1, which is a 256-bit target. This patch adds this VF (VL) factor to aarch64_vec_op_count. Tested on aarch64-linux-gnu & applied. Richard gcc/ * config/aarch64/aarch64.c

[PATCH] PR fortran/102368 - Failure to compile program using the C_SIZEOF function in ISO_C_BINDING

2021-11-12 Thread Harald Anlauf via Gcc-patches
Dear Fortranners, F2008:15.3.5 relaxed the condition on interoperable character variables and now allows values different from one. Similar text in F2018:18.3.4. This required an adjustment in the interoperability check. Regtested on x86_64-pc-linux-gnu. OK for mainline? Thanks, Harald From

[committed] aarch64: Move cycle estimation into aarch64_vec_op_count

2021-11-12 Thread Richard Sandiford via Gcc-patches
This patch just moves the main cycle estimation routines into aarch64_vec_op_count. Tested on aarch64-linux-gnu & applied. Richard gcc/ * config/aarch64/aarch64.c (aarch64_vec_op_count::rename_cycles_per_iter): New function.

[committed] aarch64: Use an array of aarch64_vec_op_counts

2021-11-12 Thread Richard Sandiford via Gcc-patches
-mtune=neoverse-512tvb uses two issue rates, one for Neoverse V1 and one with more generic parameters. We use both rates when making a choice between scalar, Advanced SIMD and SVE code. Previously we calculated the Neoverse V1 issue rates from the more generic issue rates, but by removing

[committed] aarch64: Use real scalar op counts

2021-11-12 Thread Richard Sandiford via Gcc-patches
Now that vector finish_costs is passed the associated scalar costs, we can record the scalar issue information while computing the scalar costs, rather than trying to estimate it while computing the vector costs. This simplifies things a little, but the main motivation is to improve accuracy.

[committed] aarch64: Get floatness from stmt_info

2021-11-12 Thread Richard Sandiford via Gcc-patches
This patch gets the floatness of a memory access from the data reference rather than the vectype. This makes it more suitable for use in scalar costing code. Tested on aarch64-linux-gnu & applied. Richard gcc/ * config/aarch64/aarch64.c (aarch64_dr_type): New function.

[committed] aarch64: Remove vectype from latency tests

2021-11-12 Thread Richard Sandiford via Gcc-patches
This patch gets the scalar mode of a reduction operation from the gimple stmt rather than the vectype. This makes it more suitable for use in scalar costs. Tested on aarch64-linux-gnu & applied. Richard gcc/ * config/aarch64/aarch64.c (aarch64_sve_in_loop_reduction_latency):

[committed] aarch64: Fold aarch64_sve_op_count into aarch64_vec_op_count

2021-11-12 Thread Richard Sandiford via Gcc-patches
Later patches make aarch64 use the new vector hooks. We then only need to track one set of ops for each aarch64_vector_costs structure. This in turn means that it's more convenient to merge aarch64_sve_op_count and aarch64_vec_op_count. The patch also adds issue info and vec flags to

[committed] aarch64: Detect more consecutive MEMs

2021-11-12 Thread Richard Sandiford via Gcc-patches
For tests like: int res[2]; void f1 (int x, int y) { res[0] = res[1] = x + y; } we generated: add w0, w0, w1 adrpx1, .LANCHOR0 add x2, x1, :lo12:.LANCHOR0 str w0, [x1, #:lo12:.LANCHOR0] str w0, [x2, 4]

Re: [PATCH 1/3] gimple-fold: Transform stp*cpy_chk to str*cpy directly

2021-11-12 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 12 Nov 2021 at 01:12, Siddhesh Poyarekar wrote: > > Avoid going through another folding cycle and use the ignore flag to > directly transform BUILT_IN_STPCPY_CHK to BUILT_IN_STRCPY when set, > likewise for BUILT_IN_STPNCPY_CHK to BUILT_IN_STPNCPY. > > Dump the transformation in dump_file

Re: [PATCH] gcc: vxworks: fix providing stdint.h header

2021-11-12 Thread Olivier Hainque via Gcc-patches
Hi Rasmus, We have had to use for stdbool a similar trick as we had for stdint (need to preinclude yyvals.h), which we will need to propagate somehow. I'm not yet sure how to reconcile that with your observations. Olivier > On 12 Nov 2021, at 11:15, Rasmus Villemoes wrote: > > Commit

Re: [PATCH][V2] rs6000: Remove unnecessary option manipulation.

2021-11-12 Thread Martin Liška
On 11/12/21 16:58, Segher Boessenkool wrote: On Fri, Nov 12, 2021 at 03:34:17PM +0100, Martin Liška wrote: On 11/11/21 18:52, Segher Boessenkool wrote: You forgot to send the commit message though? No, the patch is simple so I didn't write any message (except commit title). How is a

Re: [PATCH] x86: Require TARGET_HIMODE_MATH for HImode atomic bit expanders

2021-11-12 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 12, 2021 at 07:55:26AM -0800, H.J. Lu wrote: > > I have following patch queued for testing for this... > > > > 2021-11-12 Jakub Jelinek > > > > PR target/103205 > > * config/i386/sync.md (atomic_bit_test_and_set, > > atomic_bit_test_and_complement, > >

[PATCH][V4] rs6000: Remove unnecessary option manipulation.

2021-11-12 Thread Martin Liska
Do not set flag_rename_registers, it's already enabled with EnabledBy(funroll-loops) in the common.opt file. Use EnabledBy for unroll_only_small_loops which is a canonical approach how can be make option dependencies. gcc/ChangeLog: * config/rs6000/rs6000.c

Re: [Patch] Fortran/openmp: Fix '!$omp end'

2021-11-12 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 12, 2021 at 04:56:37PM +0100, Tobias Burnus wrote: > Fortran/openmp: Fix '!$omp end' > > gcc/fortran/ChangeLog: > > * parse.c (decode_omp_directive): Fix permitting 'nowait' for some > combined directives, add missing 'omp end ... loop'. > (gfc_ascii_statement): Fix

Re: [PATCH][V2] rs6000: Remove unnecessary option manipulation.

2021-11-12 Thread Segher Boessenkool
On Fri, Nov 12, 2021 at 03:34:17PM +0100, Martin Liška wrote: > On 11/11/21 18:52, Segher Boessenkool wrote: > >You forgot to send the commit message though? > > No, the patch is simple so I didn't write any message (except commit title). How is a maintainer supposed to know what the patch is

Re: [Patch] Fortran/openmp: Fix '!$omp end'

2021-11-12 Thread Tobias Burnus
On 12.11.21 13:02, Jakub Jelinek wrote: 3) anything combined with target allows it ... and puts it on 'target' as it shouldn't be on 'for' or 'do' in 'target ... parallel do/for ...', I'd guess. Updated patch attach. Tobias - Siemens Electronic Design Automation GmbH;

Re: [PATCH] x86: Require TARGET_HIMODE_MATH for HImode atomic bit expanders

2021-11-12 Thread H.J. Lu via Gcc-patches
On Fri, Nov 12, 2021 at 7:34 AM Jakub Jelinek wrote: > > On Fri, Nov 12, 2021 at 07:29:03AM -0800, H.J. Lu wrote: > > Check optab before transforming equivalent, but slighly different cases > > to their canonical forms in optimize_atomic_bit_test_and and require > > TARGET_HIMODE_MATH in HImode

Re: [PATCH] options: Make -Ofast switch off -fsemantic-interposition

2021-11-12 Thread Jan Hubicka via Gcc-patches
> Hi, > > using -fno-semantic-interposition has been reported by various people > to bring about considerable speed up at the cost of strict compliance > to the ELF symbol interposition rules See for example > https://fedoraproject.org/wiki/Changes/PythonNoSemanticInterpositionSpeedup > > As

[PATCH] options: Make -Ofast switch off -fsemantic-interposition

2021-11-12 Thread Martin Jambor
Hi, using -fno-semantic-interposition has been reported by various people to bring about considerable speed up at the cost of strict compliance to the ELF symbol interposition rules See for example https://fedoraproject.org/wiki/Changes/PythonNoSemanticInterpositionSpeedup As such I believe it

Fix ICE in tree-ssa-structalias

2021-11-12 Thread Jan Hubicka via Gcc-patches
Hi, this patch fixes ICE in sanity check of EAF flags determined: we can not escape/clobber/return param indirectly w/o reading it. I moved check earlier and fixed the wrong updates. Boottrapped/regtested x86_64-linux, comitted. Honza PR tree-optimization/103175 * ipa-modref.c

Re: [PATCH] x86: Require TARGET_HIMODE_MATH for HImode atomic bit expanders

2021-11-12 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 12, 2021 at 07:29:03AM -0800, H.J. Lu wrote: > Check optab before transforming equivalent, but slighly different cases > to their canonical forms in optimize_atomic_bit_test_and and require > TARGET_HIMODE_MATH in HImode atomic bit expanders. > > gcc/ > > PR target/103205 >

[PATCH] x86: Require TARGET_HIMODE_MATH for HImode atomic bit expanders

2021-11-12 Thread H.J. Lu via Gcc-patches
Check optab before transforming equivalent, but slighly different cases to their canonical forms in optimize_atomic_bit_test_and and require TARGET_HIMODE_MATH in HImode atomic bit expanders. gcc/ PR target/103205 * tree-ssa-ccp.c (optimize_atomic_bit_test_and): Check optab

[committed] libgomp: Unbreak gcn offload build

2021-11-12 Thread Jakub Jelinek via Gcc-patches
Hi! My recent libgomp change apparently broke libgomp build for gcn offloading. The problem is that gcn, unlike nvptx, doesn't override teams.c source file and the patch I've committed assumed all the non-LIBGOMP_USE_PTHREADS targets do not use it. My understanding is that gcn included

[PATCH][GCC] arm: Add support for dwarf debug directives and pseudo hard-register for PAC feature.

2021-11-12 Thread Srinath Parvathaneni via Gcc-patches
Hello, This patch teaches the DWARF support in gcc about RA_AUTH_CODE pseudo hard-register and also .save {ra_auth_code} and .cfi_offset ra_auth_code dwarf directives for the PAC feature in Armv8.1-M architecture. RA_AUTH_CODE register number is 107 and it's dwarf register number is 143.

Re: [PATCH] Remove dead code.

2021-11-12 Thread H.J. Lu via Gcc-patches
On Fri, Nov 12, 2021 at 6:44 AM Martin Liška wrote: > > On 11/12/21 15:41, H.J. Lu wrote: > > On Fri, Nov 12, 2021 at 6:27 AM Martin Liška wrote: > >> > >> On 11/8/21 15:19, Jeff Law wrote: > >>> > >>> > >>> On 11/8/2021 2:59 AM, Jakub Jelinek via Gcc-patches wrote: > On Mon, Nov 08, 2021

Re: [PATCH] Remove dead code.

2021-11-12 Thread Martin Liška
On 11/12/21 15:41, H.J. Lu wrote: On Fri, Nov 12, 2021 at 6:27 AM Martin Liška wrote: On 11/8/21 15:19, Jeff Law wrote: On 11/8/2021 2:59 AM, Jakub Jelinek via Gcc-patches wrote: On Mon, Nov 08, 2021 at 09:45:39AM +0100, Martin Liška wrote: This fixes issue reported in the PR. Ready to

Re: [PATCH] Remove dead code.

2021-11-12 Thread H.J. Lu via Gcc-patches
On Fri, Nov 12, 2021 at 6:27 AM Martin Liška wrote: > > On 11/8/21 15:19, Jeff Law wrote: > > > > > > On 11/8/2021 2:59 AM, Jakub Jelinek via Gcc-patches wrote: > >> On Mon, Nov 08, 2021 at 09:45:39AM +0100, Martin Liška wrote: > >>> This fixes issue reported in the PR. > >>> > >>> Ready to be

[PATCH] Replace more DEBUG_EXPR_DECL creations with build_debug_expr_decl

2021-11-12 Thread Martin Jambor
Hi, On Tue, Nov 09 2021, Richard Biener wrote: > On Mon, 8 Nov 2021, Martin Jambor wrote: >> this patch introduces a helper function build_debug_expr_decl to build >> DEBUG_EXPR_DECL tree nodes in the most common way and replaces with a >> call of this function all code pieces which build such a

Re: [PATCH] Remove MAY_HAVE_DEBUG_MARKER_STMTS and MAY_HAVE_DEBUG_BIND_STMTS.

2021-11-12 Thread Martin Liška
@Alexandre: PING On 10/18/21 12:05, Richard Biener wrote: On Mon, Oct 18, 2021 at 10:54 AM Martin Liška wrote: The macros correspond 1:1 to an option flags and make it harder to find all usages of the flags. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be

[PATCH] Fortran: Use build_debug_expr_decl to create DEBUG_DECL_EXPRs

2021-11-12 Thread Martin Jambor
Hi, This patch converts one more open coded construction of a DEBUG_EXPR_DECL to a call of build_debug_expr_decl that I missed in my previous patch because it happens to be in the Fortran front-end. Bootstrapped and tested on x86_64-linux. Since this should have been done by an earlier approved

[PATCH][V3] rs6000: Remove unnecessary option manipulation.

2021-11-12 Thread Martin Liska
gcc/ChangeLog: * config/rs6000/rs6000.c (rs6000_override_options_after_change): Do not set flag_rename_registers, it's already enabled with EnabledBy(funroll-loops). Use EnabledBy for unroll_only_small_loops. * config/rs6000/rs6000.opt: Use EnabledBy for

Re: [PATCH][V2] rs6000: Remove unnecessary option manipulation.

2021-11-12 Thread Martin Liška
On 11/11/21 18:52, Segher Boessenkool wrote: Hi! On Thu, Nov 04, 2021 at 01:36:06PM +0100, Martin Liška wrote: Sending the patch in a separate thread. Hello. You forgot to send the commit message though? No, the patch is simple so I didn't write any message (except commit title).

Re: [PATCH] Remove dead code.

2021-11-12 Thread Martin Liška
On 11/8/21 15:19, Jeff Law wrote: On 11/8/2021 2:59 AM, Jakub Jelinek via Gcc-patches wrote: On Mon, Nov 08, 2021 at 09:45:39AM +0100, Martin Liška wrote: This fixes issue reported in the PR. Ready to be installed? I'm not sure.  liboffloadmic is copied from upstream, so the right thing if

[PATCH][pushed] testsuite: Filter out TSVC test on Power [PR103051]

2021-11-12 Thread Martin Liška
Pushed to master. Martin PR testsuite/103051 gcc/testsuite/ChangeLog: * gcc.dg/vect/tsvc/vect-tsvc-s112.c: Skip test for old Power CPUs. --- gcc/testsuite/gcc.dg/vect/tsvc/vect-tsvc-s112.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH] libbacktrace: fix UBSAN issues

2021-11-12 Thread Martin Liška
On 11/11/21 20:21, Ian Lance Taylor wrote: On Thu, Nov 11, 2021 at 7:39 AM Martin Liška wrote: Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin Fix issues mentioned in the PR. PR libbacktrace/103167

[PATCH] tree-optimization/102880 - improve CD-DCE

2021-11-12 Thread Richard Biener via Gcc-patches
The PR shows a missed control-dependent DCE caused by CFG cleanup merging a forwarder resulting in a partially degenerate PHI node. With control-dependent DCE we need to mark control dependences of incoming edges into PHIs as necessary but that is unnecessarily conservative for the case when two

[committed] jit: fix -Werror=format-overflow= in testsuite [PR103199]

2021-11-12 Thread David Malcolm via Gcc-patches
Successfully regression-tested on x86_64-pc-linux-gnu, improves jit.sum: FAIL: 2->0 (-2) PASS: 12043->12073 (+30) Pushed to trunk as r12-5196-gaa1fd30df56d752e3d5a81af409875a1f1e3e327. gcc/jit/ChangeLog: PR jit/103199 * docs/examples/tut04-toyvm/toyvm.c

[PATCH] libgomp, nvptx, v2: Honor OpenMP 5.1 num_teams lower bound

2021-11-12 Thread Jakub Jelinek via Gcc-patches
On Fri, Nov 12, 2021 at 02:20:23PM +0100, Jakub Jelinek via Gcc-patches wrote: > This patch assumes that .shared variables are initialized to 0, > https://docs.nvidia.com/cuda/parallel-thread-execution/index.html lists > in Table 7. .shared as non-initializable. If that isn't the case, > we need

[PATCH] libgomp, nvptx: Honor OpenMP 5.1 num_teams lower bound

2021-11-12 Thread Jakub Jelinek via Gcc-patches
Hi! Here is an completely untested attempt at implementing what I was talking about, that for num_teams_upper 0 or whenever num_teams_lower <= num_blocks, the current implementation is fine but if the user explicitly asks for more teams than we can provide in hardware, we need to stop assuming

Re: [PATCH 1v2/3][vect] Add main vectorized loop unrolling

2021-11-12 Thread Richard Biener via Gcc-patches
On Thu, 11 Nov 2021, Andre Vieira (lists) wrote: > Hi, > > This is the rebased and reworked version of the unroll patch.  I wasn't > entirely sure whether I should compare the costs of the unrolled loop_vinfo > with the original loop_vinfo it was unrolled of. I did now, but I wasn't too > sure

Fix ipa-modref pure/const discovery

2021-11-12 Thread Jan Hubicka via Gcc-patches
Hi, this patch fixes bug I introduced while breaking up the bigger change. We currently can not use pure/const to discover looping pures since lack of global memory writes/stores does not imply we can CSE on the function. THis is witnessed by testsuite doing volatile asm or also can happen if

Re: [PATCH 1/7] ifcvt: Check if cmovs are needed.

2021-11-12 Thread Robin Dapp via Gcc-patches
Hi Richard, > It's hard to judge this in isolation because it's not clear when > and how the new arguments are going to be used, but it seems OK > in principle. Do you still want: > > /* If earliest == jump, try to build the cmove insn directly. > This is helpful when combine has created

Re: Use modref summary to DSE calls to non-pure functions

2021-11-12 Thread Richard Biener via Gcc-patches
On Fri, Nov 12, 2021 at 12:39 PM Jan Hubicka wrote: > > Hi, > this is updated patch. It moves the summary walk checking if we can > possibly suceed on dse to summary->finalize member function so it is done > once per summary and refactors dse_optimize_call to be called from > dse_optimize_stmt

[committed] libstdc++: Print assertion messages to stderr [PR59675]

2021-11-12 Thread Jonathan Wakely via Gcc-patches
This replaces the printf used by failed debug assertions with fprintf, so we can write to stderr. To avoid including the assert function is moved into the library. To avoid programs using a vague linkage definition of the old inline function, the function is renamed. Code compiled with old

  1   2   >