[PATCH] Fix PR 19089: Environment variable TMP may yield gcc: abort

2021-11-27 Thread apinski--- via Gcc-patches
From: Andrew Pinski Even though I cannot reproduce the ICE any more, this is still a bug. We check already to see if we can access the directory but never check to see if the path is actually a directory. This adds the check and now we reject the file as not usable as a tmp directory. OK?

[PATCH] Fix PR 62157: disclean in libsanitizer not working

2021-11-27 Thread apinski--- via Gcc-patches
From: Andrew Pinski So what is happening is DIST_SUBDIRS contains the conditional directories which is wrong, so we need to force DIST_SUBDIRS to be the same as SUBDIRS as recommened by the automake manual. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. Also now make

Re: [PATCH 01/12] LoongArch Port: gcc build

2021-11-27 Thread Xi Ruoyao via Gcc-patches
On Sat, 2021-11-27 at 16:27 +0800, chenglulu wrote: > +++ b/gcc/config/loongarch/loongarch-opts.h /* snip */ > +#ifdef IN_LIBGCC2 > +#include "loongarch-def.h" > +#else > +extern "C" { > +#include "loongarch-def.h" > +} > + > +/* Handler for "-m" option combinations, > +   shared by the driver

Re: LoongArch Port

2021-11-27 Thread Xi Ruoyao via Gcc-patches
On Sat, 2021-11-27 at 16:27 +0800, chenglulu wrote: > The ELF ABI Documents are on: > https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html A note: there is a recent change to ELF interpreter path in this doc. This patch series use the new ELF interpreter path. If you

Re: [PATCH 01/12] LoongArch Port: gcc build

2021-11-27 Thread Xi Ruoyao via Gcc-patches
On Sun, 2021-11-28 at 07:39 +0800, Xi Ruoyao via Gcc-patches wrote: > > > In function ‘int isa_fpu_compat_p(const loongarch_isa*, const > > loongarch_isa*)’, > > inlined from ‘void loongarch_config_target(loongarch_target*, long int, > > int, int, int, int, int, int, int)’ at > >

Re: [PATCH 01/12] LoongArch Port: gcc build

2021-11-27 Thread Xi Ruoyao via Gcc-patches
On Sat, 2021-11-27 at 16:27 +0800, chenglulu wrote: > +void > +loongarch_config_target (struct loongarch_target *target, > +    HOST_WIDE_INT opt_switches, > +    int opt_arch, int opt_tune, int opt_fpu, > +    int opt_abi_base, int

Re: [PATCH 2/3] c++: P1997 array-copy extensions: Initialization [PR103238]

2021-11-27 Thread Jason Merrill via Gcc-patches
On 11/21/21 21:51, Will Wray via Gcc-patches wrote: This patch implements initializations of arrays from array values. The first of two 'array-copy' patches, it adds the option -farray-copy (flag_array_copy) to enable all features of P1997 (copy related or not), documented as experimental

Re: [PATCH v3] c-format: Add -Wformat-int-precision option [PR80060]

2021-11-27 Thread Daniil Stas via Gcc-patches
On Tue, 23 Nov 2021 22:48:24 + Joseph Myers wrote: > On Tue, 23 Nov 2021, Daniil Stas via Gcc-patches wrote: > > > On Mon, 22 Nov 2021 20:35:03 + > > Joseph Myers wrote: > > > > > On Sun, 21 Nov 2021, Daniil Stas via Gcc-patches wrote: > > > > [...] > > > > > > I'd expect

[PATCH v4] c-format: Add -Wformat-int-precision option [PR80060]

2021-11-27 Thread Daniil Stas via Gcc-patches
This option is enabled by default when -Wformat option is enabled. A user can specify -Wno-format-int-precision to disable emitting warnings when passing an argument of an incompatible integer type to a 'd', 'i', 'b', 'B', 'o', 'u', 'x', or 'X' conversion specifier when it has the same precision

[committed] hppa: Fix typo in t-dimode

2021-11-27 Thread John David Anglin
This patch fixes a typo in t-dimode. This caused __lshrdi3 to be dropped from libgcc. Tested by build on hppa64-linux-gnu. Committed to trunk and gcc-11. Dave --- Fix typo in t-dimode 2021-11-27 John David Anglin libgcc/ChangeLog: * config/pa/t-dimode (lib2difuncs): Fix typo.

[PATCH, fortran] Improve expansion of constant array expressions within constructors

2021-11-27 Thread Harald Anlauf via Gcc-patches
Dear all, while analyzing several issues involving constructors and constant array expressions, such as in PR102717 and PR102787, a common problem showed up: we did not always properly expand parameter arrays, array sections, or sections with vector subscripts. Besides several ICEs as in these

Re: [PATCH] libstdc++, v2: Implement std::byteswap for C++23

2021-11-27 Thread Jonathan Wakely via Gcc-patches
On Sat, 27 Nov 2021, 12:20 Jakub Jelinek via Libstdc++, < libstd...@gcc.gnu.org> wrote: > On Sat, Nov 27, 2021 at 12:59:56PM +0100, Jakub Jelinek via Gcc-patches > wrote: > > This patch attempts to implement P1272R4 (except for the std::bit_cast > > changes in there which seem quite unrelated to

[commited] jit: Change printf specifiers for size_t to %zu

2021-11-27 Thread Petter Tomner via Gcc-patches
Hi! I've pushed a fix for %ld as printf specifiers for size_t which made 32bit builds sad, as per Gerald Pfeifers mail to the list: https://gcc.gnu.org/pipermail/jit/2021q4/001395.html %ld changed to %zu in four places in libgccjit.c. Please note that I considered this patch a "free for all"

Improve -fprofile-report

2021-11-27 Thread Jan Hubicka via Gcc-patches
Hi, Profile-report was never properly updated after switch to new profile representation. This patch fixes the way profile mismatches are calculated: we used to collect separately count and freq mismatches, while now we have only counts & probabilities. So we verify - in count: that total

Re: [PATCH] ipa: Careful processing ANCESTOR jump functions and NULL pointers (PR 103083)

2021-11-27 Thread Jan Hubicka via Gcc-patches
> Hi, > > IPA_JF_ANCESTOR jump functions are constructed also when the formal > parameter of the caller is first checked whether it is NULL and left > as it is if it is NULL, to accommodate C++ casts to an ancestor class. > > The jump function type was invented for devirtualization and IPA-CP >

[PATCH] libstdc++, v2: Implement std::byteswap for C++23

2021-11-27 Thread Jakub Jelinek via Gcc-patches
On Sat, Nov 27, 2021 at 12:59:56PM +0100, Jakub Jelinek via Gcc-patches wrote: > This patch attempts to implement P1272R4 (except for the std::bit_cast > changes in there which seem quite unrelated to this and will need to be > fixed on the compiler side). > While at least for GCC

[PATCH] libstdc++: Implement std::byteswap for C++23

2021-11-27 Thread Jakub Jelinek via Gcc-patches
Hi! This patch attempts to implement P1272R4 (except for the std::bit_cast changes in there which seem quite unrelated to this and will need to be fixed on the compiler side). While at least for GCC __builtin_bswap{16,32,64,128} should work fine in constant expressions, I wonder about other

Re: [PATCH] x86: Fix up x86_{,64_}sh{l,r}d patterns [PR103431]

2021-11-27 Thread Uros Bizjak via Gcc-patches
On Sat, Nov 27, 2021 at 10:04 AM Jakub Jelinek wrote: > > Hi! > > The following testcase is miscompiled because the x86_{,64_}sh{l,r}d > patterns don't properly describe what the instructions do. One thing > is left out, in particular that there is initial count &= 63 for > sh{l,r}dq and initial

Re: LoongArch Port

2021-11-27 Thread Xi Ruoyao via Gcc-patches
On Sat, 2021-11-27 at 16:27 +0800, chenglulu wrote: > The LoongArch architecture (LoongArch) is an Instruction Set > Architecture (ISA) that has a Reduced Instruction Set Computer (RISC) > style. > The documents are on > https://loongson.github.io/LoongArch-Documentation/README-EN.html > > The

Re: [PATCH] bswap: Fix UB in find_bswap_or_nop_finalize [PR103435]

2021-11-27 Thread Richard Biener via Gcc-patches
On November 27, 2021 9:47:55 AM GMT+01:00, Jakub Jelinek wrote: >Hi! > >On gcc.c-torture/execute/pr103376.c in the following code we trigger UB >in the compiler. n->range is 8 because it is 64-bit load and rsize is 0 >because it is a bswap sequence with load and known to be 0: > /* Find real

[PATCH] x86: Fix up x86_{,64_}sh{l,r}d patterns [PR103431]

2021-11-27 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase is miscompiled because the x86_{,64_}sh{l,r}d patterns don't properly describe what the instructions do. One thing is left out, in particular that there is initial count &= 63 for sh{l,r}dq and initial count &= 31 for sh{l,r}d{l,w}. And another thing not described

[PATCH] c++: Small incremental tweak to source_location::current() folding

2021-11-27 Thread Jakub Jelinek via Gcc-patches
On Wed, Nov 24, 2021 at 11:42:28PM +0100, Jakub Jelinek via Gcc-patches wrote: > > I'm surprised the source_location::current handling would be needed; why do > > calls to that function live long enough for us to walk into the ADDR_EXPR > > here? Maybe we should fold it in cp_fold instead of

[PATCH] bswap: Fix UB in find_bswap_or_nop_finalize [PR103435]

2021-11-27 Thread Jakub Jelinek via Gcc-patches
Hi! On gcc.c-torture/execute/pr103376.c in the following code we trigger UB in the compiler. n->range is 8 because it is 64-bit load and rsize is 0 because it is a bswap sequence with load and known to be 0: /* Find real size of result (highest non-zero byte). */ if (n->base_addr) for

[PATCH] path solver: Minimize exported ranges to subsequent blocks.

2021-11-27 Thread Aldy Hernandez via Gcc-patches
Currently we have a set of interesting names in the path that we solve for. However, solving *all* of them on exit from each block is unnecessary, even if an edge range is available. We can reduce the queried edges by only solving SSA names from the current block that will be needed in

[PATCH 11/12] LoongArch Port: Regenerate configure

2021-11-27 Thread chenglulu
* config/picflag.m4: Default add build option '-fpic' for LoongArch. * configure: Add LoongArch tuples. * configure.ac: Like wise. --- config/picflag.m4 | 3 +++ configure | 10 +- configure.ac | 10 +- 3 files changed, 21 insertions(+), 2

[PATCH 01/12] LoongArch Port: gcc build

2021-11-27 Thread chenglulu
gcc/ * common/config/loongarch/loongarch-common.c: New file. * config/loongarch/genopts/genstr.sh: New file. * config/loongarch/genopts/loongarch-strings: New file. * config/loongarch/genopts/loongarch.opt.in: New file. * config/loongarch/gnu-user.h: New

[PATCH 07/12] LoongArch Port: libgcc

2021-11-27 Thread chenglulu
libgcc/ * config/loongarch/crtfastmath.c: New file. * config/loongarch/crti.S: Like wise. * config/loongarch/crtn.S: Like wise. * config/loongarch/lib2funcs.c: Like wise. * config/loongarch/linux-unwind.h: Like wise. *

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

2021-11-27 Thread chenglulu
* 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 options section. --- contrib/config-list.mk | 5 +- gcc/doc/install.texi

[PATCH 05/12] LoongArch Port: Builtin functions.

2021-11-27 Thread chenglulu
gcc/ * config/loongarch/larchintrin.h: New file. * config/loongarch/loongarch-builtins.c: New file. --- gcc/config/loongarch/larchintrin.h| 413 + gcc/config/loongarch/loongarch-builtins.c | 511 ++ 2 files changed, 924 insertions(+)

[PATCH 10/12] LoongArch Port: gcc/testsuite

2021-11-27 Thread chenglulu
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.dg/20020312-2.c: Add LoongArch support. * gcc.dg/loop-8.c:

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

2021-11-27 Thread chenglulu
--- libgcc/configure | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libgcc/configure b/libgcc/configure index 4919a56f518..ce04c4f529f 100755 --- a/libgcc/configure +++ b/libgcc/configure @@ -2412,6 +2412,9 @@ case "${host}" in # sets the default TLS model and

[PATCH 06/12] LoongArch Port: Builtin macros.

2021-11-27 Thread chenglulu
gcc/ *config/loongarch/loongarch-c.c --- gcc/config/loongarch/loongarch-c.c | 136 + 1 file changed, 136 insertions(+) create mode 100644 gcc/config/loongarch/loongarch-c.c diff --git a/gcc/config/loongarch/loongarch-c.c b/gcc/config/loongarch/loongarch-c.c

[PATCH 09/12] LoongArch Port: libgomp

2021-11-27 Thread chenglulu
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 --- a/libgomp/configure.tgt +++ b/libgomp/configure.tgt @@ -56,6 +56,10

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

2021-11-27 Thread chenglulu
--- gcc/configure | 66 ++- 1 file changed, 60 insertions(+), 6 deletions(-) diff --git a/gcc/configure b/gcc/configure index 74b9d9be4c8..6e53dec9663 100755 --- a/gcc/configure +++ b/gcc/configure @@ -5317,6 +5317,9 @@ case "${target}" in

LoongArch Port

2021-11-27 Thread chenglulu
The LoongArch architecture (LoongArch) is an Instruction Set Architecture (ISA) that has a Reduced Instruction Set Computer (RISC) style. The documents are on https://loongson.github.io/LoongArch-Documentation/README-EN.html The ELF ABI Documents are on: