[PATCH] [i386] Prevent vectorization for load from parm_decl at O2 to avoid STF issue.

2022-03-03 Thread liuhongt via Gcc-patches
For parameter passing through stack, vectorized load from parm_decl in callee may trigger serious STF issue. This is why GCC12 regresses 50% for cray at -O2 compared to GCC11. The patch add an extremely large number to stmt_cost to prevent vectorization for loads from parm_decl under very-cheap co

[PATCH v8 12/12] LoongArch Port: Add doc.

2022-03-03 Thread xuchenghua
From: chenglulu 2022-03-04 Chenghua Xu Lulu Cheng * contrib/config-list.mk: Add LoongArch triplet. * gcc/doc/install.texi: Add LoongArch options section. * gcc/doc/invoke.texi: Add LoongArch options section. * gcc/doc/md.texi: Add LoongArch option

[PATCH v8 11/12] LoongArch Port: gcc/testsuite

2022-03-03 Thread xuchenghua
From: chenglulu 2022-03-04 Chenghua Xu Lulu Cheng gcc/testsuite/ * g++.dg/cpp0x/constexpr-rom.C: Add build options for LoongArch. * g++.old-deja/g++.abi/ptrmem.C: Add LoongArch support. * g++.old-deja/g++.pt/ptrmem6.C: xfail for LoongArch. * gcc.

[PATCH v8 08/12] LoongArch Port: libgcc

2022-03-03 Thread xuchenghua
From: chenglulu 2022-03-04 Chenghua Xu Lulu Cheng libgcc/ * config/loongarch/crtfastmath.c: New file. * config/loongarch/crti.S: Like wise. * config/loongarch/crtn.S: Like wise. * config/loongarch/linux-unwind.h: Like wise. * config/loong

[PATCH v8 10/12] LoongArch Port: libgomp

2022-03-03 Thread xuchenghua
From: chenglulu 2022-03-04 Chenghua Xu Lulu Cheng libgomp/ * configure.tgt: Add LoongArch triplet. --- libgomp/configure.tgt | 4 1 file changed, 4 insertions(+) diff --git a/libgomp/configure.tgt b/libgomp/configure.tgt index d4f1e741b5a..2cd7272fcd8 100644 ---

[PATCH v8 09/12] LoongArch Port: Regenerate libgcc/configure.

2022-03-03 Thread xuchenghua
From: chenglulu 2022-03-04 Chenghua Xu Lulu Cheng * libgcc/configure: Regenerated. --- libgcc/configure | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libgcc/configure b/libgcc/configure index 52bf25d4e94..1f9b2ac578b 100755 --- a/libgcc/configure +

[PATCH v8 06/12] LoongArch Port: Builtin functions.

2022-03-03 Thread xuchenghua
From: chenglulu 2022-03-04 Chenghua Xu Lulu Cheng gcc/ * config/loongarch/larchintrin.h: New file. * config/loongarch/loongarch-builtins.cc: New file. --- gcc/config/loongarch/larchintrin.h | 413 + gcc/config/loongarch/loongarch-builtin

[PATCH v8 02/12] LoongArch Port: gcc build

2022-03-03 Thread xuchenghua
From: chenglulu 2022-03-04 Chenghua Xu Lulu Cheng gcc/ * common/config/loongarch/loongarch-common.cc: New file. * config/loongarch/genopts/genstr.sh: New file. * config/loongarch/genopts/loongarch-strings: New file. * config/loongarch/genopts/loo

[PATCH v8 07/12] LoongArch Port: Builtin macros.

2022-03-03 Thread xuchenghua
From: chenglulu 2022-03-04 Chenghua Xu Lulu Cheng gcc/ *config/loongarch/loongarch-c.cc --- gcc/config/loongarch/loongarch-c.cc | 109 1 file changed, 109 insertions(+) create mode 100644 gcc/config/loongarch/loongarch-c.cc diff --git a/g

[PATCH v8 03/12] LoongArch Port: Regenerate gcc/configure.

2022-03-03 Thread xuchenghua
From: chenglulu 2022-03-04 Chenghua Xu Lulu Cheng gcc/ * configure: Regenerate. --- gcc/configure | 66 ++- 1 file changed, 60 insertions(+), 6 deletions(-) diff --git a/gcc/configure b/gcc/configure index 14b19c8fe0c..1c

[PATCH v8 01/12] LoongArch Port: Regenerate configure

2022-03-03 Thread xuchenghua
From: chenglulu 2022-03-04 Chenghua Xu Lulu Cheng * config/picflag.m4: Default add build option '-fpic' for LoongArch. * configure: Add LoongArch tuples. * configure.ac: Like wise. --- config/picflag.m4 | 3 +++ configure | 10 +- config

[PATCH v8 00/12] Add LoongArch support.

2022-03-03 Thread xuchenghua
From: chenglulu Hi, all: This is the v8 version of LoongArch Port. Please review. We know it is stage4, I think it is ok for a new prot. The kernel side upstream waiting for a approval by gcc side, if it is blocked by stage4, a approval for GCC13 will be appreciation. The LoongArch architectur

[r12-7468 Regression] FAIL: g++.dg/warn/Wstringop-overflow-6.C -std=gnu++20 (test for excess errors) on Linux/x86_64

2022-03-03 Thread sunil.k.pandey via Gcc-patches
On Linux/x86_64, 9805965e3551b66b5bd751d6076791d00cdeb137 is the first bad commit commit 9805965e3551b66b5bd751d6076791d00cdeb137 Author: Jonathan Wakely Date: Thu Mar 3 12:34:27 2022 + libstdc++: Implement std::strong_order for floating-point types [PR96526] caused FAIL: g++.dg/warn

[PATCH 3/3] RISC-V:Cache Management Operation instructions testcases

2022-03-03 Thread yulong
From: yulong-plct This commit adds testcases about CMO instructions. 7 8 gcc/testsuite/ChangeLog: 9 10 * gcc.target/riscv/cmo-zicbom-1.c: New test. 11 * gcc.target/riscv/cmo-zicbom-2.c: New test. 12 * gcc.target/riscv/cmo-zicbop-1.c: New test. 13 * gcc.ta

[PATCH 2/3] RISC-V:Cache Management Operation instructions

2022-03-03 Thread yulong
From: yulong-plct This commit adds cbo.clea,cbo.flush,cbo.inval,cbo.zero,prefetch.i,prefetch.r and prefetch.w instructions. 7 8 gcc/ChangeLog: 9 10 * config/riscv/predicates.md (imm5_operand): Add a new operand type for prefetch instructions. 11 * config/riscv/riscv-buil

[PATCH 1/3] RISC-V: Add mininal support for Zicbo[mzp]

2022-03-03 Thread yulong
From: yulong-plct This commit adds minimal support for 'Zicbom','Zicboz' and 'Zicbop' extensions. 7 8 gcc/ChangeLog: 9 10 * common/config/riscv/riscv-common.cc: Add zicbom, zicboz, zicbop extensions. 11 * config/riscv/riscv-opts.h (MASK_ZICBOZ): New. 12 (MASK_ZIC

[PATCH 0/3] RISC-V: Add Ratified Cache Management Operation ISA Extensions

2022-03-03 Thread yulong
From: yulong-plct This patchset adds support for three recently ratified RISC-V extensions: - Zicbom (Cache-Block Management Instructions) - Zicbop (Cache-Block Prefetch hint instructions) - Zicboz (Cache-Block Zero Instructions) Patch 1: Add Zicbom/z/p mininal support Pat

Re: [PATCH] [i386] Optimize v4si broadcast for noavx512vl.

2022-03-03 Thread Hongtao Liu via Gcc-patches
On Fri, Mar 4, 2022 at 10:29 AM liuhongt via Gcc-patches wrote: > > This is incremental patch based on [1], it enables optimization as below > > - vbroadcastss.LC1(%rip), %xmm0 > + movl$-45, %edx > + vmovd %edx, %xmm0 > + vpshufd $0, %xmm0, %xmm0 > > According to

[PATCH] [i386] Optimize v4si broadcast for noavx512vl.

2022-03-03 Thread liuhongt via Gcc-patches
This is incremental patch based on [1], it enables optimization as below - vbroadcastss.LC1(%rip), %xmm0 + movl$-45, %edx + vmovd %edx, %xmm0 + vpshufd $0, %xmm0, %xmm0 According to microbenchmark, it's faster than broadcast from memory. [1] https://gcc.gnu.org/

Re: [PATCH] x86: Always return pseudo register in ix86_gen_scratch_sse_rtx

2022-03-03 Thread Hongtao Liu via Gcc-patches
On Thu, Mar 3, 2022 at 10:22 PM H.J. Lu via Gcc-patches wrote: > > ix86_gen_scratch_sse_rtx returns XMM7/XMM15/XMM31 as a scratch vector > register to prevent RTL optimizers from removing vector register. It > introduces a conflict with explicit XMM7/XMM15/XMM31 usage and when it > is called by R

Re: [PATCH] call mark_dfs_back_edges() before testing EDGE_DFS_BACK [PR104761]

2022-03-03 Thread Martin Sebor via Gcc-patches
On 3/3/22 01:01, Jakub Jelinek wrote: On Wed, Mar 02, 2022 at 04:15:09PM -0700, Martin Sebor via Gcc-patches wrote: The -Wdangling-pointer code tests the EDGE_DFS_BACK but the pass never calls the mark_dfs_back_edges() function that initializes the bit (I didn't know about it). As a result the

Re: [PATCH] libgcc: allow building float128 libraries on FreeBSD

2022-03-03 Thread Segher Boessenkool
Hi! On Mon, Feb 21, 2022 at 12:37:56AM +0100, pku...@freebsd.org wrote: > From: Piotr Kubaj > > While FreeBSD currently uses 64-bit long double, there should be no > problem with adding support for float128. > > Signed-off-by: Piotr Kubaj This needs a changelog. The entry for configure shoul

New German PO file for 'gcc' (version 12.1-b20220213)

2022-03-03 Thread Translation Project Robot
Hello, gentle maintainer. This is a message from the Translation Project robot. A revised PO file for textual domain 'gcc' has been submitted by the German team of translators. The file is available at: https://translationproject.org/latest/gcc/de.po (This file, 'gcc-12.1-b20220213.de.po',

[committed] libstdc++: Use non-debug vector in constexpr test [PR104748]

2022-03-03 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. -- >8 -- The std::__debug::vector isn't usable in constant expressions, so this test fails in debug mode. Until the debug vector is fixed we can just make the test use the non-debug one. libstdc++-v3/ChangeLog: PR libstdc++/104748 * testsuit

[committed] libstdc++: Fix test failure on AIX

2022-03-03 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. -- >8 -- This fixes a test failure due to a non-reserved name in an AIX system header (included via ). That name clashes with one of the names we check our own headers for, so skip checking that name on AIX. libstdc++-v3/ChangeLog: * testsuite/17_in

[committed] libstdc++: Implement std::strong_order for floating-point types [PR96526]

2022-03-03 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux (-m32/-m64), powerpc64-linux (-m32/-m64), powerpc64le-linux, powerpc-aix (maix32/-maix64/-mlong-double-128). Pushed to trunk. I'm inclined to backport this to gcc-11 after some soak time on trunk (but not gcc-10, because it needs __builtin_bit_cast). -- >8 -- This removes a F

Re: [PATCH] tree: Fix up warn_deprecated_use [PR104627]

2022-03-03 Thread Jason Merrill via Gcc-patches
On 3/1/22 14:33, Jakub Jelinek wrote: Hi! The r12-7287-g1b71bc7c8b18bd1b change improved the -Wdeprecated warning for C++, but regressed it for C, in particular in gcc.dg/deprecated.c testcase we now report a type that actually isn't deprecated as deprecated instead of the one that is deprecated

[PATCH] c++: merge default targs for function templates [PR65396]

2022-03-03 Thread Patrick Palka via Gcc-patches
We currently merge default template arguments for class templates, but not for function templates. This patch fixes this by splitting out the argument merging logic in redeclare_class_template into a separate function and using it in duplicate_decls as well. Bootstrapped and regtested on x86_64-p

Re: [PATCH] call mark_dfs_back_edges() before testing EDGE_DFS_BACK [PR104761]

2022-03-03 Thread Jeff Law via Gcc-patches
On 3/3/2022 1:01 AM, Jakub Jelinek wrote: On Wed, Mar 02, 2022 at 04:15:09PM -0700, Martin Sebor via Gcc-patches wrote: The -Wdangling-pointer code tests the EDGE_DFS_BACK but the pass never calls the mark_dfs_back_edges() function that initializes the bit (I didn't know about it). As a resu

Re: [PATCH] libgcc: allow building float128 libraries on FreeBSD

2022-03-03 Thread David Edelsohn via Gcc-patches
I don't have any objection, but the patch is FreeBSD-specific. You are sending the patch from the FreeBSD organization, but I don't know the authority structure within the organization. Andreas Tobler is the FreeBSD maintainer for GCC, but I don't know his current status. Thanks, David On Sun,

[PATCH][pushed] configure: enable plugin support for ld.mold

2022-03-03 Thread Martin Liška
Hi. There's another part of mold enablement. Going to push it. Martin gcc/ChangeLog: * configure.ac: Now ld.mold support LTO plugin API, use it. * configure: Regenerate. --- gcc/configure| 2 ++ gcc/configure.ac | 2 ++ 2 files changed, 4 insertions(+) diff --git a/gcc/co

[PATCH] x86: Always return pseudo register in ix86_gen_scratch_sse_rtx

2022-03-03 Thread H.J. Lu via Gcc-patches
ix86_gen_scratch_sse_rtx returns XMM7/XMM15/XMM31 as a scratch vector register to prevent RTL optimizers from removing vector register. It introduces a conflict with explicit XMM7/XMM15/XMM31 usage and when it is called by RTL optimizers, it may introduce conflicting usages of XMM7/XMM15/XMM31. C

Re: [PATCH] libgcc: allow building float128 libraries on FreeBSD

2022-03-03 Thread Piotr Kubaj
Bumping. Is there anything wrong with this patch? On 22-02-21 00:37:56, pku...@freebsd.org wrote: > From: Piotr Kubaj > > While FreeBSD currently uses 64-bit long double, there should be no > problem with adding support for float128. > > Signed-off-by: Piotr Kubaj > --- > libgcc/configure

[wwwdocs][patch] gcc-12/changes.html: Document -misa update for nvptx

2022-03-03 Thread Tobias Burnus
The current wording, https://gcc.gnu.org/gcc-12/changes.html#nvptx , is outdated and (now wrongly) encourages to use -mptx=. Updated as follows. OK? Tobias - Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haf

Re: [PATCH] Check if loading const from mem is faster

2022-03-03 Thread Jiufu Guo via Gcc-patches
Hi Sehger, Segher Boessenkool writes: > On Tue, Mar 01, 2022 at 10:28:57PM +0800, Jiufu Guo wrote: >> Segher Boessenkool writes: >> > No. insn_cost is only for correct, existing instructions, not for >> > made-up nonsense. I created insn_cost precisely to get away from that >> > aspect of r

Re: [PATCH] Check if loading const from mem is faster

2022-03-03 Thread Jiufu Guo via Gcc-patches
Hi, Jeff Law writes: > On 3/1/2022 12:47 AM, Richard Biener via Gcc-patches wrote: >> On Tue, 1 Mar 2022, Jiufu Guo wrote: >> >>> Segher Boessenkool writes: >>> On Thu, Feb 24, 2022 at 09:50:28AM +0100, Richard Biener wrote: > On Thu, 24 Feb 2022, Jiufu Guo wrote: >> And another

Re: [PATCH] eliminate mutex in fast path of __register_frame

2022-03-03 Thread Thomas Neumann via Gcc-patches
We may have to add a new interface. In some other cases, I've seen errno being used for error reporting, but that requires changes in applications to recognize the error. It's probably better to crash here than to fail mysteriously later. Out of curiosity, how many times do you call the registr

[committed][nvptx] Build libraries with mptx=3.1

2022-03-03 Thread Tom de Vries via Gcc-patches
Hi, In gcc-5 to gcc-11, the ptx isa version was 3.1. On trunk, the default is now 6.0, which is also what will be the value in the libraries. Consequently, there may be setups with an older driver that worked with gcc-11, but will become unsupported with gcc-12. Fix this by building the librari

[committed][nvptx] Build libraries with misa=sm_30

2022-03-03 Thread Tom de Vries via Gcc-patches
Hi, In gcc-11, when specifying -misa=sm_30, an executable may still contain sm_35 code (due to libraries being built with the default -misa=sm_35), so it won't run on an sm_30 board. Fix this by building libraries with sm_30, as was the case in gcc-5 to gcc-10. Committed to trunk. Thanks, - To

[committed][nvptx] Use --no-verify for sm_30

2022-03-03 Thread Tom de Vries via Gcc-patches
Hi, In PR97348, we ran into the problem that recent CUDA dropped support for sm_30, which inhibited the build when building with CUDA bin in the path, because the nvptx-tools assembler uses CUDA's ptxas to do ptx verification. To fix this, in gcc-11 the default sm_xx was moved from sm_30 to sm_35

[committed][nvptx] Add -mptx=_ in gcc.target/nvptx/smxx.c

2022-03-03 Thread Tom de Vries via Gcc-patches
Hi, With target board nvptx-none-run/-mptx=3.1 we run into: ... cc1: error: PTX version (-mptx) needs to be at least 4.2 to support \ selected -misa (sm_53)^M compiler exited with status 1 FAIL: gcc.target/nvptx/sm53.c (test for excess errors) ... Fix this by adding -mptx=_ in sm53.c and simila

Re: [PATCH] eliminate mutex in fast path of __register_frame

2022-03-03 Thread Florian Weimer via Gcc-patches
* Thomas Neumann: >>> +// Common logic for version locks >>> +struct version_lock >>> +{ >>> + // The lock itself >>> + uintptr_t version_lock; >>> +}; >> version_lock must not overflow, right? This means we need a wider >> counter on 32-bit, too. glibc contains a 62-bit counter that it uses >

Re: [PATCH] call mark_dfs_back_edges() before testing EDGE_DFS_BACK [PR104761]

2022-03-03 Thread Richard Biener via Gcc-patches
> Am 03.03.2022 um 09:02 schrieb Jakub Jelinek via Gcc-patches > : > > On Wed, Mar 02, 2022 at 04:15:09PM -0700, Martin Sebor via Gcc-patches wrote: >> The -Wdangling-pointer code tests the EDGE_DFS_BACK but the pass never >> calls the mark_dfs_back_edges() function that initializes the bit (

[PATCH] rs6000: Adjust mov optabs for opaque modes [PR103353]

2022-03-03 Thread Kewen.Lin via Gcc-patches
Hi, As PR103353 shows, we may want to continue to expand a MMA built-in function like a normal function, even if we have already emitted error messages about some missing required conditions. As shown in that PR, without one explicit mov optab on OOmode provided, it would call emit_move_insn recu

[committed] openmp: Disable SSA form during gimplification on OMP_SIMD clauses and body [PR104757]

2022-03-03 Thread Jakub Jelinek via Gcc-patches
Hi! When offloading to nvptx is enabled, scan_omp_simd duplicates the simd region including its clauses and body using inliner's copy_gimple_seq_and_replace_locals. That works nicely for decls, remaps only those that are seen in the nested bind expr vars (i.e. local variables) and doesn't remap o

Re: [PATCH] call mark_dfs_back_edges() before testing EDGE_DFS_BACK [PR104761]

2022-03-03 Thread Jakub Jelinek via Gcc-patches
On Wed, Mar 02, 2022 at 04:15:09PM -0700, Martin Sebor via Gcc-patches wrote: > The -Wdangling-pointer code tests the EDGE_DFS_BACK but the pass never > calls the mark_dfs_back_edges() function that initializes the bit (I > didn't know about it). As a result the bit is not set when expected, > whi