[PATCH] Add alias disambiguation for vectorizer load/store IFNs

2022-07-21 Thread Richard Biener via Gcc-patches
The following adds support for MASK_STORE, MASK_LOAD and friends to call_may_clobber_ref_p and ref_maybe_used_by_call_p. Since they all use a special argument to specify TBAA they are not really suited for fnspec handling thus the manual support. Bootstrapped and tested on x86_64-unknown-linux-gn

[PATCH v2] RTEMS: Add -ftls-model=local-exec to multilibs

2022-07-21 Thread Sebastian Huber
Use the local-exec TLS model for all multilibs of all RTEMS targets with proper TLS support. gcc/ChangeLog: * config.gcc (aarch64-*-rtems*): Extend tmake_file. * config/arm/t-rtems (MULTILIB_EXTRA_OPTS): Define to use -ftls-model=local-exec. * config/i386/t-rtems (

[GCC 12] libstdc++: Fix lifetime bugs for non-TLS eh_globals [PR105880]

2022-07-21 Thread Sebastian Huber
From: Jonathan Wakely This ensures that the single-threaded fallback buffer eh_globals is not destroyed during program termination, using the same immortalization technique used for error category objects. Also ensure that init._M_init can still be read after init has been destroyed, by making i

[PATCH] docs: update abi version info

2022-07-21 Thread Kim Kuparinen via Gcc-patches
Synchronize gcc/common.opts and gcc/doc/invoke.texi w.r.t -fabi-version, and correct -fabi-compat-version from ABIv11 to ABIv13, since it was changed in a37e8ce3b66325f0c6de55c80d50ac1664c3d0eb gcc/ChangeLog: * doc/invoke.texi: update abi version info --- gcc/doc/invoke.texi | 11 +++

Re: [PATCH] RISC-V: Add RTX costs for `if_then_else' expressions

2022-07-21 Thread Kito Cheng via Gcc-patches
Hi Maciej: LGTM, thanks for modeling this in cost model! On Tue, Jul 19, 2022 at 12:48 AM Maciej W. Rozycki wrote: > > Fix a performance regression from commit 391500af1932 ("Do not ignore > costs of jump insns in combine."), a part of the m68k series for MODE_CC > conversion (

[PATCH] Teach VN about masked/len stores

2022-07-21 Thread Richard Biener via Gcc-patches
The following teaches VN to handle reads from .MASK_STORE and .LEN_STORE. For this push_partial_def is extended first for convenience so we don't have to handle the full def case in the caller (possibly other paths can be simplified then). Also the partial definition stored value can have an offs

Re: [PATCH 1/1 V5] RISC-V: Support Zmmul extension

2022-07-21 Thread Kito Cheng via Gcc-patches
LGTM, will merge once binuils part merge. On Wed, Jul 13, 2022 at 10:14 AM wrote: > > From: LiaoShihua > > gcc/ChangeLog: > > * common/config/riscv/riscv-common.cc: Add Zmmul. > * config/riscv/riscv-opts.h (MASK_ZMMUL): New. > (TARGET_ZMMUL): Ditto. > * config/ris

[PATCH 8/12 V3] arm: Introduce multilibs for PACBTI target feature

2022-07-21 Thread Andrea Corallo via Gcc-patches
Richard Earnshaw writes: [...] >> The documentation mentions -mbranch-protection=standard+leaf, so >> you're missing a mapping for that. >> OK with that change. >> R. > > Oh, and please add some tests to gcc/testsuite/gcc.target/arm/multilib.exp > > R. Hi Richard, thanks, here the updated patc

[PATCH] tree-optimization/106365 - DSE of LEN_STORE and MASK_STORE

2022-07-21 Thread Richard Biener via Gcc-patches
The following enhances DSE to handle LEN_STORE (optimally) and MASK_STORE (conservatively). Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. Kewen is testing on powerpc. Handling MASK_STORE_LANES in a similar way to MASK_STORE is probably possible but I couldn't figure a way to gene

[committed] MAINTAINERS: Add myself as Ada front end co-maintainer

2022-07-21 Thread Marc Poulhiès via Gcc-patches
Add myself as Ada front end co-maintainer. Committed as f4ed610d02aaf8cfcdcb5cf03e0cde65f1f5f890. ChangeLog: * MAINTAINERS: Add myself as Ada front end co-maintainer. --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 7a7ad

[PATCH 9/12 V2] arm: Make libgcc bti compatible

2022-07-21 Thread Andrea Corallo via Gcc-patches
Richard Earnshaw writes: > On 28/04/2022 10:48, Andrea Corallo via Gcc-patches wrote: >> This change add bti instructions at the beginning of arm specific >> libgcc hand written assembly routines. >> 2022-03-31 Andrea Corallo >> * libgcc/config/arm/crti.S (FUNC_START): Add bti instruction

Re: [PATCH v3] RISC-V/testsuite: constraint some of tests to hard_float

2022-07-21 Thread Kito Cheng via Gcc-patches
> On 5/29/22 20:50, Kito Cheng via Gcc-patches wrote: > > Committed, thanks! > > Can this be backported to gcc-12 please. I want to say yes but 9ddd44b58649d1d ("RISC-V: Provide `fmin'/`fmax' RTL pattern") only existing in the trunk, and gcc.target/riscv/pr105666.c part has fixed[1] during backpor

Re: [PATCH v1 1/3] RISC-V: Split "(a & (1 << BIT_NO)) ? 0 : -1" to bexti + addi

2022-07-21 Thread Kito Cheng via Gcc-patches
Hi Philipp: This patch series is LGTM, but plz introduce new pseudo when can_create_pseudo_p like what we discussed in https://gcc.gnu.org/pipermail/gcc-patches/2022-June/596305.html, you can commit with the change with a [committed] patch mail :) On Thu, Jun 16, 2022 at 5:32 PM Philipp Tomsich

Re: [PATCH] Teach VN about masked/len stores

2022-07-21 Thread Kewen.Lin via Gcc-patches
Hi Richi, on 2022/7/21 17:01, Richard Biener via Gcc-patches wrote: > The following teaches VN to handle reads from .MASK_STORE and > .LEN_STORE. For this push_partial_def is extended first for > convenience so we don't have to handle the full def case in the > caller (possibly other paths can be

Re: [PATCH] libsanitizer: cherry-pick 9cf13067cb5088626ba7 from upstream

2022-07-21 Thread Richard Biener via Gcc-patches
On Mon, Jul 11, 2022 at 10:05 PM Martin Liška wrote: > > I'm going to push the following cherry-pick which fixes libasan > build with top-of-tree glibc. Can you also push this to active branches please? > Martin > > 9cf13067cb5088626ba7ee1ec4c42ec59c7995a0 [sanitizer] Remove #include > to reso

Re: libgo patch committed: Don't include in sysinfo.c

2022-07-21 Thread Richard Biener via Gcc-patches
On Wed, Jul 13, 2022 at 6:03 PM Ian Lance Taylor via Gcc-patches wrote: > > This libgo patch stops including when building > gen-sysinfo.go. Removing this doesn't change anything at least with > glibc 2.33. The include was added in https://go.dev/cl/6100049 but > it's not clear why. This shoul

[Patch] OpenMP: Support reverse offload (middle end part)

2022-07-21 Thread Tobias Burnus
This patch does three things: (a) It removes a 'sorry' for 'device(ancestor:1)' and passes GOMP_DEVICE_HOST_FALLBACK as device number. This is sufficient for full "reverse" offload support with ENABLE_OFFLOADING being false - and -foffload=disable. And for simple hello-world cases. On the

Re: [PATCH 5/12 V2] arm: Implement target feature macros for PACBTI

2022-07-21 Thread Richard Earnshaw via Gcc-patches
On 12/07/2022 16:45, Andrea Corallo via Gcc-patches wrote: Richard Earnshaw writes: On 28/04/2022 10:42, Andrea Corallo via Gcc-patches wrote: This patch implements target feature macros when PACBTI is enabled through the -march option or -mbranch-protection. The target feature macros __A

Re: [PATCH 7/12 V2] arm: Emit build attributes for PACBTI target feature

2022-07-21 Thread Richard Earnshaw via Gcc-patches
On 13/07/2022 09:58, Andrea Corallo via Gcc-patches wrote: Richard Earnshaw writes: On 28/04/2022 10:45, Andrea Corallo via Gcc-patches wrote: This patch emits assembler directives for PACBTI build attributes as defined by the ABI.

Re: [PATCH 8/12 V3] arm: Introduce multilibs for PACBTI target feature

2022-07-21 Thread Richard Earnshaw via Gcc-patches
On 21/07/2022 10:04, Andrea Corallo via Gcc-patches wrote: Richard Earnshaw writes: [...] The documentation mentions -mbranch-protection=standard+leaf, so you're missing a mapping for that. OK with that change. R. Oh, and please add some tests to gcc/testsuite/gcc.target/arm/multilib.exp

[PATCH] tree-optimization/106379 - add missing ~(a ^ b) folding for _Bool

2022-07-21 Thread Richard Biener via Gcc-patches
The following makes sure to fold ~(a ^ b) to a == b for truth values (but not vectors, we'd have to check for vector support of equality). That turns the PR106379 testcase into a ranger one. Note that while we arrive at ~(a ^ b) in a convoluted way from original !a == !b one can eventually write

Re: [PATCH 9/12 V2] arm: Make libgcc bti compatible

2022-07-21 Thread Richard Earnshaw via Gcc-patches
On 21/07/2022 10:17, Andrea Corallo via Gcc-patches wrote: Richard Earnshaw writes: On 28/04/2022 10:48, Andrea Corallo via Gcc-patches wrote: This change add bti instructions at the beginning of arm specific libgcc hand written assembly routines. 2022-03-31 Andrea Corallo * libgcc

Re: libgo patch committed: Don't include in sysinfo.c

2022-07-21 Thread Martin Liška
On 7/21/22 12:19, Richard Biener via Gcc-patches wrote: > On Wed, Jul 13, 2022 at 6:03 PM Ian Lance Taylor via Gcc-patches > wrote: >> >> This libgo patch stops including when building >> gen-sysinfo.go. Removing this doesn't change anything at least with >> glibc 2.33. The include was added in

Re: [PATCH] libsanitizer: cherry-pick 9cf13067cb5088626ba7 from upstream

2022-07-21 Thread Martin Liška
On 7/21/22 12:18, Richard Biener wrote: > Can you also push this to active branches please? Sure, I've just done that. Cheers, Martin

Re: [Patch] OpenMP: Support reverse offload (middle end part)

2022-07-21 Thread Tobias Burnus
Ups to quick/wrong patch file. I had found an issue related to 'noclone' (duplicated entries, dg-scan-dump issues with OpenACC) – but ended up to attach the wrong file... Changes: omp-low.cc and gcc/testsuite/*/goacc/. The rest is the same. Tobias On 21.07.22 12:55, Tobias Burnus wrote: This p

[PATCH] c++: CTAD from initializer list [PR106366]

2022-07-21 Thread Patrick Palka via Gcc-patches
During CTAD, we currently perform the first phase of overload resolution from [over.match.list] only if the class template has a list constructor. But according to [over.match.class.deduct]/4 it should be enough to just have a guide that looks like a list constructor (which is a more general criter

Re: [PATCH] c++: CTAD from initializer list [PR106366]

2022-07-21 Thread Patrick Palka via Gcc-patches
On Thu, 21 Jul 2022, Patrick Palka wrote: > During CTAD, we currently perform the first phase of overload resolution > from [over.match.list] only if the class template has a list constructor. > But according to [over.match.class.deduct]/4 it should be enough to just > have a guide that looks like

Re: [PATCH 1/1 V5] RISC-V: Support Zmmul extension

2022-07-21 Thread Palmer Dabbelt
On Thu, 21 Jul 2022 02:03:35 PDT (-0700), gcc-patches@gcc.gnu.org wrote: LGTM, will merge once binuils part merge. +Nelson, in case he's already planning on handling those. If not then they're not in my inbox, so just poke me if you want me to review them. Also some comments on the patch be

Re: [PATCH] rs6000/test: Update some cases with -mdejagnu-tune

2022-07-21 Thread Segher Boessenkool
Hi! On Wed, Jul 20, 2022 at 05:31:11PM +0800, Kewen.Lin wrote: > As PR106345 shows, some test cases should be updated with > -mdejagnu-tune, since their test points are sensitive to > rs6000_tune, such as: group_ending_nop, loop align (ic), > float conversion cost etc. It does not make sense to r

[PATCH] x86: Add ix86_ifunc_ref_local_ok

2022-07-21 Thread H.J. Lu via Gcc-patches
We can't always use the PLT entry as the function address for local IFUNC functions. When the PIC register is needed for PLT call, indirect call via the PLT entry will fail since the PIC register may not be set up properly for indirect call. Add ix86_ifunc_ref_local_ok to return false when the PL

Re: libgo patch committed: Don't include in sysinfo.c

2022-07-21 Thread Ian Lance Taylor via Gcc-patches
On Thu, Jul 21, 2022 at 4:53 AM Martin Liška wrote: > > On 7/21/22 12:19, Richard Biener via Gcc-patches wrote: > > On Wed, Jul 13, 2022 at 6:03 PM Ian Lance Taylor via Gcc-patches > > wrote: > >> > >> This libgo patch stops including when building > >> gen-sysinfo.go. Removing this doesn't cha

[pushed] MAINTAINERS: Add myself to Write After Approval

2022-07-21 Thread Sam Feifer via Gcc-patches
ChangeLog: * MAINTAINERS (Write After Approval): Add myself. --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index e2db0cfe18b..46c9e48a497 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -398,6 +398,7 @@ Chris Fairles

[PATCH] Fortran: fix invalid rank error in ASSOCIATED when rank is remapped [PR77652]

2022-07-21 Thread Harald Anlauf via Gcc-patches
Dear all, the rank check for ASSOCIATED (POINTER, TARGET) did not allow all rank combinations that were allowed in pointer assignment for newer versions of the Fortran standard (F2008+). Fix the logic. Regtested on x86_64-pc-linux-gnu. OK for mainline? Thanks, Harald From 338b43aefece04435d32

Re: [PATCH] Remove setting -mblock-ops-vector-pair on power10.

2022-07-21 Thread Segher Boessenkool
On Thu, Jul 21, 2022 at 02:42:29AM -0400, Michael Meissner wrote: > Testing has shown that using the load vector pair and store vector pair > instructions for block moves has some performance issues on power10. This > patch does not set this option by default. If it is a win in other > machines i

[pushed] c++: defaulted ctor with DMI in union [PR94823]

2022-07-21 Thread Jason Merrill via Gcc-patches
CWG2084 clarifies that a variant member with a non-trivial constructor does not make the union's defaulted default constructor deleted if another variant member has a default member initializer. Tested x86_64-pc-linux-gnu, applying to trunk. DR 2084 PR c++/94823 gcc/cp/ChangeLog:

[pushed] c++: defaulted friend op== [PR106361]

2022-07-21 Thread Jason Merrill via Gcc-patches
Now non-member functions can be defaulted, so this assert is wrong. move_signature_fn_p already checks for ctor or op=. Tested x86_64-pc-linux-gnu, applying to trunk. PR c++/106361 gcc/cp/ChangeLog: * decl.cc (move_fn_p): Remove assert. gcc/testsuite/ChangeLog: * g++.d

[pushed] match.pd: Add new abs pattern [PR94920]

2022-07-21 Thread Sam Feifer via Gcc-patches
This patch is intended to fix a missed optimization in match.pd. It optimizes (x >= 0 ? x : 0) + (x <= 0 ? -x : 0) to just abs(x). Additionally, the pattern (x <= 0 ? -x : 0) now gets optimized to max(-x, 0), which helps with the other simplification rule. Tests are also included to be added to

[committed] analyzer: fix -Wanalyzer-va-list-exhausted false +ve on va_arg in subroutine [PR106383]

2022-07-21 Thread David Malcolm via Gcc-patches
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r13-1786-gb852aa7f265424. gcc/analyzer/ChangeLog: PR analyzer/106383 * varargs.cc (region_model::impl_call_va_arg): When determining if we're doing interprocedural analysis, use the stack dept

Re: [pushed] match.pd: Add new abs pattern [PR94920]

2022-07-21 Thread Marek Polacek via Gcc-patches
On Thu, Jul 21, 2022 at 05:28:34PM -0400, Sam Feifer via Gcc-patches wrote: > This patch is intended to fix a missed optimization in match.pd. It optimizes > (x >= 0 ? x : 0) + (x <= 0 ? -x : 0) to just abs(x). Additionally, the > pattern (x <= 0 ? -x : 0) now gets optimized to max(-x, 0), which

Re: [PATCH] rs6000/test: Fix empty TU in some cases of effective targets

2022-07-21 Thread Segher Boessenkool
On Wed, Jul 20, 2022 at 05:32:01PM +0800, Kewen.Lin wrote: > As the failure of test case gcc.target/powerpc/pr92398.p9-.c in > PR106345 shows, some test sources for some powerpc effective > targets use empty translation unit wrongly. The test sources > could go with options like "-ansi -pedantic-e

Re: [PATCH 1/1 V5] RISC-V: Support Zmmul extension

2022-07-21 Thread Kito Cheng via Gcc-patches
On Fri, Jul 22, 2022 at 2:43 AM Palmer Dabbelt wrote: > > On Thu, 21 Jul 2022 02:03:35 PDT (-0700), gcc-patches@gcc.gnu.org wrote: > > LGTM, will merge once binuils part merge. > > +Nelson, in case he's already planning on handling those. If not then > they're not in my inbox, so just poke me if

Re: [PATCH] rs6000/test: Fix empty TU in some cases of effective targets

2022-07-21 Thread Kewen.Lin via Gcc-patches
Hi Segher, Thanks for the comments! on 2022/7/22 06:09, Segher Boessenkool wrote: > On Wed, Jul 20, 2022 at 05:32:01PM +0800, Kewen.Lin wrote: >> As the failure of test case gcc.target/powerpc/pr92398.p9-.c in >> PR106345 shows, some test sources for some powerpc effective >> targets use empty tr

Re: [PATCH] rs6000/test: Fix empty TU in some cases of effective targets

2022-07-21 Thread Segher Boessenkool
Hi! On Fri, Jul 22, 2022 at 08:41:43AM +0800, Kewen.Lin wrote: > Hi Segher, > > Thanks for the comments! Always. > >> This patch is to fix empty TUs with one dummy variable definition > >> accordingly. > > > > You can also use > > enum{a}; > > which is shorter, but more importantly does not

Re: [PATCH] rs6000/test: Fix empty TU in some cases of effective targets

2022-07-21 Thread Kewen.Lin via Gcc-patches
Hi! on 2022/7/22 09:02, Segher Boessenkool wrote: > Hi! > > On Fri, Jul 22, 2022 at 08:41:43AM +0800, Kewen.Lin wrote: >> Hi Segher, >> >> Thanks for the comments! > > Always. > This patch is to fix empty TUs with one dummy variable definition accordingly. >>> >>> You can also use >>>

[r13-1786 Regression] FAIL: gcc.dg/analyzer/stdarg-3.c (test for excess errors) on Linux/x86_64

2022-07-21 Thread skpandey--- via Gcc-patches
On Linux/x86_64, b852aa7f265424c8e2036899da5d8306ff06a16c is the first bad commit commit b852aa7f265424c8e2036899da5d8306ff06a16c Author: David Malcolm Date: Thu Jul 21 17:29:26 2022 -0400 analyzer: fix -Wanalyzer-va-list-exhausted false +ve on va_arg in subroutine [PR106383] caused FAI

[PATCH] Adjust testcase.

2022-07-21 Thread liuhongt via Gcc-patches
r13-1762-gf9d4c3b45c5ed5f45c8089c990dbd4e181929c3d lower complex type move to scalars, but testcase pr23911 is supposed to scan __complex__ constant which is never available, so adjust testcase to scan IMAGPART/REALPART_EXPR constants separately. Pushed as obvious patch. gcc/testsuite/ChangeLog

Re: [PATCH] rs6000/test: Update some cases with -mdejagnu-tune

2022-07-21 Thread Kewen.Lin via Gcc-patches
Hi Segher, Thanks for the comments! on 2022/7/22 02:48, Segher Boessenkool wrote: > Hi! > > On Wed, Jul 20, 2022 at 05:31:11PM +0800, Kewen.Lin wrote: >> As PR106345 shows, some test cases should be updated with >> -mdejagnu-tune, since their test points are sensitive to >> rs6000_tune, such as: