Re: [PATCH 0/4] Add aarch64-darwin support for off-stack trampolines

2021-12-02 Thread Iain Sandoe
> On 3 Dec 2021, at 03:12, Jeff Law wrote: > > > > On 11/22/2021 7:49 AM, Maxim Blinov wrote: >> Hi all, apologies for forgetting to add the cover letter. > No worries. I'd already assumed this was to support aarch64 trampolines on > darwin by having them live elsewere as managed

[PATCH] tree-optimization/103514 Missing XOR-EQ-AND Optimization

2021-12-02 Thread Navid Rahimi via Gcc-patches
Hi GCC community, This patch will add the missed pattern described in bug 103514 [1] to the match.pd. Tested on x86_64 Linux. tree-optimization/103514 Missing XOR-EQ-AND Optimization * match.pd (a & b) == (a ^ b) -> !(a | b): New optimization. * match.pd (a & b) ^ (a == b) ->

RE: [PATCH v2] tree-optimization/101186 - extend FRE with "equivalence map" for condition prediction

2021-12-02 Thread Di Zhao OS via Gcc-patches
I'm very sorry there seems to be encoding issue in the attachment in my last email. Attached is the new patch. Thanks, Di Zhao > -Original Message- > From: Di Zhao OS > Sent: Tuesday, November 16, 2021 1:24 AM > To: 'Richard Biener' > Cc: gcc-patches@gcc.gnu.org > Subject: RE: [PATCH

Re: [PATCH] stddef.h: add support for musl typedef macro guards

2021-12-02 Thread Sören Tempel via Gcc-patches
Hi, Jeff Law wrote: > So what doesn't make sense here is how both stddef.h files get > included.  That's the core problem I think you need to resolve. The libgo/sysinfo.c file includes stddef.h (for which the GCC version in ginclude is used on my system) and stdlib.h which, on musl, causes an

[PATCH] [i386] Prefer INT_SSE_REGS for SSE_FLOAT_MODE_P in preferred_reload_class.

2021-12-02 Thread liuhongt via Gcc-patches
Hi: > Please also consider TARGET_INTER_UNIT_MOVES_TO_VEC and > TARGET_INTER_UNIT_MOVES_FROM_VEC. Here's updated patch. Also honor TARGET_INTER_UNIT_MOVES_TO/FROM_VEC and in preferred_{,out_}reload_class. Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32\ -march=k8,\ -march=k8}. Ok?

[PATCH v2] regrename: Skip renaming if instruction is noop move.

2021-12-02 Thread Jojo R via Gcc-patches
Skip renaming if instruction is noop move, and it will been removed for performance. gcc/ * regrename.c (find_rename_reg): Return satisfied regno if instruction is noop move. --- gcc/regrename.c | 5 + 1 file changed, 5 insertions(+) diff --git a/gcc/regrename.c

[PATCH v2] rs6000: Fix some issues in rs6000_can_inline_p [PR102059]

2021-12-02 Thread Kewen.Lin via Gcc-patches
Hi Segher, Thanks for the review! on 2021/11/30 上午12:57, Segher Boessenkool wrote: > Hi! > > On Wed, Sep 01, 2021 at 02:55:51PM +0800, Kewen.Lin wrote: >> This patch is to fix the inconsistent behaviors for non-LTO mode >> and LTO mode. As Martin pointed out, currently the function >>

[PATCH v2] regrename: Skip renaming if instruction is noop move.

2021-12-02 Thread Jojo R via Gcc-patches
Skip renaming if instruction is noop move, and it will been removed for performance. gcc/ * regrename.c (find_rename_reg): Return satisfied regno if instruction is noop move. --- gcc/regrename.c | 5 + 1 file changed, 5 insertions(+) diff --git a/gcc/regrename.c

Re: [PATCH] rs6000: Fix some issues in rs6000_can_inline_p [PR102059]

2021-12-02 Thread Kewen.Lin via Gcc-patches
Hi Mike, on 2021/12/3 上午8:51, Michael Meissner wrote: > On Mon, Nov 29, 2021 at 10:57:12AM -0600, Segher Boessenkool wrote: >> Why are there OPTION_MASKs for separate P10 fusion types here, as well as >> MASK_P10_FUSION? > > Well going back in time, before we used rs6000_isa_flags, we used the

Re: [PATCH] Avoid expecting nonzero size for access none void* arguments [PR101751]

2021-12-02 Thread Jeff Law via Gcc-patches
On 11/24/2021 7:16 PM, Martin Sebor via Gcc-patches wrote: When the optional size-index argument to attribute index is omitted for a pointer, GCC expects the actual pointer argument to point to an object at least as big as its size implies, or at least one byte for void*.  This is done to

Re: [PATCH] correct handling of offsets in PHI expressions [PR103215]

2021-12-02 Thread Jeff Law via Gcc-patches
On 11/22/2021 4:54 PM, Martin Sebor via Gcc-patches wrote: In an effort to avoid false positives while still detecting certain out-of-bounds accesses the warning code that handles PHI nodes chooses the operand with the most space remaining as the one representative of the PHI.  That's not

Re: [PATCH 3/4] Add aarch64-linux support for off-stack trampolines

2021-12-02 Thread Jeff Law via Gcc-patches
On 11/13/2021 2:45 AM, Maxim Blinov wrote: Implement the __builtin_nested_func_ptr_{created,deleted} functions for the aarch64-linux platform. This serves to exercise the infrastructure added in libgcc (--enable-off-stack-trampolines) and gcc (-foff-stack-trampolines) in supporting off-stack

Re: [PATCH 2/4] Add x86_64-linux support for off-stack trampolines

2021-12-02 Thread Jeff Law via Gcc-patches
On 11/13/2021 2:45 AM, Maxim Blinov wrote: Implement the __builtin_nested_func_ptr_{created,deleted} functions for the x86_64-linux platform. This serves to exercise the infrastructure added in libgcc (--enable-off-stack-trampolines) and gcc (-foff-stack-trampolines) in supporting off-stack

Re: [PATCH 1/4] Generate off-stack nested function trampolines

2021-12-02 Thread Jeff Law via Gcc-patches
On 11/13/2021 2:45 AM, Maxim Blinov wrote: Add support for allocating nested function trampolines on an executable heap rather than on the stack. This is motivated by targets such as AArch64 Darwin, which globally prohibit executing code on the stack. The target-specific routines for

Re: [PATCH 0/4] Add aarch64-darwin support for off-stack trampolines

2021-12-02 Thread Jeff Law via Gcc-patches
On 11/22/2021 7:49 AM, Maxim Blinov wrote: Hi all, apologies for forgetting to add the cover letter. No worries.  I'd already assumed this was to support aarch64 trampolines on darwin by having them live elsewere as managed entities. The motivation of this work is to provide (limited)

Re: [PATCH 3/5] gcc: Add --nostdlib++ option

2021-12-02 Thread Jeff Law via Gcc-patches
On 10/28/2021 10:41 AM, Richard Purdie via Gcc-patches wrote: On Wed, 2021-10-27 at 22:56 +0200, Bernhard Reutner-Fischer wrote: On Wed, 27 Oct 2021 21:05:03 +0100 Richard Purdie via Gcc-patches wrote: OpenEmbedded/Yocto Project builds libgcc and the other gcc runtime libraries separately

Re: [PATCH 3/5] gcc: Add --nostdlib++ option

2021-12-02 Thread Jeff Law via Gcc-patches
On 10/28/2021 10:39 AM, Richard Purdie wrote: On Thu, 2021-10-28 at 08:51 -0600, Jeff Law wrote: On 10/27/2021 2:05 PM, Richard Purdie via Gcc-patches wrote: OpenEmbedded/Yocto Project builds libgcc and the other gcc runtime libraries separately from the compiler and slightly differently to

Re: [PATCH 2/5] gcc: Fix "argument list too long" from install-plugins

2021-12-02 Thread Jeff Law via Gcc-patches
On 10/27/2021 2:05 PM, Richard Purdie via Gcc-patches wrote: When building in longer build paths (200+ characters), the "echo $(PLUGIN_HEADERS)" from the install-plugins target would cause an "argument list too long error" on some systems. Avoid this by calling make's sort function on the

Re: [PATCH] build: Implement --with-multilib-list for avr target

2021-12-02 Thread Jeff Law via Gcc-patches
On 6/7/2021 1:30 AM, Matt Jacobson via Gcc-patches wrote: gcc/ChangeLog: 2020-06-07 Matt Jacobson * config.gcc: For the AVR target, populate TM_MULTILIB_CONFIG. * config/avr/genmultilib.awk: Add ability to filter generated multilib list. * config/avr/t-avr:

[PATCH] Improve AutoFDO count propagation algorithm

2021-12-02 Thread Eugene Rozenfeld via Gcc-patches
When a basic block A has been annotated with a count and it has only one successor (or predecessor) B, we can propagate the A's count to B. The algorithm without this change could leave B without an annotation if B had other unannotated predecessors (or successors). For example, in the test case I

Re: [PATCH v3] MIPS: R6: load/store can process unaligned address

2021-12-02 Thread Jeff Law via Gcc-patches
On 10/11/2021 4:42 AM, YunQiang Su wrote: MIPS release 6 requires the lw/ld/sw/sd can work with unaligned address, while it can be implemented by full hardware or trap Since it doesn't have to be fully done by hardware, we add a pair of options -m(no-)unaligned-access. Kernels may need them.

Re: PING^1 [PATCH] Add TARGET_IFUNC_REF_LOCAL_OK

2021-12-02 Thread Jeff Law via Gcc-patches
On 7/6/2021 5:47 AM, H.J. Lu via Gcc-patches wrote: On Sat, Jun 19, 2021 at 7:10 PM H.J. Lu wrote: 1. On some targets, like PowerPC, reference to ifunc function resolver must be non-local so that compiler will properly emit PLT call. Add TARGET_IFUNC_REF_LOCAL_OK to allow binding indirect

Re: [PATCH] rs6000: Fix some issues in rs6000_can_inline_p [PR102059]

2021-12-02 Thread Michael Meissner via Gcc-patches
On Mon, Nov 29, 2021 at 10:57:12AM -0600, Segher Boessenkool wrote: > Why are there OPTION_MASKs for separate P10 fusion types here, as well as > MASK_P10_FUSION? Well going back in time, before we used rs6000_isa_flags, we used the default flag word for MASK arguments. Unfortunately, the

Re: [PATCH] rs6000: testsuite: Add rop_ok effective-target function

2021-12-02 Thread Segher Boessenkool
Hi! On Thu, Nov 11, 2021 at 04:12:08PM -0600, Peter Bergner wrote: > This patch adds a new effective-target function that tests whether > it is safe to emit the ROP-protect instructions and updates the > ROP test cases to use it. > > Segher, as we discussed offline, this uses the double [] which

Re: [PATCH] libiberty rust-demangle, ignore .suffix

2021-12-02 Thread Eduard-Mihai Burtescu
On Fri, Dec 3, 2021, at 00:07, Mark Wielaard wrote: > Hi Eddy, > > On Thu, Dec 02, 2021 at 07:35:17PM +0200, Eduard-Mihai Burtescu wrote: >> On Thu, Dec 2, 2021, at 19:17, Mark Wielaard wrote: >> > Rust v0 symbols can have a .suffix because if compiler transformations. >> >> For some context, the

[PATCH v2] c++: Fix for decltype(auto) and parenthesized expr [PR103403]

2021-12-02 Thread Marek Polacek via Gcc-patches
On Wed, Dec 01, 2021 at 11:16:27PM -0500, Jason Merrill wrote: > On 12/1/21 10:16, Marek Polacek wrote: > > In r11-4758, I tried to fix this problem: > > > >int & = 0; > >decltype(auto) j = i; // should behave like int & = i; error > > > > wherein do_auto_deduction was getting confused

Re: [PATCH] libiberty rust-demangle, ignore .suffix

2021-12-02 Thread Mark Wielaard
Hi, On Fri, Dec 03, 2021 at 06:58:36AM +1100, Nicholas Nethercote wrote: > On Fri, 3 Dec 2021 at 04:17, Mark Wielaard wrote: > > > > * rust-demangle.c (rust_demangle_callback): Ignore everything > > after '.' char in sym for v0. > > > > I just applied this change to Valgrind's

[PATCH] rs6000: Fix use of wrong enum for built-in function code.

2021-12-02 Thread Bill Schmidt via Gcc-patches
Hi! I discovered this bug while working on patches to remove the old built-ins infrastructure. I missed a spot in converting from the rs6000_builtins enum to the rs6000_gen_builtins enum. This fixes it. The fix is technically not right if new_builtins_are_enabled were to be set to zero, but

Re: [PATCH] rs6000: Builtins test changes for test_fpscr_[d]rn_builtin_error.c

2021-12-02 Thread Segher Boessenkool
On Thu, Dec 02, 2021 at 10:43:24AM -0600, Bill Schmidt wrote: > The new built-in infrastructure is now enabled! Congratulations, and thanks for all the work! Segher

Re: [PATCH] target: [PR102941] Fix inline-asm flags with non-REG_P output

2021-12-02 Thread Andrew Pinski via Gcc-patches
On Tue, Oct 26, 2021 at 2:45 AM apinski--- via Gcc-patches wrote: > > From: Andrew Pinski > > So the problem here is that arm_md_asm_adjust would > just create a set directly to the output memory which is wrong. > It needs to output to a temp register first and then do a > move. > > OK?

Re: [PATCH v2] [AARCH64] Fix PR target/103100 -mstrict-align and memset on not aligned buffers

2021-12-02 Thread Andrew Pinski via Gcc-patches
On Thu, Nov 18, 2021 at 5:55 PM apinski--- via Gcc-patches wrote: > > From: Andrew Pinski > > The problem here is that aarch64_expand_setmem does not change the alignment > for strict alignment case. This is a simplified patch from what I had > previously. > So constraining copy_limit to the

Re: [PATCH] libiberty rust-demangle, ignore .suffix

2021-12-02 Thread Mark Wielaard
Hi Eddy, On Thu, Dec 02, 2021 at 07:35:17PM +0200, Eduard-Mihai Burtescu wrote: > On Thu, Dec 2, 2021, at 19:17, Mark Wielaard wrote: > > Rust v0 symbols can have a .suffix because if compiler transformations. > > For some context, the suffix comes from LLVM (I believe as part of > its LTO). If

[PATCH] PR fortran/103505 - ICE in compare_bound_mpz_t, at fortran/resolve.c:4587

2021-12-02 Thread Harald Anlauf via Gcc-patches
Dear Fortranners, specifying invalid constant array declarations (e.g. real array bounds) could lead to an ICE because the array specs were checked for consistency. A possible solution is to try an early simplification before doing that check and was suggested by Steve. However, regtesting did

Re: [PATCH 1/2] Add cumulative_args_t variants of TARGET_FUNCTION_ROUND_BOUNDARY and friends

2021-12-02 Thread Jeff Law via Gcc-patches
On 12/2/2021 2:24 PM, Iain Sandoe wrote: On 2 Dec 2021, at 21:08, Jeff Law via Gcc-patches wrote: On 11/22/2021 8:15 AM, Richard Biener via Gcc-patches wrote: On Mon, Nov 22, 2021 at 3:40 PM Maxim Blinov wrote: Hi Richard, The purpose of this patch is to give more of the target code

RE: [PATCH 2/5]AArch64 sve: combine nested if predicates

2021-12-02 Thread Tamar Christina via Gcc-patches
> This hashing looks unnecessarily complex. The values we're hashing are > vector SSA_NAMEs, so I think we should be able to hash and compare them > as a plain pair of pointers. > > The type could then be std::pair and the hashing could be done using > pair_hash from hash-traits.h. > Fancy..

Re: [committed] Make test names unique for a couple of goacc tests

2021-12-02 Thread Jeff Law via Gcc-patches
On 9/22/2021 5:03 AM, Thomas Schwinge wrote: Hi! On 2021-09-19T11:35:00-0600, Jeff Law via Gcc-patches wrote: A couple of goacc tests do not have unique names. Thanks for fixing this up, and sorry, largely my "fault", I suppose. ;-| No worries.  I suspect there's still a ton of these

Re: [PATCH 1/2] Add cumulative_args_t variants of TARGET_FUNCTION_ROUND_BOUNDARY and friends

2021-12-02 Thread Iain Sandoe
> On 2 Dec 2021, at 21:08, Jeff Law via Gcc-patches > wrote: > On 11/22/2021 8:15 AM, Richard Biener via Gcc-patches wrote: >> On Mon, Nov 22, 2021 at 3:40 PM Maxim Blinov >> wrote: >>> Hi Richard, >>> >>> The purpose of this patch is to give more of the target code access to >>> the

Re: [PATCH v2] configure: define TARGET_LIBC_GNUSTACK on musl

2021-12-02 Thread Jeff Law via Gcc-patches
On 12/2/2021 1:59 PM, Ilya Lipnitskiy wrote: On Thu, Dec 2, 2021 at 12:48 PM Jeff Law wrote: On 11/15/2021 10:13 PM, Ilya Lipnitskiy wrote: musl only uses PT_GNU_STACK to set default thread stack size and has no executable stack support[0], so there is no reason not to emit the

Re: [PATCH 1/2] Add cumulative_args_t variants of TARGET_FUNCTION_ROUND_BOUNDARY and friends

2021-12-02 Thread Jeff Law via Gcc-patches
On 11/22/2021 8:15 AM, Richard Biener via Gcc-patches wrote: On Mon, Nov 22, 2021 at 3:40 PM Maxim Blinov wrote: Hi Richard, The purpose of this patch is to give more of the target code access to the cumulative_args_t structure in order to enable certain (otherwise currently impossible)

Re: [PATCH] Adjust CPP_FOR_BUILD

2021-12-02 Thread Jeff Law via Gcc-patches
On 11/11/2021 2:10 AM, Pekka Seppänen wrote: Hi. CPP/CPPFLAGS were changed by commit 84401ce5fb4ecab55decb472b168100e7593e01f.  That commit uses CPP as a default for CPP_FOR_BUILD.  Unless CPP is defined, GNU make defaults CPP as `$(CC) -E'.  Given the context, this is now incorrect,

Re: [PATCH v2] configure: define TARGET_LIBC_GNUSTACK on musl

2021-12-02 Thread Ilya Lipnitskiy via Gcc-patches
On Thu, Dec 2, 2021 at 12:48 PM Jeff Law wrote: > > > > On 11/15/2021 10:13 PM, Ilya Lipnitskiy wrote: > > musl only uses PT_GNU_STACK to set default thread stack size and has no > > executable stack support[0], so there is no reason not to emit the > > .note.GNU-stack section on musl builds. > >

Re: [PATCH] c++, v2: Allow indeterminate unsigned char or std::byte in bit_cast - P1272R4

2021-12-02 Thread Jakub Jelinek via Gcc-patches
On Thu, Dec 02, 2021 at 03:32:58PM -0500, Jason Merrill wrote: > > So IMHO we need the patch I've posted (with the testcases slightly adjusted > > not to do those extra copies afterwards for now), > > and try to deal with the lvalue-to-rvalue conversion of indeterminate later, > > and once done,

Re: [PATCH v2] configure: define TARGET_LIBC_GNUSTACK on musl

2021-12-02 Thread Jeff Law via Gcc-patches
On 11/15/2021 10:13 PM, Ilya Lipnitskiy wrote: musl only uses PT_GNU_STACK to set default thread stack size and has no executable stack support[0], so there is no reason not to emit the .note.GNU-stack section on musl builds. [0]:

Re: [PATCH] Avoid some -Wunreachable-code-ctrl

2021-12-02 Thread Jason Merrill via Gcc-patches
On 12/1/21 02:57, Richard Biener wrote: On Tue, 30 Nov 2021, Jason Merrill wrote: On 11/29/21 10:03, Richard Biener via Gcc-patches wrote: This cleans up unreachable code diagnosed by -Wunreachable-code-ctrl. It largely follows the previous series but discovers a few extra cases, namely dead

Re: [PATCH] c++, v2: Allow indeterminate unsigned char or std::byte in bit_cast - P1272R4

2021-12-02 Thread Jason Merrill via Gcc-patches
On 12/1/21 04:46, Jakub Jelinek wrote: On Tue, Nov 30, 2021 at 03:19:19PM -0500, Jason Merrill wrote: On 11/30/21 07:17, Jakub Jelinek wrote: On Mon, Nov 29, 2021 at 10:25:58PM -0500, Jason Merrill wrote: It's a DR. Really, it was intended to be part of C++20; at the Cologne meeting in 2019

Re: [PATCH] libiberty rust-demangle, ignore .suffix

2021-12-02 Thread Nicholas Nethercote via Gcc-patches
On Fri, 3 Dec 2021 at 04:17, Mark Wielaard wrote: > > * rust-demangle.c (rust_demangle_callback): Ignore everything > after '.' char in sym for v0. > I just applied this change to Valgrind's copy of rust-demangle.c and I can confirm that it works -- the symbols that were failing

[pushed ] Darwin: Rewrite host PCH support [PR 55610].

2021-12-02 Thread Iain Sandoe via Gcc-patches
We need to revise the PCH memory allocation scheme to enable support for PIE on aarch64. The rewrite uses a similar scheme to the one used on Linux. We attempt to identify VM segments for each arch/OS version that are always available to the compiler (note this is not general, it only needs to

[committed] wwwdocs: projects/cfg: Move lighterra.com link to https

2021-12-02 Thread Gerald Pfeifer
--- htdocs/projects/cfg.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projects/cfg.html b/htdocs/projects/cfg.html index dac75c68..eaa71687 100644 --- a/htdocs/projects/cfg.html +++ b/htdocs/projects/cfg.html @@ -472,7 +472,7 @@ Compilation Tools for Alpha;

[committed] doc: Remove references to FreeBSD 1 and 2

2021-12-02 Thread Gerald Pfeifer
FreeBSD 1 and FreeBSD 2, both still a.out, have been end of life for over two decades and GCC has not been supporting them for ages, too, so simply remove references. gcc: * doc/install.texi (*-*-freebsd*): Remove references to FreeBSD 1 and FreeBSD 2. --- gcc/doc/install.texi |

[committed] analyzer: add regression test for leak false +ve [PR103526]

2021-12-02 Thread David Malcolm via Gcc-patches
Successfully regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r12-5757-g38a0ee2649ef236ea2763bb9cfc42dc917c7d3fd. gcc/testsuite/ChangeLog: PR analyzer/103526 * gcc.dg/analyzer/pr103526.c: New test. Signed-off-by: David Malcolm --- gcc/testsuite/gcc.dg/analyzer/pr103526.c |

[committed] wwwdocs: git: Fix casing of GCC

2021-12-02 Thread Gerald Pfeifer
We've been referring to the project as GCC since GCC 2.95. --- htdocs/git.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/git.html b/htdocs/git.html index 493b5734..5fbd98bf 100644 --- a/htdocs/git.html +++ b/htdocs/git.html @@ -327,7 +327,7 @@ in Git. by

Re: [PATCH] pch, v2: Add support for PCH for relocatable executables

2021-12-02 Thread Jeff Law via Gcc-patches
On 11/18/2021 1:04 AM, Jakub Jelinek wrote: On Mon, Nov 08, 2021 at 08:48:07PM +0100, Jakub Jelinek via Gcc-patches wrote: On Mon, Nov 08, 2021 at 12:46:04PM +0100, Jakub Jelinek via Gcc-patches wrote: So, if we want to make PCH work for PIEs, I'd say we can: 1) add a new GTY option, say

Re: [PATCH] regrename: Skip renaming if instruction is noop move.

2021-12-02 Thread Jeff Law via Gcc-patches
On 11/18/2021 11:23 PM, Jojo R wrote: — Jojo 在 2021年11月19日 +0800 AM12:13,Jeff Law ,写道: On 11/16/2021 7:20 PM, Jojo R via Gcc-patches wrote: — Jojo 在 2021年11月16日 +0800 PM8:12,Richard Biener ,写道: On Tue, Nov 16, 2021 at 12:45 PM Jojo R via

Re: [vect-patterns] Refactor widen_plus/widen_minus as internal_fns

2021-12-02 Thread Richard Sandiford via Gcc-patches
[Review for patch 1] Joel Hutton writes: > From e7b3017b7b5879204e9d61760a85cc84beeb4fe0 Mon Sep 17 00:00:00 2001 > From: Joel Hutton > Date: Wed, 25 Aug 2021 14:31:15 +0100 > Subject: [PATCH 1/3] [vect-patterns] Refactor to allow internal_fn's > > Hi all, > > This refactor allows widening

Re: [PATCH] libgccjit: add some reflection functions in the jit C api

2021-12-02 Thread Gerald Pfeifer
On Sat, 27 Nov 2021, Petter Tomner wrote: > Ye it is supposed to compile cleanly for 32bit too. > > I pushed a patch for it as a "free for all". With %zu specifiers. Thank you, Petter. I just updated the lang/gcc12-devel port in FreeBSD to Sunday's snapshot that has those changes, so we shall

Re: [PATCH] c++: Handle auto(x) in parameter-declaration-clause [PR103401]

2021-12-02 Thread Jason Merrill via Gcc-patches
On 12/2/21 10:27, Marek Polacek wrote: On Wed, Dec 01, 2021 at 11:24:58PM -0500, Jason Merrill wrote: On 12/1/21 10:16, Marek Polacek wrote: In C++23, auto(x) is valid, so decltype(auto(x)) should also be valid, so void f(decltype(auto(0))); should be just as void f(int); but

Re: [PR103437] [committed] IRA: Process multiplication overflow in priority calculation for allocno assignments

2021-12-02 Thread Vladimir Makarov via Gcc-patches
On 2021-12-02 12:21, Vladimir Makarov via Gcc-patches wrote: On 2021-12-02 12:06, Vladimir Makarov wrote: So simple problem and so many details :) This will require that long long is at least twice as large as int everywhere, I thought you wanted to do that only when

Re: [SVE] PR96463 - Optimise svld1rq from vectors

2021-12-02 Thread Richard Sandiford via Gcc-patches
Prathamesh Kulkarni writes: > Hi Richard, > I have attached a WIP untested patch for PR96463. > IIUC, the PR suggests to transform > lhs = svld1rq ({-1, -1, ...}, [0]) > into: > lhs = vec_perm_expr > if v is vector of 4 elements, and each element is 32 bits on little > endian target ? > > I am

Re: [PATCH] libiberty rust-demangle, ignore .suffix

2021-12-02 Thread Eduard-Mihai Burtescu
On Thu, Dec 2, 2021, at 19:17, Mark Wielaard wrote: > Rust v0 symbols can have a .suffix because if compiler transformations. For some context, the suffix comes from LLVM (I believe as part of its LTO). If this were a semantic part of a Rust symbol, it would have an encoding within v0 (as we

Re: [PR103437] [committed] IRA: Process multiplication overflow in priority calculation for allocno assignments

2021-12-02 Thread Vladimir Makarov via Gcc-patches
On 2021-12-02 12:06, Vladimir Makarov wrote: On 2021-12-02 11:13, Jakub Jelinek wrote: On Thu, Dec 02, 2021 at 11:03:46AM -0500, Vladimir Makarov wrote: --- a/gcc/ira-color.c +++ b/gcc/ira-color.c @@ -2797,6 +2797,7 @@ static void   setup_allocno_priorities (ira_allocno_t

[PATCH] libiberty rust-demangle, ignore .suffix

2021-12-02 Thread Mark Wielaard
Rust v0 symbols can have a .suffix because if compiler transformations. These can be ignored it the demangled name. Which is what this patch implements). But an alternative implementation could be to follow what C++ does and represent these as [clone .suffix] tagged onto the demangled name. But

[wwwdocs] Document --enable-libstdcxx-allocator changes

2021-12-02 Thread Jonathan Wakely via Gcc-patches
Pushed to wwwdocs. --- htdocs/gcc-12/changes.html | 5 + 1 file changed, 5 insertions(+) diff --git a/htdocs/gcc-12/changes.html b/htdocs/gcc-12/changes.html index 000501fb..c2b87a53 100644 --- a/htdocs/gcc-12/changes.html +++ b/htdocs/gcc-12/changes.html @@ -41,6 +41,11 @@ a

Re: [PR103437] [committed] IRA: Process multiplication overflow in priority calculation for allocno assignments

2021-12-02 Thread Vladimir Makarov via Gcc-patches
On 2021-12-02 11:13, Jakub Jelinek wrote: On Thu, Dec 02, 2021 at 11:03:46AM -0500, Vladimir Makarov wrote: --- a/gcc/ira-color.c +++ b/gcc/ira-color.c @@ -2797,6 +2797,7 @@ static void setup_allocno_priorities (ira_allocno_t *consideration_allocnos, int n) { int i, length, nrefs,

[PATCH] libstdc++: Fix non-reserved name in std::allocator base class [PR64135]

2021-12-02 Thread Jonathan Wakely via Gcc-patches
I'd like to push this to trunk to fix PR64135. It think this fixes the use of a non-reserved name, while preserving the ABI as far as class layout goes. It will break any programs which rely on std::allocator having a __gnu_cxx::new_allocator base class, e.g. so that

[PATCH] libstdc++: Do not leak empty COW strings

2021-12-02 Thread Jonathan Wakely via Gcc-patches
Apart from "don't bother changing the COW string", does anybody see a reason we shouldn't do this? This passes all tests for normal COW strings and fully-dynamic COW strings. When non-const references, pointers or iterators are obtained to the contents of a COW std::basic_string, the

[committed] libstdc++: Allow exception classes to move fully-dynamic strings

2021-12-02 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux using --enable-fully-dynamic-string and x86_64-linux using the default config. Pushed to trunk. The move constructor for the fully-dynamic std::basic_string was not noexcept until recently, so the std::logic_error and std::runtime_error move constructors were defined to

Re: [PATCH] libstdc++: Remove broken std::allocator base classes [PR103340]

2021-12-02 Thread Jonathan Wakely via Gcc-patches
On Wed, 24 Nov 2021 at 13:25, Jonathan Wakely via Libstdc++ wrote: > > I plan to commit this Real Soon. Please yell if you need these > alternative std::allocator back-ends to stay (and explain how you're > using them when they've been broken for years, and start sending test > results to the

[committed] libstdc++: Restore unconditional atomic load in COW std::string

2021-12-02 Thread Jonathan Wakely via Gcc-patches
On Wed, 1 Dec 2021 at 18:24, Jonathan Wakely wrote: > > On Wed, 1 Dec 2021 at 18:16, Florian Weimer wrote: > > > > * Jonathan Wakely via Libstdc: > > > > > diff --git a/libstdc++-v3/include/bits/cow_string.h > > > b/libstdc++-v3/include/bits/cow_string.h > > > index ced395b80b8..4fae1d02981

Re: [PATCH] OpenMP: Ensure that offloaded variables are public

2021-12-02 Thread Jakub Jelinek via Gcc-patches
On Thu, Dec 02, 2021 at 04:31:36PM +, Andrew Stubbs wrote: > On 02/12/2021 16:05, Andrew Stubbs wrote: > > On 02/12/2021 12:58, Jakub Jelinek wrote: > > > > I've tried modifying offload_handle_link_vars but that spot > > > > doesn't catch > > > > the omp_data_sizes variables emitted by > > > >

Re: [PATCH] rs6000: Builtins test changes for test_fpscr_[d]rn_builtin_error.c

2021-12-02 Thread Bill Schmidt via Gcc-patches
Hi! On 12/1/21 5:00 PM, Segher Boessenkool wrote: > On Thu, Nov 18, 2021 at 10:36:52AM -0600, Bill Schmidt wrote: >> Hi! This is the last patch broken out of the previous test suite patch >> for the new builtins support. > Whew :-) > >> One advantage of the new builtins support is uniform error

Re: [PATCH] stddef.h: add support for musl typedef macro guards

2021-12-02 Thread Jeff Law via Gcc-patches
On 11/26/2021 9:57 AM, soeren--- via Gcc-patches wrote: From: Sören Tempel The stddef.h header checks/sets various hardcoded toolchain/os specific macro guards to prevent redefining types such as ptrdiff_t, wchar_t, or size_t. However, without this patch, the file does not check/set the

Re: [PATCH] OpenMP: Ensure that offloaded variables are public

2021-12-02 Thread Andrew Stubbs
On 02/12/2021 16:05, Andrew Stubbs wrote: On 02/12/2021 12:58, Jakub Jelinek wrote: I've tried modifying offload_handle_link_vars but that spot doesn't catch the omp_data_sizes variables emitted by libgomp.c-c++-common/target_42.c, which was one of the motivating examples. Why doesn't catch

[Ada] Remove obsolete a-assert

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
This package is a leftover after the change for using the base compiler's runtime during bootstrap. It is not used anymore. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * gcc-interface/a-assert.ads, gcc-interface/a-assert.adb: Remove.diff --git

[Ada] Do not back-annotate maximum size for limited types

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
This prevents gigi from back-annotating a maximum size for the Esize of limited record and concurrent types, in keeping with the implementation of Analyze_Object_Declaration for objects of these types. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * gcc-interface/decl.c

[Ada] Fix packing for array component with discriminated part

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
This restores the packing for a record type that contains a component of an array type whose component type is a record type with a subcomponent that is of a discriminated record type with variable size. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * gcc-interface/gigi.h

[Ada] Proof of System.Arith_32 for double arithmetic on 32bits

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
This replicates in a simpler setting the proofs performed for generic unit System.Arith_Double. Note that it makes a difference to declare functions Big as expression functions here instead of renamings, as some checks are not proved with renamings, so expression functions are used instead.

[Ada] Invalid memory access on finalization of class-wide type

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
This patch is the first part of a correction for issues in the compiler whereby finalization of a heap-allocated class-wide type may cause an invalid memory read at runtime when the type in question contains a component whose type has alignment specified. Tested on x86_64-pc-linux-gnu, committed

[Ada] Fix obsolete array aggregate warning being triggered by expanded code

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
Filter out nodes not coming from source before emitting the warning. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_aggr.adb (Resolve_Array_Aggregate): Filter out nodes not coming from source before emitting the warning.diff --git a/gcc/ada/sem_aggr.adb

[Ada] Reset internal flags for -gnatD and -gnatG

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
This resets the internal flags associated with the -gnatD and -gnatG switches once the generated code is printed, so that it does not end up being printed twice in case something goes wrong after this point. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sprint.adb

[Ada] Amend proof of System.Arith_Double to remove justifications

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
The proof of System.Arith_Double contained 11 occurrences of pragma Annotate to justify unproved checks, 10 of which for calls to Raise_Error denoting a case where the input leads to a division by zero or an overflow, and one for a loop invariant regarding an assumption on Single_Size. That should

[Ada] Proof of support units for 'Width on signed integers

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
This replicates the proofs performed for 'Width on modular integers to the units that support 'Width on signed integers. Also add a minimal postcondition to the System.Width_U. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-widint.ads: Mark in SPARK. *

[Ada] Add pragma Annotate for CodePeer analysis

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
CodePeer issues a spurious message on the analysis of the loop variant in s-widthi.adb. Similarly to the same for s-widthu.adb, add a pragma Annotate to justify this message. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-widthi.adb: Add pragma Annotate.diff

[Ada] Cleanup detection of suspension objects

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
Current implementation of Is_Suspension_Object is a leftover from an old code of Is_Descendant_Of_Suspension_Object, which used RTE_Available and indeed couldn't be called from GNATprove. Now Is_Descendant_Of_Suspension_Object can work with Is_RTE, which can be safely called from GNATprove.

[Ada] Cleanup insertion of single freezing actions

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
Replace calls to Ensure_Freeze_Node & Append_Freeze_Actions (plural) with a simple call to Append_Freeze_Action (singular), which calls Ensure_Freeze_Node itself. Cleanup related to expansion of dispatching primitives for GNATprove; semantics is unaffected. Tested on x86_64-pc-linux-gnu,

[PING] [PATCH] rs6000: testsuite: Add rop_ok effective-target function

2021-12-02 Thread Peter Bergner via Gcc-patches
I'd like to ping the following patch. The test case in the previously OK'd fix for PR101324 depends on this change, so I've had to hold off committing it until this is in. Thanks. https://gcc.gnu.org/pipermail/gcc-patches/2021-November/584208.html Peter Message-ID: This patch adds a

[Ada] Use bracket aggregates in Ada2022

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
Make bracket syntax array and container aggregates available with -gnat2022. Parenthesis syntax is not accepted anymore for container aggregate but can still be used for array aggregates. The latter is considered obsolete and a warning is emitted with -gnatwj. The warning is also temporarily

[Ada] Cleanups related to expansion of dispatching primitives

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
Assorted cleanups related to expansion of dispatching primitives on derived types for GNATprove; semantics of the compiler is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * doc/gnat_rm/standard_and_implementation_defined_restrictions.rst

[Ada] Remove extra space after assignment symbol

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
Fix style issues in GNAT after spotting a similar problem in one of the tests for GNATprove. These are easy to find with grep, but still require a manual inspection, because we want to preserve layout in declaration lists like: A := 1; B := 10; C := 100; Tested on x86_64-pc-linux-gnu,

[Ada] Enhance freezing code for instantiations

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
This makes it possible for the freezing code to let the back-end establish a proper order of elaboration of package and subprogram instantiations in more cases, in particular with circularities, by placing freeze nodes for them later in the expanded code in these cases. Tested on

[Ada] Inline all calls in Ada.Task_Identification

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
Code cleanup; all routines in Ada.Task_Identification had pragma Inline except Activation_Is_Complete (and Image, which should rather stay like that). Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnarl/a-taside.ads (Activation_Is_Complete): Add pragma

[Ada] Enable expansion of dispatching equality for GNATprove

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
For GNAT the dispatching equality is generated in expansion of freezing nodes. For GNATprove this expansion needs to be specifically enabled and must occur in a carefully setup context. Previously type freezing for GNATprove only involved building of the DIC procedure, which didn't require much

[Ada] Separate building of equality from other dispatching routines

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
For GNAT we create dispatching equality together with other dispatching routines (e.g. for stream reading and writing). For GNATprove we need to create only the dispatching equality. This patch separates it, so that it can be created from a SPARK-specific expansion. Tested on x86_64-pc-linux-gnu,

[Ada] Split spec and body of expression function with Subprogram_Variant

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
Due to a latent bug with freezing, the expression function with Subprogram_Variant which was recently added to the System.Val_Util unit triggers a crash in CodePeer. Ordinary compilation was not affected by this bug, because of the Assertion_Policy (Ghost => Ignore) applied to this unit. Tested

[Ada] Refactor nested loops in warning on unassigned out parameter

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
For warning about unassigned out parameter we had a loop over all formal parameters which contained another loop over all formal parameters. This was inefficient. Cleanup related to spurious warnings about 'Initialized. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ *

[Ada] Don't allow entry in implicit with chain to be ghost

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
When we add an entry to the implicit with chain of a unit while adding an RTS unit, we must not mark it as a ignored ghost statement because it points to the next with in the chain. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * rtsfind.adb (Maybe_Add_With): Ensure that

[Ada] Simplify iteration over record components

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
Iterate over record components with First_Component/Next_Component and not with First_Entity/Next_Entity. Change in Sem_Warn unit is related to spurious warning on 'Initialized; other occurrences of the same pattern were found with grep. Tested on x86_64-pc-linux-gnu, committed on trunk

[Ada] Remove duplicated condition in warnings about read-before-write

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
Code for warnings about read-before-write of a variable had one condition in the outer IF statement and then the very same condition in an inner IF statement. Cleanup related to spurious warning on 'Initialized. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_warn.adb

[Ada] vx7r2cert/light-tasking-rtp: undefined refs on ppc/ppc64

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
Vx7r2cert ppc/ppc64 targets use the gcc toolchain, which requires a slightly different forumulation of libraries for the rts-light-tasking-rtp runtime. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * vxworks7-cert-rtp-link__ppcXX.spec: New file. * Makefile.rtl: Use

[Ada] Proof of Interfaces.C with SPARK

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
This proves the functionality of Interfaces.C with GNATprove. Ada RM specifications are added as comments in the spec, next to the formalization of specifications as contracts. As a side-effect of this proof, fix two errors in the 4 procedure versions of To_Ada, which may raise a range check

[Ada] Add contract to Ada.Task_Identification.Activation_Is_Complete

2021-12-02 Thread Pierre-Marie de Rodat via Gcc-patches
Description of Activation_Is_Complete was amended in AI12-0231-1. This routine raises a Program_Error when called with Null_Task_Id. Add an explicit contract to make GNATprove aware of the restriction. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnarl/a-taside.ads

  1   2   >