[committed] analyzer: fix state explosion on va_arg [PR106413]

2022-07-22 Thread David Malcolm via Gcc-patches
Fix state explosion on va_arg when the call to va_start is in the top-level function of the analysis. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r13-1807-g6d5194a10dc103. gcc/analyzer/ChangeLog: PR analyzer/106413 * varargs.cc

[committed] analyzer: fix ICE in binding_cluster ctor [PR106401]

2022-07-22 Thread David Malcolm via Gcc-patches
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r13-1806-g0fb35a45a28c67. gcc/analyzer/ChangeLog: PR analyzer/106401 * store.cc (binding_cluster::binding_cluster): Remove overzealous assertion; we're checking for tracked_p in

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

2022-07-22 Thread Jason Merrill via Gcc-patches
On 7/21/22 08:43, 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 a list

Re: [PATCH] c++: Refer to internal linkage for -Wsubobject-linkage [PR86491]

2022-07-22 Thread Jason Merrill via Gcc-patches
On 6/30/22 12:53, Jonathan Wakely via Gcc-patches wrote: Tested powerpc64le-linux, OK for trunk? -- >8 -- Since C++11 relaxed the requirement for template arguments to have external linkage, it's possible to get -Wsubobject-linkage warnings without using any anonymous namespaces. This confuses

Re: [PATCH] c++: ICE with erroneous template redeclaration [PR106311]

2022-07-22 Thread Jason Merrill via Gcc-patches
On 7/15/22 11:29, Marek Polacek wrote: Here we ICE trying to get DECL_SOURCE_LOCATION of the parm that happens to be error_mark_node in this ill-formed test. I kept running into this while reducing code, so it'd be good to have it fixed. Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for

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

2022-07-22 Thread H.J. Lu via Gcc-patches
On Thu, Jul 21, 2022 at 4:24 AM Richard Biener via Gcc-patches wrote: > > 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

Re: [PATCH] xtensa: Optimize "bitwise AND NOT with imm" followed by "branch if (not) equal to zero"

2022-07-22 Thread Max Filippov via Gcc-patches
On Fri, Jul 22, 2022 at 4:18 AM Takayuki 'January June' Suwa wrote: > > The RTL combiner will transform "if ((x & C) == C) goto label;" > into "if ((~x & C) == 0) goto label;" and will try to match it with > the insn patterns. ... > gcc/ChangeLog: > > * config/xtensa/xtensa.md

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

2022-07-22 Thread Peter Bergner via Gcc-patches
On 7/22/22 1:53 PM, Peter Bergner wrote: > So I think the way the code above *should* work is: > 1) Any -mdejagnu-cpu= usage should filter out all -mcpu= and -mtune= > options. > 2) Any -mdejagnu-tune= usage should filter all -mtune= options. > It should not filter out any -mcpu=

Re: [PATCH] libgo: make match.sh POSIX-shell compatible

2022-07-22 Thread Ian Lance Taylor via Gcc-patches
On Tue, Jul 19, 2022 at 11:35 PM wrote: > > From: Sören Tempel > > The `(( expression ))` syntax is a Bash extension and not supported by > POSIX shell [1]. However, the arithmetic expressions used by the > gobuild() function can also be expressed using arithmetic POSIX > expansions with `$((

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

2022-07-22 Thread Peter Bergner via Gcc-patches
On 7/22/22 1:17 PM, Segher Boessenkool wrote: > On Fri, Jul 22, 2022 at 10:22:51AM +0800, Kewen.Lin wrote: >> on 2022/7/22 02:48, Segher Boessenkool wrote: >> As PR106345 shows, GCC can use an explicit tune setting when it's >> configured, even if there is one "-mdejagnu-cpu=", it doesn't >>

Re: [PATCH] Adding three new function attributes for static analysis of file descriptors

2022-07-22 Thread David Malcolm via Gcc-patches
On Fri, 2022-07-22 at 21:25 +0530, Immad Mir wrote: > This patch adds three new function attributes to GCC that > are used for static analysis of usage of file descriptors: > > 1) __attribute__ ((fd_arg(N))): The attributes may be applied to a > function that > takes an open file descriptor at

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

2022-07-22 Thread Segher Boessenkool
On Fri, Jul 22, 2022 at 10:22:51AM +0800, Kewen.Lin wrote: > on 2022/7/22 02:48, Segher Boessenkool wrote: > > 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 >

Re: [PATCH] libstdc++: Fix backward compatibility of P2325R3 backport [PR106320]

2022-07-22 Thread Jonathan Wakely via Gcc-patches
On Fri, 22 Jul 2022 at 16:52, Patrick Palka via Libstdc++ wrote: > > The 11 and 10 partial backports of P2325R3, r11-9555-g92d6121eec and > r10-10808-g22b86cdc4d7fdd, unnecessarily preserved some changes from the > paper that made certain views no longer default constructible, changes > which

Re: [PATCH] libstdc++: Fix backward compatibility of P2325R3 backport [PR106320]

2022-07-22 Thread Patrick Palka via Gcc-patches
On Fri, Jul 22, 2022 at 11:52 AM Patrick Palka wrote: > > The 11 and 10 partial backports of P2325R3, r11-9555-g92d6121eec and > r10-10808-g22b86cdc4d7fdd, unnecessarily preserved some changes from the > paper that made certain views no longer default constructible, changes > which aren't

[PATCH] Adding three new function attributes for static analysis of file descriptors

2022-07-22 Thread Immad Mir via Gcc-patches
This patch adds three new function attributes to GCC that are used for static analysis of usage of file descriptors: 1) __attribute__ ((fd_arg(N))): The attributes may be applied to a function that takes an open file descriptor at refrenced argument N. It indicates that the passed filedescriptor

[PATCH] libstdc++: Fix backward compatibility of P2325R3 backport [PR106320]

2022-07-22 Thread Patrick Palka via Gcc-patches
The 11 and 10 partial backports of P2325R3, r11-9555-g92d6121eec and r10-10808-g22b86cdc4d7fdd, unnecessarily preserved some changes from the paper that made certain views no longer default constructible, changes which aren't required to reap the overall benefits of the paper and which

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

2022-07-22 Thread Andrea Corallo via Gcc-patches
Richard Earnshaw writes: > 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.

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

2022-07-22 Thread David Malcolm via Gcc-patches
On Thu, 2022-07-21 at 18:35 -0700, skpan...@sc.intel.com wrote: > 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

Re: [PATCH] Fix handling of zero capacity regions in -Wanalyzer-allocation-size [PR106394]

2022-07-22 Thread David Malcolm via Gcc-patches
On Fri, 2022-07-22 at 16:27 +0200, Tim Lange wrote: > This patch unifies the handling of zero capacity regions for structs > and other types in the allocation size checker. > Regression-tested on x86_64 Linux. Thanks; looks good for trunk. Dave

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

2022-07-22 Thread Andrea Corallo via Gcc-patches
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. >> >> gcc/ChangeLog: >> *

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

2022-07-22 Thread Andrea Corallo via Gcc-patches
Andrea Corallo via Gcc-patches writes: > Hi Richard, > > thanks for reviewing. > > Richard Earnshaw writes: > > [...] > >> diff --git a/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-10.c >> b/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-10.c >> new file mode 100644 >> index

[PATCH] Fix handling of zero capacity regions in -Wanalyzer-allocation-size [PR106394]

2022-07-22 Thread Tim Lange
This patch unifies the handling of zero capacity regions for structs and other types in the allocation size checker. Regression-tested on x86_64 Linux. 2022-07-22 Tim Lange gcc/analyzer/ChangeLog: PR analyzer/106394 * region-model.cc (capacity_compatible_with_type): Always

Re: [PATCH 1/2] Allow subtarget customization of CC1_SPEC

2022-07-22 Thread Jose E. Marchesi via Gcc-patches
Hi Sebastian. I find "subtarget" confusing in this context. If it is about rtems.h, linux.h or sol2.h, wouldn't this be better called OS_CC1_SPEC or similar? These files specify configurations that apply to a set of targets, not to a subset of a target... > gcc/ChangeLog: > > * gcc.cc

[PATCH 1/2] Allow subtarget customization of CC1_SPEC

2022-07-22 Thread Sebastian Huber
gcc/ChangeLog: * gcc.cc (SUBTARGET_CC1_SPEC): Define if not defined. (CC1_SPEC): Define to SUBTARGET_CC1_SPEC. * config/arm/arm.h (CC1_SPEC): Remove. * config/arc/arc.h (CC1_SPEC): Append SUBTARGET_CC1_SPEC. * config/cris/cris.h (CC1_SPEC): Likewise.

[PATCH 2/2] RTEMS: Use local-exec TLS model by default

2022-07-22 Thread Sebastian Huber
gcc/ChangeLog: * config/rtems.h (SUBTARGET_CC1_SPEC): Undef and define. --- gcc/config/rtems.h | 4 1 file changed, 4 insertions(+) diff --git a/gcc/config/rtems.h b/gcc/config/rtems.h index 95bcdc41b2f..4742b1f3722 100644 --- a/gcc/config/rtems.h +++ b/gcc/config/rtems.h @@ -56,3

Re: [PATCH] c++: ICE with erroneous template redeclaration [PR106311]

2022-07-22 Thread Marek Polacek via Gcc-patches
Ping. On Fri, Jul 15, 2022 at 11:29:20AM -0400, Marek Polacek via Gcc-patches wrote: > Here we ICE trying to get DECL_SOURCE_LOCATION of the parm that happens > to be error_mark_node in this ill-formed test. I kept running into this > while reducing code, so it'd be good to have it fixed. > >

[PATCH] btf: do not use the CHAR `encoding' bit for BTF

2022-07-22 Thread Jose E. Marchesi via Gcc-patches
Contrary to CTF and our previous expectations, as per [1], turns out that in BTF: 1) The `encoding' field in integer types shall not be treated as a bitmap, but as an enumerated, i.e. these bits are exclusive to each other. 2) The CHAR bit in `encoding' shall _not_ be set when emitting

Re: [PATCH] c++: Refer to internal linkage for -Wsubobject-linkage [PR86491]

2022-07-22 Thread Jonathan Wakely via Gcc-patches
ping https://gcc.gnu.org/pipermail/gcc-patches/2022-June/597560.html On Thu, 30 Jun 2022 at 17:53, Jonathan Wakely wrote: > > Tested powerpc64le-linux, OK for trunk? > > -- >8 -- > > Since C++11 relaxed the requirement for template arguments to have > external linkage, it's possible to get

[PATCH] xtensa: Optimize "bitwise AND NOT with imm" followed by "branch if (not) equal to zero"

2022-07-22 Thread Takayuki 'January June' Suwa via Gcc-patches
The RTL combiner will transform "if ((x & C) == C) goto label;" into "if ((~x & C) == 0) goto label;" and will try to match it with the insn patterns. /* example */ void test_0(int a) { if ((char)a == 255) foo(); } void test_1(int a) { if ((unsigned short)a ==

Re: [PATCH] graphds: Fix description of SCC algorithm

2022-07-22 Thread Richard Biener via Gcc-patches
On Fri, Jul 22, 2022 at 12:10 PM Richard Sandiford via Gcc-patches wrote: > > graphds_scc says that it uses Tarjan's algorithm, but it looks like > it uses Kosaraju's algorithm instead (dfs one way followed by dfs > the other way). > > OK to install? OK. > Richard > > > gcc/ > *

Re: [PATCH] Allow space in git commit-mklog args

2022-07-22 Thread Jonathan Wakely via Gcc-patches
On Fri, 22 Jul 2022 at 10:38, Martin Liška wrote: > > Hi. > > Motivation example: > $ git commit-mklog -a -b 'PR other/106370,PR other/12345' > > Preserving a space from git gcc-mklog hook to contrib/mklog.py seems > pretty challenging. Thus I recommend preserving extra mklog args via > env where

[Patch] OpenMP requires: Fix diagnostic filename corner case

2022-07-22 Thread Tobias Burnus
This patch addresses a corner case which causes a filename confusion: lto1: error: OpenMP 'requires' directive with 'unified_address' specified only in some compilation units lto1: note: '1.c' has 'unified_address' lto1: note: but '1.c' has not lto1: fatal error: errors during merging of

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

2022-07-22 Thread Andrea Corallo via Gcc-patches
Hi Richard, thanks for reviewing. Richard Earnshaw writes: [...] > diff --git a/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-10.c > b/gcc/testsuite/gcc.target/arm/acle/pacbti-m-predef-10.c > new file mode 100644 > index 000..311cf572dd9 > --- /dev/null > +++

[PATCH] graphds: Fix description of SCC algorithm

2022-07-22 Thread Richard Sandiford via Gcc-patches
graphds_scc says that it uses Tarjan's algorithm, but it looks like it uses Kosaraju's algorithm instead (dfs one way followed by dfs the other way). OK to install? Richard gcc/ * graphds.cc (graphds_scc): Fix algorithm attribution. --- gcc/graphds.cc | 2 +- 1 file changed, 1

[patch] libgomp/splay-tree.h: Fix splay_tree_prefix handling

2022-07-22 Thread Tobias Burnus
As is, it is only a cleanup/consistency patch. However, I did run into this issue when working on the reverse-offload implementation (to handle reverse lookups of vars and functions). OK for mainline? Tobias - Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße

[PATCH][pushed] mklog: fill-up subject prefix only for a single PR

2022-07-22 Thread Martin Liška
I've just pushed this one. Martin contrib/ChangeLog: * mklog.py: Use component: [PR xyz] only when one PR is used. --- contrib/mklog.py | 21 + 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/contrib/mklog.py b/contrib/mklog.py index

[PATCH] Allow space in git commit-mklog args

2022-07-22 Thread Martin Liška
Hi. Motivation example: $ git commit-mklog -a -b 'PR other/106370,PR other/12345' Preserving a space from git gcc-mklog hook to contrib/mklog.py seems pretty challenging. Thus I recommend preserving extra mklog args via env where it's encoded in JSON format. Thoughts? Thanks, Martin

Re: [PATCH] libsanitizer: Fix Solaris 11.3 compilation [PR105531]

2022-07-22 Thread Richard Biener via Gcc-patches
On Fri, Jul 22, 2022 at 11:29 AM Rainer Orth wrote: > > The libsanitizer build has been broken on Solaris 11.3 by the latest > import. An upstream patch to fix this has now been committed: > > [sanitizer_common] Support Solaris < 11.4 in GetStaticTlsBoundary >

[PATCH] libsanitizer: Fix Solaris 11.3 compilation [PR105531]

2022-07-22 Thread Rainer Orth
The libsanitizer build has been broken on Solaris 11.3 by the latest import. An upstream patch to fix this has now been committed: [sanitizer_common] Support Solaris < 11.4 in GetStaticTlsBoundary https://reviews.llvm.org/D120059 I'd like to cherry-pick it into libsanitizer,

[PATCH] tree-optimization/106397 - array prefetch and LC SSA

2022-07-22 Thread Richard Biener via Gcc-patches
The following fixes maintaining LC SSA when array prefetch inserts mfence instructions on loop exits that do not use memory. It also fixes the latent issue that it might split exit edges for this which will break LC SSA for non-virtuals as well. It should also make the process cheaper by

[PATCH] tree-optimization/106403 - fix ICE with VN of .STORE_LANES

2022-07-22 Thread Richard Biener via Gcc-patches
While .STORE_LANES is not supported by the recent VN patch we were still accessing the stored value and valueizing it - but internal_fn_stored_value_index does not support .STORE_LANES and we failed to honor that case. Fixed by simply moving the affected code below the check for the actual

[PATCH] tree-optimization/106387 - properly create SSA name for realigned load

2022-07-22 Thread Richard Biener via Gcc-patches
The following fixes an oversight triggering after the recent change to bump_vector_ptr. Bootstrapped on x86_64-unknown-linux-gnu, pushed. PR tree-optimization/106387 * tree-vect-stmts.cc (vectorizable_load): Use make_ssa_name if ptr is not an SSA name. ---

[PATCH][pushed] remove 'continue' as last statement in loop

2022-07-22 Thread Martin Liška
PR other/106370 gcc/cp/ChangeLog: * init.cc (sort_mem_initializers): Remove continue as last stmt in a loop. libiberty/ChangeLog: * _doprnt.c: Remove continue as last stmt in a loop. --- gcc/cp/init.cc | 1 - libiberty/_doprnt.c | 1 - 2 files

[PATCH v3] Modify combine pattern by a pseudo AND with its nonzero bits [PR93453]

2022-07-22 Thread HAO CHEN GUI via Gcc-patches
Hi, This patch creates a new function - change_pseudo_and_mask. If recog fails, the function converts a single pseudo to the pseudo AND with a mask if the outer operator is IOR/XOR/PLUS and inner operator is ASHIFT or AND. The conversion helps pattern to match rotate and mask insn on some