Re: [RFC][Patch][middle-end/PR102359]Not add initialization for READONLY variables with -ftrivial-auto-var-init

2021-09-29 Thread Richard Biener via Gcc-patches
On Thu, 30 Sep 2021, Jason Merrill wrote: > On 9/29/21 17:30, Qing Zhao wrote: > > Hi, > > > > PR102359 (ICE gimplification failed since r12-3433-ga25e0b5e6ac8a77a) > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102359 > > > > Is due to -ftrivial-auto-var-init adding initialization for READON

[PING^3] Generalize 'gcc/input.h:struct location_hash' (was: [Committed] [PATCH 2/4] (v4) On-demand locations within string-literals)

2021-09-29 Thread Thomas Schwinge
Hi! On 2021-09-17T13:16:14+0200, I wrote: > On 2021-09-10T09:48:56+0200, I wrote: >> Ping. My patches again attached, for easy reference. > > Ping once again. Jeff had ACKed "Don't record string concatenation data for 'RESERVED_LOCATION_P'" (thanks!), but "Generalize 'gcc/input.h:struct location

[ping] Make sure that we get unique test names if several DejaGnu directives refer to the same line (was: [committed] Make test names unique for a couple of goacc tests)

2021-09-29 Thread Thomas Schwinge
Hi! Ping. On 2021-09-22T13:03:46+0200, I wrote: > 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. ;-| > >> This causes problems >> for the test compariso

Re: [PATCH 5/7]middle-end Convert bitclear + cmp #0 into cm

2021-09-29 Thread Richard Biener via Gcc-patches
On Wed, 29 Sep 2021, Tamar Christina wrote: > Hi All, > > This optimizes the case where a mask Y which fulfills ~Y + 1 == pow2 is used > to > clear a some bits and then compared against 0 into one without the masking and > a compare against a different bit immediate. > > We can do this for all

[PATCH] Plug possible snprintf overflow in lto-wrapper.

2021-09-29 Thread Aldy Hernandez via Gcc-patches
My upcoming improvements to the DOM threader triggered a warning in this code. It looks like the format string is ".ltrans%u.ltrans", but we're only writing a max of ".ltrans" + whatever the MAX_INT is here. Tested on x86-64 Linux. OK? gcc/ChangeLog: * lto-wrapper.c (run_gcc): Plug snp

[COMMITTED] Add gimple_ranger::debug.

2021-09-29 Thread Aldy Hernandez via Gcc-patches
I'm trying to add one debug() for each dump() to the dumping aids. Tested on x86-64 Linux. gcc/ChangeLog: * gimple-range.cc (gimple_ranger::debug): New. * gimple-range.h (class gimple_ranger): Add debug. --- gcc/gimple-range.cc | 6 ++ gcc/gimple-range.h | 1 + 2 files chan

[COMMITTED] Plug memory leak in hybrid_threader.

2021-09-29 Thread Aldy Hernandez via Gcc-patches
Pre-approved by Jeff. Tested on x86-64 Linux. gcc/ChangeLog: PR middle-end/102519 * tree-vrp.c (hybrid_threader::~hybrid_threader): Free m_query. --- gcc/tree-vrp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 69a3ab0ea9d..c24c67f8874

Re: [RFC][Patch][middle-end/PR102359]Not add initialization for READONLY variables with -ftrivial-auto-var-init

2021-09-29 Thread Jason Merrill via Gcc-patches
On 9/29/21 17:30, Qing Zhao wrote: Hi, PR102359 (ICE gimplification failed since r12-3433-ga25e0b5e6ac8a77a) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102359 Is due to -ftrivial-auto-var-init adding initialization for READONLY variable “this” in the following routine: (t.cpp.005t.original)

PING: [PATCH/RFC 2/2] WPD: Enable whole program devirtualization at LTRANS

2021-09-29 Thread Feng Xue OS via Gcc-patches
Made some minor changes. Thanks, Feng From: Feng Xue OS Sent: Thursday, September 16, 2021 5:26 PM To: Jan Hubicka; mjam...@suse.cz; Richard Biener; gcc-patches@gcc.gnu.org Cc: JiangNing OS Subject: [PATCH/RFC 2/2] WPD: Enable whole program devirtualizatio

PING: [PATCH/RFC 1/2] WPD: Enable whole program devirtualization

2021-09-29 Thread Feng Xue OS via Gcc-patches
Minor update for some bugfixs and comment wording change. Thanks, Feng From: Feng Xue OS Sent: Saturday, September 18, 2021 5:38 PM To: Jason Merrill; Jan Hubicka; mjam...@suse.cz; Richard Biener; gcc-patches@gcc.gnu.org Subject: Re: [PATCH/RFC 1/2] WPD:

Re: [PATCH] rs6000: Remove builtin mask check from builtin_decl [PR102347]

2021-09-29 Thread Kewen.Lin via Gcc-patches
Hi Bill, on 2021/9/29 下午7:59, Bill Schmidt wrote: > Hi Kewen, > > On 9/28/21 9:34 PM, Kewen.Lin wrote: >> Hi Bill, >> >> Thanks for your prompt comments! >> >> on 2021/9/29 上午3:24, Bill Schmidt wrote: >>> Hi Kewen, >>> >>> Although I agree that what we do now is tragically bad (and will be fixed

[PATCH] libiberty: d-demangle: use switch instead of if-else

2021-09-29 Thread Luís Ferreira
This patch allows the compiler to efficiently generate jump tables instead of using if-else-if. Signed-off-by: Luís Ferreira --- libiberty/d-demangle.c | 44 +++--- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/libiberty/d-demangle.c b/libibe

[PATCH] libiberty: testsuite: add missing format on d-demangle-expected

2021-09-29 Thread Luís Ferreira
This patch adds a missing format parameter that prevents d-demangle-expected test collection from running successfully. Signed-off-by: Luís Ferreira --- libiberty/testsuite/d-demangle-expected | 1 + 1 file changed, 1 insertion(+) diff --git a/libiberty/testsuite/d-demangle-expected b/libibert

Re: [PATCH] Improve jump threading dump output.

2021-09-29 Thread Jeff Law via Gcc-patches
On 9/29/2021 2:53 AM, Richard Biener wrote: On Tue, Sep 28, 2021 at 6:13 PM Aldy Hernandez wrote: On 9/28/21 6:05 PM, Richard Biener wrote: On September 28, 2021 5:45:52 PM GMT+02:00, Jeff Law via Gcc-patches wrote: On 9/28/2021 7:53 AM, Aldy Hernandez wrote: On 9/28/21 3:47 PM, Jef

[PATCH] libiberty: d-demangle: rename function symbols to be more consistent

2021-09-29 Thread Luís Ferreira
There is some function names with `dlang_parse_` prefix and some with only `dlang_` prefix that does parsing. The same happens with `dlang_decode_`. To make things a bit more consistent and easier to understand, this patch adds the missing prefix, according to the functions signatures. Signed-off

[RFC][Patch][middle-end/PR102359]Not add initialization for READONLY variables with -ftrivial-auto-var-init

2021-09-29 Thread Qing Zhao via Gcc-patches
Hi, PR102359 (ICE gimplification failed since r12-3433-ga25e0b5e6ac8a77a) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102359 Is due to -ftrivial-auto-var-init adding initialization for READONLY variable “this” in the following routine: (t.cpp.005t.original) === ;; Function A::foo():: (nu

[r12-3958 Regression] FAIL: gcc.dg/torture/pr65270-2.c -O3 -g execution test on Linux/x86_64

2021-09-29 Thread sunil.k.pandey via Gcc-patches
On Linux/x86_64, 4c7731081647c22cbd249dc0faa20c3df9ed6411 is the first bad commit commit 4c7731081647c22cbd249dc0faa20c3df9ed6411 Author: Richard Biener Date: Wed Sep 29 11:18:23 2021 +0200 Fix peeling for alignment with negative step caused FAIL: gcc.dg/torture/pr65270-1.c -O3 -fomit-

[PING] rs600 built-in series

2021-09-29 Thread Bill Schmidt via Gcc-patches
Hi Segher, Might as well ping this before I go on vacation.  :-)  I think we're up to 06/18: https://gcc.gnu.org/pipermail/gcc-patches/2021-September/578604.html Thanks!! Bill

*PING 2* [PATCH] doc: improve -fsanitize=undefined description

2021-09-29 Thread Diane Meirowitz via Gcc-patches
Please review my patch. It is tiny. Thank you. Diane On 9/15/21, 5:02 PM, "Diane Meirowitz" wrote: doc: improve -fsanitize=undefined description gcc/ChangeLog: * doc/invoke.texi: add link to UndefinedBehaviorSanitizer documentation,

Re: [Patch] Fortran: Avoid var initialization in interfaces [PR54753]

2021-09-29 Thread Harald Anlauf via Gcc-patches
Hi Tobias, Am 29.09.21 um 10:53 schrieb Tobias Burnus: Found when looking at F2018:C839 / PR54753. For INTENT(OUT) the dummy variable (might) also be default initialized or deallocated. However, with assumed rank, that causes issues, which C839 prevents. In the current GCC implementation, missi

[committed] MAINTAINERS: Add myself to DCO section

2021-09-29 Thread Jonathan Wakely via Gcc-patches
ChangeLog: * MAINTAINERS: Add myself to DCO section. Committed to trunk. commit cd5448f6c534c0d386f6b561ab903ffd5d3884b2 Author: Jonathan Wakely Date: Wed Sep 29 21:00:30 2021 MAINTAINERS: Add myself to DCO section ChangeLog: * MAINTAINERS: Add myself to

Re: [PATCH, v2] c++: Fix up synthetization of defaulted comparison operators on classes with bitfields [PR102490]

2021-09-29 Thread Jason Merrill via Gcc-patches
On 9/29/21 15:21, Jakub Jelinek wrote: On Wed, Sep 29, 2021 at 02:14:36PM -0400, Jason Merrill wrote: On 9/28/21 16:34, Jakub Jelinek wrote: On Tue, Sep 28, 2021 at 03:33:35PM -0400, Jason Merrill wrote: According to the function comment for defaulted_late_check, won't COMPLETE_TYPE_P (ctx) al

Re: [PATCH, v2] c++: Fix up synthetization of defaulted comparison operators on classes with bitfields [PR102490]

2021-09-29 Thread Jakub Jelinek via Gcc-patches
On Wed, Sep 29, 2021 at 02:14:36PM -0400, Jason Merrill wrote: > On 9/28/21 16:34, Jakub Jelinek wrote: > > On Tue, Sep 28, 2021 at 03:33:35PM -0400, Jason Merrill wrote: > > > > > According to the function comment for defaulted_late_check, won't > > > > > COMPLETE_TYPE_P (ctx) always be false here

[PATCH, part 2] PR 102458 - issues with simplification of SIZE intrinsic applied to automatic arrays

2021-09-29 Thread Harald Anlauf via Gcc-patches
Dear Fortranners, I think I have solved the remaining issue in PR 102458 that prevented the simplification of an expression involving a static initialization and the evaluation of the SIZE of an automatic array which has provable constant size. My previous related query to the ML has thus become

Re: [PATCH] libstdc++: Clear padding bits in atomic compare_exchange

2021-09-29 Thread Jakub Jelinek via Gcc-patches
On Wed, Sep 29, 2021 at 11:22:29AM -0700, Thomas Rodgers via Gcc-patches wrote: > > The MSVC implementation uses !__has_unique_object_representations(_Tp) > > && !is_floating_point<_Tp>::value here, which is better than mine > > above (FP types don't have unique object reps, but also don't have > >

Re: [PATCH] libstdc++: Clear padding bits in atomic compare_exchange

2021-09-29 Thread Thomas Rodgers via Gcc-patches
On Wed, Sep 29, 2021 at 5:14 AM Jonathan Wakely wrote: > On Mon, 27 Sept 2021 at 15:11, Thomas Rodgers > wrote: > > > > From: Thomas Rodgers > > > > Now with checks for __has_builtin(__builtin_clear_padding) > > > > This change implements P0528 which requires that padding bits not > > participa

Re: [PATCH, v2] c++: Fix up synthetization of defaulted comparison operators on classes with bitfields [PR102490]

2021-09-29 Thread Jason Merrill via Gcc-patches
On 9/28/21 16:34, Jakub Jelinek wrote: On Tue, Sep 28, 2021 at 03:33:35PM -0400, Jason Merrill wrote: According to the function comment for defaulted_late_check, won't COMPLETE_TYPE_P (ctx) always be false here? Not for a function defaulted outside the class. If so, I wonder if we could get

Re: [patch][gcc12-changes] Add a new item about the support for automatic static variable initialization

2021-09-29 Thread Kees Cook via Gcc-patches
On Wed, Sep 29, 2021 at 02:43:35PM +, Qing Zhao wrote: > FYI, just committed the change: > > https://gcc.gnu.org/gcc-12/changes.html Looks great to me; thanks! :) -Kees -- Kees Cook

Re: [PATCH] Use a separate TV_* timer for the VRP threader.

2021-09-29 Thread Jeff Law via Gcc-patches
On 9/29/2021 10:30 AM, Aldy Hernandez wrote: On Wed, Sep 29, 2021 at 5:31 PM Jeff Law wrote: On 9/29/2021 9:26 AM, Aldy Hernandez wrote: There seems to be a memory consumption issue on 32 bit hosts after the hybrid threader patchset. I'm having a hard time reproducing, and in the process

Re: [PATCH] Use a separate TV_* timer for the VRP threader.

2021-09-29 Thread Aldy Hernandez via Gcc-patches
On Wed, Sep 29, 2021 at 5:31 PM Jeff Law wrote: > > > > On 9/29/2021 9:26 AM, Aldy Hernandez wrote: > > There seems to be a memory consumption issue on 32 bit hosts after the > > hybrid threader patchset. I'm having a hard time reproducing, and in > > the process I've noticed that the threader is

[PATCH] libiberty: d-demangle: remove parenthesis where it is not needed

2021-09-29 Thread Luís Ferreira
Those parenthesis doesn't increase readability at all and this patch makes the source code a bit more consistent with the rest of the dereferencing assignments. Signed-off-by: Luís Ferreira --- libiberty/d-demangle.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git

[PATCH 7/7]AArch64 Combine cmeq 0 + not into cmtst

2021-09-29 Thread Tamar Christina via Gcc-patches
Hi All, This turns a bitwise inverse of an equality comparison with 0 into a compare of bitwise nonzero (cmtst). We already have one pattern for cmsts, this adds an additional one which does not require an additional bitwise and. i.e. #include uint8x8_t bar(int16x8_t abs_row0, int16x8_t row0)

[PATCH 6/7]AArch64 Add neg + cmle into cmgt

2021-09-29 Thread Tamar Christina via Gcc-patches
Hi All, This turns an inversion of the sign bit + arithmetic right shift into a comparison with 0. i.e. void fun1(int32_t *x, int n) { for (int i = 0; i < (n & -16); i++) x[i] = (-x[i]) >> 31; } now generates: .L3: ldr q0, [x0] cmgtv0.4s, v0.4s, #0 str

[PATCH 5/7]middle-end Convert bitclear + cmp #0 into cm

2021-09-29 Thread Tamar Christina via Gcc-patches
Hi All, This optimizes the case where a mask Y which fulfills ~Y + 1 == pow2 is used to clear a some bits and then compared against 0 into one without the masking and a compare against a different bit immediate. We can do this for all unsigned compares and for signed we can do it for comparisons

[PATCH 4/7]AArch64 Add pattern xtn+xtn2 to uzp2

2021-09-29 Thread Tamar Christina via Gcc-patches
Hi All, This turns truncate operations with a hi/lo pair into a single permute of half the bit size of the input and just ignoring the top bits (which are truncated out). i.e. void d2 (short * restrict a, int *b, int n) { for (int i = 0; i < n; i++) a[i] = b[i]; } now generates: .L4:

[PATCH 3/7]AArch64 Add pattern for sshr to cmlt

2021-09-29 Thread Tamar Christina via Gcc-patches
Hi All, This optimizes signed right shift by BITSIZE-1 into a cmlt operation which is more optimal because generally compares have a higher throughput than shifts. On AArch64 the result of the shift would have been either -1 or 0 which is the results of the compare. i.e. void e (int * restrict

[PATCH 2/7]AArch64 Add combine patterns for narrowing shift of half top bits (shuffle)

2021-09-29 Thread Tamar Christina via Gcc-patches
Hi All, When doing a (narrowing) right shift by half the width of the original type then we are essentially shuffling the top bits from the first number down. If we have a hi/lo pair we can just use a single shuffle instead of needing two shifts. i.e. typedef short int16_t; typedef unsigned sho

[PATCH 1/7]AArch64 Add combine patterns for right shift and narrow

2021-09-29 Thread Tamar Christina via Gcc-patches
Hi All, This adds a simple pattern for combining right shifts and narrows into shifted narrows. i.e. typedef short int16_t; typedef unsigned short uint16_t; void foo (uint16_t * restrict a, int16_t * restrict d, int n) { for( int i = 0; i < n; i++ ) d[i] = (a[i] * a[i]) >> 10; } now

[PATCH 0/7]AArch64 Optimize truncation, shifts and bitmask comparisons

2021-09-29 Thread Tamar Christina via Gcc-patches
Hi All, This patch series is optimizing AArch64 codegen for narrowing operations, shift and narrow, and some comparisons with bitmasks. There are more to come but this is the first batch. This series shows a 2% gain on x264 in SPECCPU2017 and 0.05% size reduction and shows 5-10% perf gain on var

Re: [PATCH] Loop unswitching: support gswitch statements.

2021-09-29 Thread Andrew MacLeod via Gcc-patches
On 9/29/21 11:28 AM, Jeff Law wrote: On 9/29/2021 9:20 AM, Andrew MacLeod via Gcc-patches wrote: On 9/29/21 4:43 AM, Richard Biener wrote: On Tue, Sep 28, 2021 at 10:39 PM Andrew MacLeod wrote: On 9/28/21 7:50 AM, Richard Biener wrote: On Wed, Sep 15, 2021 at 10:46 AM Martin Liška wrote:

Re: [PATCH] ctf: Do not warn for CTF not supported for GNU GIMPLE

2021-09-29 Thread Indu Bhagat via Gcc-patches
On 9/29/21 12:14 AM, Richard Biener wrote: On Tue, Sep 28, 2021 at 8:52 PM Indu Bhagat via Gcc-patches wrote: CTF is supported for C only. Currently, a warning is emitted if the -gctf command line option is specified for a non-C frontend. This warning is also used by the GCC testsuite framew

Re: [PATCH] Replace VRP threader with a hybrid forward threader.

2021-09-29 Thread Jeff Law via Gcc-patches
On 9/29/2021 3:20 AM, Bernhard Reutner-Fischer wrote: On Wed, 29 Sep 2021 10:10:00 +0200 Aldy Hernandez wrote: Jeff has requested we slow down changes in the threading space while we chased down regressions. Sure. Take your time. That being said, thank you for your suggestion. I am putti

Re: [PATCH v2] libgcc: Add a backchain fallback to _Unwind_Backtrace() on PowerPC

2021-09-29 Thread Segher Boessenkool
On Wed, Sep 29, 2021 at 11:14:55AM -0300, Raphael M Zinsly wrote: > On 28/09/2021 16:50, Segher Boessenkool wrote: > >>+/* { dg-do run { target { powerpc*-*-linux* } } } */ > > > >Don't say such targets in gcc.target/powerpc/ tests please. Everything > >in gcc.target is for powerpc*-*-* already, s

[PATCH] libiberty: d-demangle: use appendc for single chars append

2021-09-29 Thread Luís Ferreira
This may be optimized by some modern smart compilers inliner, but since strlen can be an external source, this can produce unoptimized code. Signed-off-by: Luís Ferreira --- libiberty/d-demangle.c | 60 -- 1 file changed, 34 insertions(+), 26 deletions(-)

Re: [PATCH] Use a separate TV_* timer for the VRP threader.

2021-09-29 Thread Jeff Law via Gcc-patches
On 9/29/2021 9:26 AM, Aldy Hernandez wrote: There seems to be a memory consumption issue on 32 bit hosts after the hybrid threader patchset. I'm having a hard time reproducing, and in the process I've noticed that the threader is using the TV_TREE_VRP timer. Having a distinct one could help

Re: [PATCH] Loop unswitching: support gswitch statements.

2021-09-29 Thread Jeff Law via Gcc-patches
On 9/29/2021 9:20 AM, Andrew MacLeod via Gcc-patches wrote: On 9/29/21 4:43 AM, Richard Biener wrote: On Tue, Sep 28, 2021 at 10:39 PM Andrew MacLeod wrote: On 9/28/21 7:50 AM, Richard Biener wrote: On Wed, Sep 15, 2021 at 10:46 AM Martin Liška wrote:     /* Unswitch single LOOP.  NUM is

[PATCH] Use a separate TV_* timer for the VRP threader.

2021-09-29 Thread Aldy Hernandez via Gcc-patches
There seems to be a memory consumption issue on 32 bit hosts after the hybrid threader patchset. I'm having a hard time reproducing, and in the process I've noticed that the threader is using the TV_TREE_VRP timer. Having a distinct one could help diagnose this and other issues going forward. Je

[PATCH #2] Introduce smul_highpart and umul_highpart RTX for high-part multiplications

2021-09-29 Thread Roger Sayle
Hi Richard, All excellent suggestions. The revised patch below implements all of your (and Andreas') recommendations. I'm happy to restrict GCC's support for saturating arithmetic to integer types, even though I do know of one target (nvptx) that supports saturating floating point math, where r

[PATCH committed] Fix more testsuite fallout from computed goto changes

2021-09-29 Thread Jeff Law via Gcc-patches
Not sure why these weren't caught in Andrew's testing or subsequent fixes, but they're falling across the board in the tester. Committed to the trunk. Jeff commit 86304da55ff5c03d16e386f525682ff6cc1fbe62 Author: Jeff Law Date: Wed Sep 29 11:21:42 2021 -0400 Fix more testsuite fallout fr

Re: [PATCH] Loop unswitching: support gswitch statements.

2021-09-29 Thread Andrew MacLeod via Gcc-patches
On 9/29/21 4:43 AM, Richard Biener wrote: On Tue, Sep 28, 2021 at 10:39 PM Andrew MacLeod wrote: On 9/28/21 7:50 AM, Richard Biener wrote: On Wed, Sep 15, 2021 at 10:46 AM Martin Liška wrote: /* Unswitch single LOOP. NUM is number of unswitchings done; we do not allow @@ -269,6 +311,7

Re: [patch][gcc12-changes] Add a new item about the support for automatic static variable initialization

2021-09-29 Thread Qing Zhao via Gcc-patches
FYI, just committed the change: https://gcc.gnu.org/gcc-12/changes.html Qing > On Sep 29, 2021, at 9:18 AM, Qing Zhao via Gcc-patches > wrote: > > > >> On Sep 29, 2021, at 5:39 AM, Richard Biener wrote: >> >> On Tue, 28 Sep 2021, Kees Cook wrote: >> >>> On Tue, Sep 28, 2021 at 08:31:13PM

Re: [patch][gcc12-changes] Add a new item about the support for automatic static variable initialization

2021-09-29 Thread Martin Sebor via Gcc-patches
On 9/28/21 2:31 PM, Qing Zhao via Gcc-patches wrote: Hi, This is the patch for the gcc12 changes per your request. Kees provided most of the wording. Please take a look and let’s know whether it’s good for commit? thanks. Qing From: qing z

Re: [patch][gcc12-changes] Add a new item about the support for automatic static variable initialization

2021-09-29 Thread Qing Zhao via Gcc-patches
> On Sep 29, 2021, at 5:39 AM, Richard Biener wrote: > > On Tue, 28 Sep 2021, Kees Cook wrote: > >> On Tue, Sep 28, 2021 at 08:31:13PM +, Qing Zhao wrote: >>> Hi, >>> >>> This is the patch for the gcc12 changes per your request. >>> >>> Kees provided most of the wording. >>> >>> Plea

Re: [PATCH v2] libgcc: Add a backchain fallback to _Unwind_Backtrace() on PowerPC

2021-09-29 Thread Raphael M Zinsly via Gcc-patches
On 28/09/2021 16:50, Segher Boessenkool wrote: Hi! On Thu, Aug 26, 2021 at 11:53:24AM -0300, Raphael Moreira Zinsly wrote: Without dwarf2 unwind tables available _Unwind_Backtrace() is not able to return the full backtrace. This patch adds a fallback function on powerpc to get the backtrace b

Re: [patch][gcc12-changes] Add a new item about the support for automatic static variable initialization

2021-09-29 Thread Qing Zhao via Gcc-patches
> On Sep 28, 2021, at 3:39 PM, Kees Cook wrote: > > On Tue, Sep 28, 2021 at 08:31:13PM +, Qing Zhao wrote: >> Hi, >> >> This is the patch for the gcc12 changes per your request. >> >> Kees provided most of the wording. >> >> Please take a look and let’s know whether it’s good for comm

Re: [PATCH] c: [PR32122] Require pointer types for computed gotos

2021-09-29 Thread Jeff Law via Gcc-patches
On 9/29/2021 2:08 AM, Andrew Pinski wrote: On Wed, Sep 29, 2021 at 1:06 AM Jakub Jelinek via Gcc-patches wrote: On Mon, Sep 20, 2021 at 09:41:03AM -0600, Jeff Law via Gcc-patches wrote: On 9/19/2021 10:14 PM, apinski--- via Gcc-patches wrote: From: Andrew Pinski So GCC has always accept

Re: [PATCH] c: [PR32122] Require pointer types for computed gotos

2021-09-29 Thread Jeff Law via Gcc-patches
On 9/29/2021 2:05 AM, Jakub Jelinek wrote: On Mon, Sep 20, 2021 at 09:41:03AM -0600, Jeff Law via Gcc-patches wrote: On 9/19/2021 10:14 PM, apinski--- via Gcc-patches wrote: From: Andrew Pinski So GCC has always accepted non-pointer types in computed gotos but that was wrong based on the

[committed] libstdc++: Implement std::regex_constants::multiline (LWG 2503)

2021-09-29 Thread Jonathan Wakely via Gcc-patches
This implements LWG 2503, which allows ^ and $ to match line terminator characters, rather than only matching the beginning and end of the entire input. The multiline option is only valid for ECMAScript, but for other grammars we ignore it rather than throwing an exception. This is related to PR l

[committed] libstdc++: Check for invalid syntax_option_type values in

2021-09-29 Thread Jonathan Wakely via Gcc-patches
The standard says that it is invalid for more than one grammar element to be set in a value of type regex_constants::syntax_option_type. This adds a check in the regex compiler andthrows an exception if an invalid value is used. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * i

[committed] libstdc++: std::basic_regex should treat '\0' as an ordinary char [PR84110]

2021-09-29 Thread Jonathan Wakely via Gcc-patches
When the input sequence contains a _CharT(0) character, the strchr call in _Scanner<_CharT>::_M_scan_normal() will search for '\0' and so return a pointer to the terminating null at the end of the string. This makes the scanner think it's found a special character. Because it doesn't match any of t

[committed] libstdc++: Simplify std::basic_regex construction and assignment

2021-09-29 Thread Jonathan Wakely via Gcc-patches
Introduce a new _M_compile function which does the common work needed by all constructors and assignment. Call that directly to avoid multiple levels of constructor delegation or calls to basic_regex::assign overloads. For assignment, there is no need to construct a std::basic_string if we already

[PATCH] testsuite/102517 - fix FAIL of gcc.dg/pr78408-1.c with OImode availability

2021-09-29 Thread Richard Biener via Gcc-patches
This fixes the testcase which looks for variants of memcpy after memset folding which is disturbed when we expand the memcpy inline earlier which in fact performs the desired optimization but makes the dump file not match. For the ease of testing the following adjusts the smaller structure size to

Re: [PATCH] libstdc++: Clear padding bits in atomic compare_exchange

2021-09-29 Thread Jakub Jelinek via Gcc-patches
On Wed, Sep 29, 2021 at 01:13:46PM +0100, Jonathan Wakely via Gcc-patches wrote: > But I think that's OK, as I think the built-in is > smart enough to be a no-op for types with no padding. Yes. The only effect it will have is that during the initial optimization passes the variable/parameter will

Re: [PATCH] libstdc++: Clear padding bits in atomic compare_exchange

2021-09-29 Thread Jonathan Wakely via Gcc-patches
On Wed, 29 Sept 2021 at 13:13, Jonathan Wakely wrote: > We repeat this *a lot*. When I started work on this I defined a > non-member function in the __atomic_impl namespace: I've attached my incomplete patch from when I was working on this. diff --cc libstdc++-v3/include/bits/atomic_base.h index 7

Re: [PATCH] libstdc++: Clear padding bits in atomic compare_exchange

2021-09-29 Thread Jonathan Wakely via Gcc-patches
On Mon, 27 Sept 2021 at 15:11, Thomas Rodgers wrote: > > From: Thomas Rodgers > > Now with checks for __has_builtin(__builtin_clear_padding) > > This change implements P0528 which requires that padding bits not > participate in atomic compare exchange operations. All arguments to the > generic te

Re: [PATCH] rs6000: Remove builtin mask check from builtin_decl [PR102347]

2021-09-29 Thread Bill Schmidt via Gcc-patches
Hi Kewen, On 9/28/21 9:34 PM, Kewen.Lin wrote: > Hi Bill, > > Thanks for your prompt comments! > > on 2021/9/29 上午3:24, Bill Schmidt wrote: >> Hi Kewen, >> >> Although I agree that what we do now is tragically bad (and will be fixed in >> the builtin rewrite), this seems a little too cavalier to

[PATCH] Fix peeling for alignment with negative step

2021-09-29 Thread Richard Biener via Gcc-patches
The following fixes a regression causing us to no longer peel negative step loops for alignment. With dr_misalignment now applying the bias for negative step we have to do the reverse when adjusting the misalignment for peeled DRs. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. 202

Re: [patch][gcc12-changes] Add a new item about the support for automatic static variable initialization

2021-09-29 Thread Richard Biener via Gcc-patches
On Tue, 28 Sep 2021, Kees Cook wrote: > On Tue, Sep 28, 2021 at 08:31:13PM +, Qing Zhao wrote: > > Hi, > > > > This is the patch for the gcc12 changes per your request. > > > > Kees provided most of the wording. > > > > Please take a look and let’s know whether it’s good for commit? > >

[PATCH] aarch64: Improve size heuristic for cpymem expansion

2021-09-29 Thread Kyrylo Tkachov via Gcc-patches
Hi all, Similar to my previous patch for setmem this one does the same for the cpymem expansion. We count the number of ops emitted and compare it against the alternative of just calling the library function when optimising for size. For the code: void cpy_127 (char *out, char *in) { __builtin

[PATCH] aarch64: Improve size optimisation heuristic for setmem expansion

2021-09-29 Thread Kyrylo Tkachov via Gcc-patches
Hi all, This patch adjusts the setmem expansion in the backend to track the number of ops it generates for the DUP + STR/STP inline sequences. This way we can compare the size/complexity of the sequence against alternatives, notably just returning "false" and thus just emitting a call to memset

Re: [PATCH] Replace VRP threader with a hybrid forward threader.

2021-09-29 Thread Bernhard Reutner-Fischer via Gcc-patches
On Wed, 29 Sep 2021 10:10:00 +0200 Aldy Hernandez wrote: > Jeff has requested we slow down changes in the threading space while > we chased down regressions. Sure. Take your time. > > That being said, thank you for your suggestion. I am putting the > attached patch in my queue for testing. LG

Re: [PATCH] Improve jump threading dump output.

2021-09-29 Thread Richard Biener via Gcc-patches
On Tue, Sep 28, 2021 at 6:13 PM Aldy Hernandez wrote: > > > > On 9/28/21 6:05 PM, Richard Biener wrote: > > On September 28, 2021 5:45:52 PM GMT+02:00, Jeff Law via Gcc-patches > > wrote: > >> > >> > >> On 9/28/2021 7:53 AM, Aldy Hernandez wrote: > >>> > >>> > >>> On 9/28/21 3:47 PM, Jeff Law wr

[Patch] Fortran: Avoid var initialization in interfaces [PR54753]

2021-09-29 Thread Tobias Burnus
Found when looking at F2018:C839 / PR54753. For INTENT(OUT) the dummy variable (might) also be default initialized or deallocated. However, with assumed rank, that causes issues, which C839 prevents. In the current GCC implementation, missing C839 constraint diagnostic, but also rejects-valid/ice

Re: [PATCH] [www] Add note about computed gotos to changes and porting guide

2021-09-29 Thread Richard Biener via Gcc-patches
On Wed, Sep 29, 2021 at 10:16 AM apinski--- via Gcc-patches wrote: > > From: Andrew Pinski > > Even though there is not many computed gotos in the wild and even less > that would use an integer type, it would still be a good idea to add > this new error message to both changes and the porting to

Re: [PATCH] Loop unswitching: support gswitch statements.

2021-09-29 Thread Richard Biener via Gcc-patches
On Tue, Sep 28, 2021 at 10:39 PM Andrew MacLeod wrote: > > On 9/28/21 7:50 AM, Richard Biener wrote: > > On Wed, Sep 15, 2021 at 10:46 AM Martin Liška wrote: > >>/* Unswitch single LOOP. NUM is number of unswitchings done; we do not > >> allow > >> @@ -269,6 +311,7 @@ tree_unswitch_single_l

[PATCH] c++: Fix handling of __thread/thread_local extern vars declared at function scope [PR102496]

2021-09-29 Thread Jakub Jelinek via Gcc-patches
Hi! The introduction of push_local_extern_decl_alias in r11-3699-g4e62aca0e0520e4ed2532f2d8153581190621c1a broke tls vars, while the decl they are created for has the tls model set properly, nothing sets it for the alias that is actually used, so accesses to it are done as if they were normal vari

[PATCH, rs6000] punish reload of lfiwzx when loading an int variable [PR102169, PR102146]

2021-09-29 Thread HAO CHEN GUI via Gcc-patches
Hi,   The patch punishes reload of alternative pair of "d, Z" for movsi_internal1. The reload occurs if 'Z' doesn't match and generates an additional insn. So the memory reload should be punished.   Bootstrapped and tested on powerpc64le-linux with no regressions. Is this  okay for trunk? Any 

[committed] openmp: Disallow reduction with var private in containing parallel even on scope [PR102504]

2021-09-29 Thread Jakub Jelinek via Gcc-patches
Hi! The standard has a restriction: "A list item that appears in a reduction clause of a scope construct must be shared in the parallel region to which a corresponding scope region binds." similar to the restriction for worksharing constructs, but we were checking it only on worksharing constructs

[PATCH] [www] Add note about computed gotos to changes and porting guide

2021-09-29 Thread apinski--- via Gcc-patches
From: Andrew Pinski Even though there is not many computed gotos in the wild and even less that would use an integer type, it would still be a good idea to add this new error message to both changes and the porting to guide. OK? --- htdocs/gcc-12/changes.html| 6 ++-- htdocs/gcc-12/porting

Re: [PATCH] c: [PR32122] Require pointer types for computed gotos

2021-09-29 Thread Andrew Pinski via Gcc-patches
On Wed, Sep 29, 2021 at 1:06 AM Jakub Jelinek via Gcc-patches wrote: > > On Mon, Sep 20, 2021 at 09:41:03AM -0600, Jeff Law via Gcc-patches wrote: > > > > > > On 9/19/2021 10:14 PM, apinski--- via Gcc-patches wrote: > > > From: Andrew Pinski > > > > > > So GCC has always accepted non-pointer type

[COMMITTED] Fix some testcases after my computed goto patch

2021-09-29 Thread apinski--- via Gcc-patches
From: Andrew Pinski For some reason I did not see these failures in my testing. Sorry about that. Anyways this fixes the testcases by adding a cast to __INTPTR_TYPE__ and then a cast to void*. Committed after testing them on x86_64-linux-gnu. gcc/testsuite/ChangeLog: * gcc.c-torture/c

Re: [PATCH, v2] c++: Fix up synthetization of defaulted comparison operators on classes with bitfields [PR102490]

2021-09-29 Thread Jakub Jelinek via Gcc-patches
On Tue, Sep 28, 2021 at 10:34:39PM +0200, Jakub Jelinek via Gcc-patches wrote: > On Tue, Sep 28, 2021 at 03:33:35PM -0400, Jason Merrill wrote: > > > > According to the function comment for defaulted_late_check, won't > > > > COMPLETE_TYPE_P (ctx) always be false here? > > > > Not for a function d

Re: [PATCH] c: [PR32122] Require pointer types for computed gotos

2021-09-29 Thread Jakub Jelinek via Gcc-patches
On Mon, Sep 20, 2021 at 09:41:03AM -0600, Jeff Law via Gcc-patches wrote: > > > On 9/19/2021 10:14 PM, apinski--- via Gcc-patches wrote: > > From: Andrew Pinski > > > > So GCC has always accepted non-pointer types in computed gotos but > > that was wrong based on the documentation: > > Any expr

Re: [Patch] Fortran: Fix same_type_as

2021-09-29 Thread Tobias Burnus
Early ping ;-) – but actually I do want to explain some parts of my patch, what I forgot in my first patch email. Note that while "class(t)" is of declared type when unallocated/unassociated, "class(*)" is not. Thus, when unassociated/unallocated, "same_type_as(class_star, class_star)" is .false

Re: [PATCH] ctf: Do not warn for CTF not supported for GNU GIMPLE

2021-09-29 Thread Richard Biener via Gcc-patches
On Tue, Sep 28, 2021 at 8:52 PM Indu Bhagat via Gcc-patches wrote: > > CTF is supported for C only. Currently, a warning is emitted if the -gctf > command line option is specified for a non-C frontend. This warning is also > used by the GCC testsuite framework - it skips adding -gctf to the list

Re: [PATCH] debug/102507: ICE in btf_finalize when compiling with -gbtf

2021-09-29 Thread Richard Biener via Gcc-patches
On Tue, Sep 28, 2021 at 8:41 PM Indu Bhagat via Gcc-patches wrote: > > Fix the free'up of btf_var_ids hash_map in btf_finalize (). OK. > Testing notes: > > - Bootstrapped GCC with -gbtf as an experiment. > - Usual bootstrap and regression testing on x86_64. > - BPF backend testing - make all-gcc