Re: [PATCH] -Walloca-larger-than with constant sizes at -O0 (PR 100425)

2021-05-05 Thread Martin Sebor via Gcc-patches
On 5/5/21 1:32 AM, Richard Biener wrote: On Wed, May 5, 2021 at 4:20 AM Martin Sebor via Gcc-patches wrote: Even when explicitly enabled, -Walloca-larger-than doesn't run unless optimization is enabled as well. This prevents diagnosing alloca calls with constant arguments in excess of the lim

[PATCH]AArch64: Have -mcpu=native and -march=native enable extensions when CPU is unknown

2021-05-05 Thread Tamar Christina via Gcc-patches
Hi All, Currently when using -mcpu=native or -march=native on a CPU that is unknown to the compiler the compiler currently just used -march=armv8-a and enables none of the extensions. To make this a bit more useful this patch changes it to still use -march=armv8.a but to enable the extensions. W

[PATCH] Vect: Remove restrictions on dotprod signedness

2021-05-05 Thread Tamar Christina via Gcc-patches
Hi All, There's no reason that the sign of the operands of dot-product have to all be the same. The only restriction really is that the sign of the multiplicands are the same, however the sign between the multiplier and the accumulator need not be the same. The type of the overall operations sho

[PATCH 1/4]middle-end Vect: Add support for dot-product where the sign for the multiplicant changes.

2021-05-05 Thread Tamar Christina via Gcc-patches
Hi All, This patch adds support for a dot product where the sign of the multiplication arguments differ. i.e. one is signed and one is unsigned but the precisions are the same. #define N 480 #define SIGNEDNESS_1 unsigned #define SIGNEDNESS_2 signed #define SIGNEDNESS_3 signed #define SIGNEDNESS_4

[PATCH 3/4][AArch32]: Add support for sign differing dot-product usdot for NEON.

2021-05-05 Thread Tamar Christina via Gcc-patches
Hi All, This adds optabs implementing usdot_prod. The following testcase: #define N 480 #define SIGNEDNESS_1 unsigned #define SIGNEDNESS_2 signed #define SIGNEDNESS_3 signed #define SIGNEDNESS_4 unsigned SIGNEDNESS_1 int __attribute__ ((noipa)) f (SIGNEDNESS_1 int res, SIGNEDNESS_3 char *restri

[PATCH 2/4]AArch64: Add support for sign differing dot-product usdot for NEON and SVE.

2021-05-05 Thread Tamar Christina via Gcc-patches
Hi All, This adds optabs implementing usdot_prod. The following testcase: #define N 480 #define SIGNEDNESS_1 unsigned #define SIGNEDNESS_2 signed #define SIGNEDNESS_3 signed #define SIGNEDNESS_4 unsigned SIGNEDNESS_1 int __attribute__ ((noipa)) f (SIGNEDNESS_1 int res, SIGNEDNESS_3 char *restri

[PATCH 4/4]middle-end: Add tests middle end generic tests for sign differing dotproduct.

2021-05-05 Thread Tamar Christina via Gcc-patches
Hi All, This adds testcases to test for auto-vect detection of the new sign differing dot product. Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. Ok for master? Thanks, Tamar gcc/ChangeLog: * doc/sourcebuild.texi (arm_v8_2a_i8mm_neon_hw): Document. gcc/testsuite/Chan

FW: [PATCH 3/4][AArch32]: Add support for sign differing dot-product usdot for NEON.

2021-05-05 Thread Tamar Christina via Gcc-patches
Forgot to CC maintainers.. -Original Message- From: Tamar Christina Sent: Wednesday, May 5, 2021 6:39 PM To: gcc-patches@gcc.gnu.org Cc: nd Subject: [PATCH 3/4][AArch32]: Add support for sign differing dot-product usdot for NEON. Hi All, This adds optabs implementing usdot_prod. Th

[PATCH] regcprop: Fix another cprop_hardreg bug [PR100342]

2021-05-05 Thread Jakub Jelinek via Gcc-patches
On Tue, Jan 19, 2021 at 04:10:33PM +, Richard Sandiford via Gcc-patches wrote: > Ah, ok, thanks for the extra context. > > So AIUI the problem when recording xmm2<-di isn't just: > > [A] partial_subreg_p (vd->e[sr].mode, GET_MODE (src)) > > but also that: > > [B] partial_subreg_p (vd->e[

Re: [PATCH v2] x86: Build only one __cpu_model/__cpu_features2 variables

2021-05-05 Thread Uros Bizjak via Gcc-patches
On Wed, May 5, 2021 at 4:50 PM H.J. Lu wrote: > > On Wed, May 05, 2021 at 09:36:16AM +0200, Richard Biener wrote: > > On Mon, May 3, 2021 at 11:31 AM Ivan Sorokin via Gcc-patches > > wrote: > > > > > > Prior to this commit GCC -O2 generated quite bad code for this > > > function: > > > > > > bool

Re: [PATCH] Remove CC0

2021-05-05 Thread Koning, Paul via Gcc-patches
> On May 5, 2021, at 8:45 AM, Segher Boessenkool > wrote: > > Hi~ > > On Tue, May 04, 2021 at 04:08:22PM +0100, Richard Earnshaw wrote: >> On 03/05/2021 23:55, Segher Boessenkool wrote: >>> CC_STATUS_INIT is suggested in final.c to also be useful for ports that >>> are not CC0, and at least

[Patch, fortran] PR84119 - Type parameter inquiry for PDT returns array instead of scalar

2021-05-05 Thread Paul Richard Thomas via Gcc-patches
Ping! On Tue, 20 Apr 2021 at 12:51, Paul Richard Thomas < paul.richard.tho...@gmail.com> wrote: > Hi All, > > This is another PDT warm-up patch before tackling the real beast: PR82649. > > As the contributor wrote in the PR, "The F08 standard clearly > distinguishes between type parameter definit

[PATCH] RISC-V: Generate helpers for cbranch4

2021-05-05 Thread Christoph Muellner via Gcc-patches
On RISC-V we are facing the fact, that our conditional branches require Pmode conditions. Currently, we generate them explicitly with a check for Pmode and then calling the proper generator (i.e. gen_cbranchdi4 on RV64 and gen_cbranchsi4 on RV32). Let's simplify this code by generating the INSN hel

Re: [PATCH 09/10] RISC-V: Generate helpers for cbranch4 [PR 100266]

2021-05-05 Thread Christoph Müllner via Gcc-patches
On Mon, Apr 26, 2021 at 4:40 PM Kito Cheng wrote: > > This patch is a good and simple improvement which could be an independent > patch. > > There is only 1 comment from me for this patch, could you also add @ > to cbranch pattern for floating mode, I would prefer make the > gen_cbranch4 could ha

[PATCH v2 00/10] [RISC-V] Atomics improvements [PR100265/PR100266]

2021-05-05 Thread Christoph Muellner via Gcc-patches
This series provides a cleanup of the current atomics implementation of RISC-V: * PR100265: Use proper fences for atomic load/store * PR100266: Provide programmatic implementation of CAS As both are very related, I merged the patches into one series. The first patch could be squashed into the fo

[PATCH v2 01/10] RISC-V: Simplify memory model code [PR 100265]

2021-05-05 Thread Christoph Muellner via Gcc-patches
We don't have any special treatment of MEMMODEL_SYNC_* values, so let's hide them behind the memmodel_base() function. gcc/ PR 100265 * config/riscv/riscv.c (riscv_memmodel_needs_amo_acquire): Ignore MEMMODEL_SYNC_* values. * config/riscv/riscv.c (riscv_memmod

[PATCH v2 02/10] RISC-V: Emit proper memory ordering suffixes for AMOs [PR 100265]

2021-05-05 Thread Christoph Muellner via Gcc-patches
The ratified A extension supports '.aq', '.rl' and '.aqrl' as memory ordering suffixes. Let's emit them in case we get a '%A' conversion specifier for riscv_print_operand(). As '%A' was already used for a similar, but restricted, purpose (only '.aq' was emitted so far), this does not require any o

[PATCH v2 03/10] RISC-V: Eliminate %F specifier from riscv_print_operand() [PR 100265]

2021-05-05 Thread Christoph Muellner via Gcc-patches
A previous patch took care, that the proper memory ordering suffixes for AMOs are emitted. Therefore there is no reason to keep the fence generation mechanism for release operations. gcc/ PR 100265 * config/riscv/riscv.c (riscv_memmodel_needs_release_fence): Remove fu

[PATCH v2 04/10] RISC-V: Use STORE instead of AMOSWAP for atomic stores [PR 100265]

2021-05-05 Thread Christoph Muellner via Gcc-patches
Using AMOSWAP as atomic store does not allow us to do sub-word accesses. Further, it is not consistent with our atomic_load () implementation. The benefit of AMOSWAP is that the resulting code sequence will be smaller (comapred to FENCE+STORE), however, this does not weight out for the lack of sub-

[PATCH v2 05/10] RISC-V: Emit fences according to chosen memory model [PR 100265]

2021-05-05 Thread Christoph Muellner via Gcc-patches
mem_thread_fence gets the desired memory model as operand. Let's emit fences according to this value (as defined in section "Code Porting and Mapping Guidelines" of the unpriv spec). gcc/ PR 100265 * config/riscv/sync.md (mem_thread_fence): Emit fences according t

[PATCH v2 06/10] RISC-V: Implement atomic_{load,store} [PR 100265]

2021-05-05 Thread Christoph Muellner via Gcc-patches
A recent commit introduced a mechanism to emit proper fences for RISC-V. Additionally, we already have emit_move_insn (). Let's reuse this code and provide atomic_load and atomic_store for RISC-V (as defined in section "Code Porting and Mapping Guidelines" of the unpriv spec). Note, that this works

[PATCH v2 07/10] RISC-V: Model INSNs for LR and SC [PR 100266]

2021-05-05 Thread Christoph Muellner via Gcc-patches
In order to emit LR/SC sequences, let's provide INSNs, which take care of memory ordering constraints. gcc/ PR 100266 * config/rsicv/sync.md (UNSPEC_LOAD_RESERVED): New. * config/rsicv/sync.md (UNSPEC_STORE_CONDITIONAL): New. * config/riscv/sync.md (riscv_load_r

[PATCH v2 08/10] RISC-V: Add s.ext-consuming INSNs for LR and SC [PR 100266]

2021-05-05 Thread Christoph Muellner via Gcc-patches
The current model of the LR and SC INSNs requires a sign-extension to use the generated SImode value for conditional branches, which only operate on XLEN registers. However, the sign-extension is actually not required in both cases, therefore this patch introduces additional INSNs that consume the

[PATCH v2 09/10] RISC-V: Provide programmatic implementation of CAS [PR 100266]

2021-05-05 Thread Christoph Muellner via Gcc-patches
The existing CAS implementation uses an INSN definition, which provides the core LR/SC sequence. Additionally to that, there is a follow-up code, that evaluates the results and calculates the return values. This has two drawbacks: a) an extension to sub-word CAS implementations is not possible (eve

[PATCH v2 10/10] RISC-V: Introduce predicate "riscv_sync_memory_operand" [PR 100266]

2021-05-05 Thread Christoph Muellner via Gcc-patches
Atomic instructions require zero-offset memory addresses. If we allow all addresses, the nonzero-offset addresses will be prepared in an extra register in an extra instruction before the actual atomic instruction. This patch introduces the predicate "riscv_sync_memory_operand", which restricts the

Re: [committed] libstdc++: Use unsigned char argument to std::isdigit

2021-05-05 Thread François Dumont via Gcc-patches
On 05/05/21 2:01 pm, Jonathan Wakely via Libstdc++ wrote: Passing plain char to isdigit is undefined if the value is negative. libstdc++-v3/ChangeLog: * include/std/charconv (__from_chars_alnum): Pass unsigned char to std::isdigit. Tested powerpc64le-linux. Committed to trunk.

[PATCH 1/2] libstdc++: Implement LWG 3391 changes to move/counted_iterator::base

2021-05-05 Thread Patrick Palka via Gcc-patches
Tested on x86_64-pc-linux-gnu, does this look OK for trunk/10/11? libstdc++-v3/ChangeLog: * include/bits/stl_iterator.h (move_iterator::base): Make the const& overload return a const reference and remove its constraint as per LWG 3391. Make unconditionally noexcept.

[PATCH 2/2] libstdc++: Implement LWG 3533 changes to foo_view::iterator::base()

2021-05-05 Thread Patrick Palka via Gcc-patches
Tested on x86_64-pc-linux-gnu, does this look OK for trunk/10/11? libstdc++-v3/ChangeLog: * include/std/ranges (filter_view::_Iterator::base): Make the const& overload return a const reference and remove its constraint as per LWG 3533. Make unconditionally noexcept.

Fix PR target/100402

2021-05-05 Thread Eric Botcazou
/i386.c (ix86_compute_frame_layout): For a SEH target, always return the establisher frame for __builtin_frame_address (0). 2021-05-05 Eric Botcazou * gcc.c-torture/execute/20210505-1.c: New test. -- Eric Botcazoudiff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index

Re: [committed] libstdc++: Use unsigned char argument to std::isdigit

2021-05-05 Thread Jonathan Wakely via Gcc-patches
On 05/05/21 21:57 +0200, François Dumont via Libstdc++ wrote: On 05/05/21 2:01 pm, Jonathan Wakely via Libstdc++ wrote: Passing plain char to isdigit is undefined if the value is negative. libstdc++-v3/ChangeLog: * include/std/charconv (__from_chars_alnum): Pass unsigned char t

[PATCH 1/3] libiberty: add htab_eq_string

2021-05-05 Thread Tom Tromey
The libiberty hash table includes a helper function for strings, but no equality function. Consequently, this equality function has been reimplemented a number of times in both the gcc and binutils-gdb source trees. This patch adds the function to the libiberty hash table, as a step toward the go

[PATCH 0/3] Add htab_eq_string to libiberty

2021-05-05 Thread Tom Tromey
The libiberty hash table defines a hash function for strings, but not an equality function. This means that various files have had to implement their own comparison function over the years. This series resolves this for gcc. Once this is in, I plan to import the change into binutils-gdb and appl

[PATCH 2/3] gcc: use htab_eq_string

2021-05-05 Thread Tom Tromey
This changes one spot in GCC to use the new htab_eq_string function. gcc * gengtype-state.c (read_state): Use htab_eq_string. (string_eq): Remove. --- gcc/gengtype-state.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/gcc/gengtype-state.c b/gcc/g

[PATCH 3/3] go: use htab_eq_string in godump

2021-05-05 Thread Tom Tromey
This changes godump to use the new htab_eq_string function. gcc * godump.c (string_hash_eq): Remove. (go_finish): Use htab_eq_string. --- gcc/godump.c | 14 +++--- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/gcc/godump.c b/gcc/godump.c index 7864d9d63e5

RE: [RFC v2] bpf.2: Use standard types and attributes

2021-05-05 Thread Joseph Myers
On Wed, 5 May 2021, David Laight via Libc-alpha wrote: > > __u64 can't be formatted with %llu on all architectures. That's not > > true for uint64_t, where you have to use %lu on some architectures to > > avoid compiler warnings (and technically undefined behavior). There are > > preprocessor ma

Re: testsuite: gcc.c-torture/execute/ieee/cdivchkld.c needs fmaxl

2021-05-05 Thread Joseph Myers
On Tue, 4 May 2021, Christophe Lyon via Gcc-patches wrote: > The new test gcc.c-torture/execute/ieee/cdivchkld.c needs fmaxl(), > which may not be available, for instance on aarch64-elf with newlib. > As discussed in the PR, requiring c99_runtime enables to skip the test > in this case. > > 2021-

[PATCH 0/2] Fix write_symbols for supporting multiple debug formats

2021-05-05 Thread Indu Bhagat via Gcc-patches
Hello, Over the last year, we have discussed and agreed that in order to support multiple debug formats, we keep DWARF as the default internal debug format; Any new debug format to be supported feeds off DWARF dies. This requirement specification has worked well for addition for CTF/BTF overall.

[PATCH 1/2] opts: change write_symbols to support bitmasks

2021-05-05 Thread Indu Bhagat via Gcc-patches
To support multiple debug formats, we need to move away from explicit enumeration of each individual combination of debug formats. gcc/c-family/ChangeLog: * c-opts.c (c_common_post_options): Adjust access to debug_type_names. * c-pch.c (struct c_pch_validity): Use type uint32_t.

[PATCH 2/2] dwarf: new dwarf_debuginfo_p predicate

2021-05-05 Thread Indu Bhagat via Gcc-patches
This patch introduces a dwarf_debuginfo_p predicate that abstracts and replaces complex checks on write_symbols. gcc/c-family/ChangeLog: * c-lex.c (init_c_lex): Use dwarf_debuginfo_p. gcc/ChangeLog: * config/c6x/c6x.c (c6x_output_file_unwind): Use dwarf_debuginfo_p. * dw

[PR66791][ARM] Replace __builtin_neon_vtst*

2021-05-05 Thread Prathamesh Kulkarni via Gcc-patches
Hi, The attached patch replaces __builtin_neon_vtst* (a, b) with (a & b) != 0. Bootstrapped and tested on arm-linux-gnueabihf and cross-tested on arm*-*-*. OK to commit ? Thanks, Prathamesh vtst-1.diff Description: Binary data

Re: [PATCH v2 09/10] RISC-V: Provide programmatic implementation of CAS [PR 100266]

2021-05-05 Thread Jim Wilson
On Wed, May 5, 2021 at 12:37 PM Christoph Muellner wrote: > The existing CAS implementation uses an INSN definition, which provides > the core LR/SC sequence. Additionally to that, there is a follow-up code, > that evaluates the results and calculates the return values. > This has two drawbacks:

Re: [PATCH] split loop for NE condition.

2021-05-05 Thread guojiufu via Gcc-patches
On 2021-05-01 00:27, Jeff Law wrote: On 4/29/2021 3:50 AM, Jiufu Guo via Gcc-patches wrote: When there is the possibility that overflow may happen on the loop index, a few optimizations would not happen. For example code: foo (int *a, int *b, unsigned k, unsigned n) { while (++k != n)

Re: [PATCH] RISC-V: Generate helpers for cbranch4

2021-05-05 Thread Jim Wilson
On Wed, May 5, 2021 at 12:23 PM Christoph Muellner wrote: > gcc/ > PR 100266 > * config/rsicv/riscv.c (riscv_block_move_loop): Simplify. > * config/rsicv/riscv.md (cbranch4): Generate helpers. > OK. Committed. Though I had to fix the ChangeLog entry. It was indente

Re: [PATCH] split loop for NE condition.

2021-05-05 Thread guojiufu via Gcc-patches
On 2021-05-01 05:37, Segher Boessenkool wrote: Hi! On Thu, Apr 29, 2021 at 05:50:48PM +0800, Jiufu Guo wrote: When there is the possibility that overflow may happen on the loop index, a few optimizations would not happen. For example code: foo (int *a, int *b, unsigned k, unsigned n) { whil

Ping: [PATCH] rs6000: Expand fmod and remainder when built with fast-math [PR97142]

2021-05-05 Thread Xionghu Luo via Gcc-patches
Gentle ping, thanks. On 2021/4/16 15:10, Xiong Hu Luo wrote: fmod/fmodf and remainder/remainderf could be expanded instead of library call when fast-math build, which is much faster. fmodf: fdivs f0,f1,f2 frizf0,f0 fnmsubs f1,f2,f0,f1 remainderf: fdivs f0,f1,f2

Re: [PATCH 1/2] REE: PR rtl-optimization/100264: Handle more PARALLEL SET expressions

2021-05-05 Thread Jim Wilson
On Fri, Apr 30, 2021 at 4:10 PM Christoph Müllner via Gcc-patches < gcc-patches@gcc.gnu.org> wrote: > On Sat, May 1, 2021 at 12:48 AM Jeff Law wrote: > > On 4/26/2021 5:38 AM, Christoph Muellner via Gcc-patches wrote: > > > [ree] PR rtl-optimization/100264: Handle more PARALLEL SET expressions >

[Patch, fortran] PRs 46691 and 99819: Assumed and explicit size class arrays

2021-05-05 Thread Paul Richard Thomas via Gcc-patches
Hi All, Although I had undertaken to concentrate on PDTs, PR99819 so intrigued me that I became locked into it :-( After extensive, fruitless rummaging through decl.c and trans-decl.c, I realised that the problem was far simpler than it seemed and that it lay in class.c. After that PR was fixed, P

<    1   2