[PATCH] i386: Fix wrong codegen for -mrelax-cmpxchg-loop

2021-11-17 Thread Hongyu Wang via Gcc-patches
Hi Uros, For -mrelax-cmpxchg-loop introduced by PR 103069/r12-5265, it would produce infinite loop. The correct code should be .L84: movl(%rdi), %ecx movl%eax, %edx orl %esi, %edx cmpl%eax, %ecx jne .L82 lock cmpxchgl %edx,

Re: [PATCH 4/4] Darwin, Ada : Add loader path as a default rpath.

2021-11-17 Thread Arnaud Charlet via Gcc-patches
> Allow the Ada runtimes to find GCC runtimes relative to their non- > standard install positions. > > gcc/ada/ > * gcc-interface/Makefile.in: Add @loader_path runpaths to the > libgnat and libgnarl shared library builds. OK, thanks.

[PATCH] Don't allow mask/sse/mmx mov in TLS code sequences.

2021-11-17 Thread liuhongt via Gcc-patches
As change in assembler, refer to [1], this patch disallow mask/sse/mmx mov in TLS code sequences which require integer MOV instructions. [1] https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h=d7e3e627027fcf37d63e284144fe27ff4eba36b5 Bootstrapped and regtested on

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

2021-11-17 Thread Andrew Pinski via Gcc-patches
On Wed, Nov 17, 2021 at 1:39 AM Richard Sandiford via Gcc-patches wrote: > > apinski--- via Gcc-patches writes: > > From: Andrew Pinski > > > > The problem here is with -mstrict-align, aarch64_expand_setmem needs > > to check the alginment of the mode to make sure we can use it for > > doing

[PATCH] Reduce cost of aligned sse register store.

2021-11-17 Thread liuhongt via Gcc-patches
Make them be equal to cost of unaligned ones to avoid odd alignment peeling. Impact for SPEC2017 on CLX: fprate: 503.bwaves_rBuildSame 507.cactuBSSN_r -0.22 508.namd_r -0.02 510.parest_r-0.28 511.povray_r-0.20 519.lbm_r BuildSame 521.wrf_r

Re: [PATCH] c++: template-id ADL and partial instantiation [PR99911]

2021-11-17 Thread Jason Merrill via Gcc-patches
On 11/10/21 11:53, Patrick Palka wrote: Here when partially instantiating the call get(T{}) with T=N::A (for which earlier unqualified name lookup for 'get' found nothing) the arguments after substitution are no longer dependent but the callee still is, so perform_koenig_lookup postpones ADL.

Re: [PATCH] c++: unqual lookup performed twice w/ template-id ADL [PR102670]

2021-11-17 Thread Jason Merrill via Gcc-patches
On 11/3/21 12:04, Patrick Palka wrote: Here we're incorrectly performing unqualified lookup of 'adl' again at substitution time for the call adl(t) (for which name lookup at parse time found nothing) which causes us to reject the testcase because the second unqualified lookup finds the

Re: [PATCH] c++: designated init of char array by string constant [PR55227]

2021-11-17 Thread will wray via Gcc-patches
V2 Patch https://gcc.gnu.org/bugzilla/attachment.cgi?id=51828 On Wed, Nov 17, 2021 at 10:06 PM will wray wrote: > > Thanks for the review Marek; > I'll post the updated patch in a follow-on message and on bugzilla. > > On Mon, Nov 15, 2021 at 8:03 PM Marek Polacek wrote: > > > I also noticed

Re: [PATCH] i386: add alias for f*mul_*ch intrinsics

2021-11-17 Thread Hongtao Liu via Gcc-patches
On Tue, Nov 16, 2021 at 4:35 PM Hongtao Liu wrote: > > On Tue, Nov 16, 2021 at 4:23 PM Kong, Lingling via Gcc-patches > wrote: > > > > Hi, > > > > This patch is to add alias for f*mul_*ch intrinsics. > > > > Ok for master? > This patch just adds some macro definitions (new aliases for >

Re: [PATCH] c++: designated init of char array by string constant [PR55227]

2021-11-17 Thread will wray via Gcc-patches
Thanks for the review Marek; I'll post the updated patch in a follow-on message and on bugzilla. On Mon, Nov 15, 2021 at 8:03 PM Marek Polacek wrote: > I also noticed the C++ FE rejects > > struct A { char x[4]; }; > struct B { struct A a; }; > struct B b = { .a.x = "abc" }; > but the C

Re: [PATCH] restore ancient -Waddress for weak symbols [PR33925]

2021-11-17 Thread Martin Sebor via Gcc-patches
On 11/17/21 12:21 PM, Martin Sebor wrote: On 11/17/21 11:31 AM, Jason Merrill wrote: On 11/16/21 20:11, Martin Sebor wrote: On 11/16/21 1:23 PM, Jason Merrill wrote: On 10/23/21 19:06, Martin Sebor wrote: On 10/4/21 3:37 PM, Jason Merrill wrote: On 10/4/21 14:42, Martin Sebor wrote: While

[PATCH] doc, d: Add note that D front end now requires GDC installed in order to bootstrap.

2021-11-17 Thread Iain Buclaw via Gcc-patches
Hi, As asked for, this adds the documentation note in install.texi about the upcoming bootstrap requirements. Obviously this will be applied alongside the patch posted previously: https://gcc.gnu.org/pipermail/gcc-patches/2021-October/582917.html Final batch of testing before proceeding has

[PATCH v2] Fix PR tree-optimization/103228 and 103228: folding of (type) X op CST where type is a nop convert

2021-11-17 Thread apinski--- via Gcc-patches
From: Andrew Pinski Currently we fold (type) X op CST into (type) (X op ((type-x) CST)) when the conversion widens but not when the conversion is a nop. For the same reason why we move the widening conversion (the possibility of removing an extra conversion), we should do the same if the

Re: [PATCH 3/4] Darwin : Allow for configuring Darwin to use embedded runpath.

2021-11-17 Thread Iain Sandoe via Gcc-patches
> On 17 Nov 2021, at 22:50, Joseph Myers wrote: > > On Wed, 17 Nov 2021, Iain Sandoe via Gcc-patches wrote: > >> * libtool.m4: Add 'enable-darwin-at-runpath'. Act on the >> enable flag to alter Darwin libraries to use @rpath names. > > To confirm: has this been sent to upstream

Re: [PATCH] rs6000: Builtins test changes for BFP scalar tests

2021-11-17 Thread Bill Schmidt via Gcc-patches
On 11/17/21 3:32 PM, Segher Boessenkool wrote: > On Wed, Nov 17, 2021 at 02:58:54PM -0600, Bill Schmidt wrote: >> Hi! This patch is broken out of the previous patch for all the builtins test >> suite adjustments. Here we have some slight changes in error messages due to >> how the internals

Re: [PATCH 2/2] libcpp: capture and underline ranges in -Wbidi-chars= [PR103026]

2021-11-17 Thread Marek Polacek via Gcc-patches
On Wed, Nov 17, 2021 at 05:45:15PM -0500, David Malcolm wrote: > This patch converts the bidi::vec to use a struct so that we can > capture location_t values for the bidirectional control characters. Thanks for these improvements. I noticed a few nits, but nothing that needs to be fixed

Re: [RFC] c++: Print function template parms when relevant (was: [PATCH v4] c++: Add gnu::diagnose_as attribute)

2021-11-17 Thread Matthias Kretz
On Wednesday, 17 November 2021 19:25:46 CET Jason Merrill wrote: > On 11/17/21 04:04, Matthias Kretz wrote: > > On Wednesday, 17 November 2021 07:09:18 CET Jason Merrill wrote: > >>> - if (CHECKING_P) > >>> -SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT (a, TREE_VEC_LENGTH (a)); > >>> +

Re: [PATCH 3/4] Darwin : Allow for configuring Darwin to use embedded runpath.

2021-11-17 Thread Joseph Myers
On Wed, 17 Nov 2021, Iain Sandoe via Gcc-patches wrote: > * libtool.m4: Add 'enable-darwin-at-runpath'. Act on the > enable flag to alter Darwin libraries to use @rpath names. To confirm: has this been sent to upstream libtool (which has recently acquired a new maintainer, so

[PATCH 2/2] libcpp: capture and underline ranges in -Wbidi-chars= [PR103026]

2021-11-17 Thread David Malcolm via Gcc-patches
This patch converts the bidi::vec to use a struct so that we can capture location_t values for the bidirectional control characters. Before: Wbidi-chars-1.c: In function ‘main’: Wbidi-chars-1.c:6:43: warning: unpaired UTF-8 bidirectional control character detected [-Wbidi-chars=] 6 |

[committed] libcpp: escape non-ASCII source bytes in -Wbidi-chars= [PR103026]

2021-11-17 Thread David Malcolm via Gcc-patches
This flags rich_locations associated with -Wbidi-chars= so that non-ASCII bytes will be escaped when printing the source lines (using the diagnostics support I added in r12-4825-gbd5e882cf6e0def3dd1bc106075d59a303fe0d1e). In particular, this ensures that the printed source lines will be pure

Re: [PATCH 2/6] Add returns_zero_on_success/failure attributes

2021-11-17 Thread Joseph Myers
On Wed, 17 Nov 2021, Prathamesh Kulkarni via Gcc-patches wrote: > More generally, would it be a good idea to provide attributes for > mod/ref anaylsis ? > So sth like: > void foo(void) __attribute__((modifies(errno))); > which would state that foo modifies errno, but neither reads nor > modifies

[PATCH v4] x86: Add -mharden-sls=[none|all|return|indirect-branch]

2021-11-17 Thread H.J. Lu via Gcc-patches
On Wed, Nov 17, 2021 at 12:09 PM Uros Bizjak wrote: > > On Wed, Nov 17, 2021 at 9:02 PM H.J. Lu wrote: > > > > On Wed, Nov 17, 2021 at 7:53 AM Uros Bizjak wrote: > > > > > > On Wed, Nov 17, 2021 at 4:35 PM H.J. Lu wrote: > > > > > > > > Add -mharden-sls= to mitigate against straight line

Re: [PATCH] rs6000: Builtins test changes for BFP scalar tests

2021-11-17 Thread Segher Boessenkool
On Wed, Nov 17, 2021 at 02:58:54PM -0600, Bill Schmidt wrote: > Hi! This patch is broken out of the previous patch for all the builtins test > suite adjustments. Here we have some slight changes in error messages due to > how the internals have changed between the old and new builtins methods. >

[PATCH] PR fortran/101329 - ICE: Invalid expression in gfc_element_size

2021-11-17 Thread Harald Anlauf via Gcc-patches
Dear Fortranners, as NULL() is not interoperable, we have to reject it. Confirmed by NAG. Other compilers show "interesting behavior". Obvious patch by Steve. Regtested on x86_64-pc-linux-gnu. OK for mainline? Thanks, Harald From 52a3ee53f0a12e897c4651fa8378e045653b9fd3 Mon Sep 17 00:00:00

Fix gamess miscompare

2021-11-17 Thread Jan Hubicka via Gcc-patches
Hi, this patch fixes bug in streaming in modref access tree that now cause a failure of gamess benchmark. The bug is quite old (present in GCC11 release) but it needs quite interesting series of events to manifest. In particular 1) At lto time ISRA turns some parameters passed by reference to

[PATCH 3/4] Darwin : Allow for configuring Darwin to use embedded runpath.

2021-11-17 Thread Iain Sandoe via Gcc-patches
Recent Darwin versions place contraints on the use of run paths specified in environment variables. This breaks some assumptions in the GCC build. This change allows the user to configure a Darwin build to use '@rpath/libraryname.dylib' in library names and then to add an embedded runpath to

[PATCH 0/4] Darwin: Replace environment runpath with embedded [PR88590].

2021-11-17 Thread Iain Sandoe via Gcc-patches
This is a fairly long explanation of the problems being addressed by the patch set. Most of the changes are Darwin-specific - a change to the libtool component allowing for this @rpath and some minor additions to makefiles where libtool is not in use. At present, this seems pretty specific to

[PATCH 4/4] Darwin, Ada : Add loader path as a default rpath.

2021-11-17 Thread Iain Sandoe via Gcc-patches
Allow the Ada runtimes to find GCC runtimes relative to their non- standard install positions. gcc/ada/ * gcc-interface/Makefile.in: Add @loader_path runpaths to the libgnat and libgnarl shared library builds. --- gcc/ada/gcc-interface/Makefile.in | 2 ++ 1 file changed,

[PATCH 2/4] Darwin : Handle rpaths given on the command line.

2021-11-17 Thread Iain Sandoe via Gcc-patches
We want to produce a situation where a default rpath can be added to each executable (or dylib), but that can be overridden by any specific rpath provided by the user. gcc/ChangeLog: * config.gcc: Include rpath.opt * config/darwin-driver.c (darwin_driver_init): Detect cases

[PATCH 1/4] Driver : Provide a spec to insert rpaths for compiler lib dirs.

2021-11-17 Thread Iain Sandoe via Gcc-patches
This provides a spec to insert "-rpath DDD" for each DDD corresponding to a compiler startfile directory. This allows a target to use @rpath as the install path for libraries, and have the compiler provide the necessary rpath to handle this. gcc/ChangeLog: * gcc.c (RUNPATH_OPTION): New.

[PATCH] rs6000: Builtins test changes for BFP scalar tests

2021-11-17 Thread Bill Schmidt via Gcc-patches
Hi! This patch is broken out of the previous patch for all the builtins test suite adjustments. Here we have some slight changes in error messages due to how the internals have changed between the old and new builtins methods. For scalar-extract-exp-2.c we change: error:

Re: [PATCH v2] x86: Remove "%!" before ret

2021-11-17 Thread Uros Bizjak via Gcc-patches
On Wed, Nov 17, 2021 at 9:33 PM H.J. Lu wrote: > > On Wed, Nov 17, 2021 at 11:46 AM Uros Bizjak wrote: > > > > On Wed, Nov 17, 2021 at 8:44 PM H.J. Lu wrote: > > > > > > Before MPX was removed, "%!" was mapped to > > > > > > case '!': > > > if (ix86_bnd_prefixed_insn_p

[PATCH v2] x86: Remove "%!" before ret

2021-11-17 Thread H.J. Lu via Gcc-patches
On Wed, Nov 17, 2021 at 11:46 AM Uros Bizjak wrote: > > On Wed, Nov 17, 2021 at 8:44 PM H.J. Lu wrote: > > > > Before MPX was removed, "%!" was mapped to > > > > case '!': > > if (ix86_bnd_prefixed_insn_p (current_output_insn)) > > fputs ("bnd ", file); > >

Re: [PATCH] Fortran: Mark internal symbols as artificial [PR88009,PR68800]

2021-11-17 Thread Harald Anlauf via Gcc-patches
Do you have testcases/reproducers demonstrating that the patch actually fixes the issues you're describing? Am 17.11.21 um 09:12 schrieb Bernhard Reutner-Fischer via Gcc-patches: On Tue, 16 Nov 2021 21:46:32 +0100 Harald Anlauf via Fortran wrote: Hi Bernhard, I'm trying to understand your

Re: [PATCH] rs6000: Better error messages for power8/9-vector builtins

2021-11-17 Thread Segher Boessenkool
On Tue, Nov 16, 2021 at 11:12:35AM -0600, Bill Schmidt wrote: > Hi! During a previous patch review, Segher asked that I provide better > messages when builtins are unavailable because they require both a minimum > CPU and the enablement of VSX instructions. This patch does just that. > >

Re: [PATCH] rs6000: Better error messages for power8/9-vector builtins

2021-11-17 Thread Paul A. Clarke via Gcc-patches
On Wed, Nov 17, 2021 at 02:00:02PM -0600, Segher Boessenkool wrote: > On Wed, Nov 17, 2021 at 11:45:02AM -0600, Paul A. Clarke wrote: > > I guess I'm being pedantic. "requires -mcpu=power8 and -mvsx" is not > > accurate from a user's point a view, as "-mcpu=power8" is sufficient, > > since

Re: [PATCH v3] x86: Add -mharden-sls=[none|all|return|indirect-branch]

2021-11-17 Thread Uros Bizjak via Gcc-patches
On Wed, Nov 17, 2021 at 9:02 PM H.J. Lu wrote: > > On Wed, Nov 17, 2021 at 7:53 AM Uros Bizjak wrote: > > > > On Wed, Nov 17, 2021 at 4:35 PM H.J. Lu wrote: > > > > > > Add -mharden-sls= to mitigate against straight line speculation (SLS) > > > for function return and indirect branch by adding

Re: [PATCH] rs6000: Better error messages for power8/9-vector builtins

2021-11-17 Thread David Edelsohn via Gcc-patches
On Wed, Nov 17, 2021 at 3:02 PM Segher Boessenkool wrote: > > > It's not a strong objection, since specifying "-mno-vsx" should be > > uncommon. (Right?) And, specifying "-mcpu=power8 -mvsx" is harmless. > > Maybe the warning could say "requires -mcpu=power8 (and -mvsx)"? Is > that clearer, to

[PATCH v3] x86: Add -mharden-sls=[none|all|return|indirect-branch]

2021-11-17 Thread H.J. Lu via Gcc-patches
On Wed, Nov 17, 2021 at 7:53 AM Uros Bizjak wrote: > > On Wed, Nov 17, 2021 at 4:35 PM H.J. Lu wrote: > > > > Add -mharden-sls= to mitigate against straight line speculation (SLS) > > for function return and indirect branch by adding an INT3 instruction > > after function return and indirect

Re: [PATCH] rs6000: Better error messages for power8/9-vector builtins

2021-11-17 Thread Segher Boessenkool
On Wed, Nov 17, 2021 at 11:45:02AM -0600, Paul A. Clarke wrote: > I guess I'm being pedantic. "requires -mcpu=power8 and -mvsx" is not > accurate from a user's point a view, as "-mcpu=power8" is sufficient, > since "-mvsx" is enabled when "-mcpu=power8" is specified. To be really pedantic,

Re: [PATCH] c++: implicit dummy object in requires clause [PR103198]

2021-11-17 Thread Patrick Palka via Gcc-patches
On Wed, 17 Nov 2021, Jason Merrill wrote: > On 11/11/21 20:25, Patrick Palka wrote: > > In the testcase below satisfaction misbehaves for f and g ultimately > > because find_template_parameters fails to notice that the constraint > > 'val.x' depends on the template parameters of the class

[PATCH] i386: Redefine indirect_thunks_used as HARD_REG_SET.

2021-11-17 Thread Uros Bizjak via Gcc-patches
Change indirect_thunks_used to HARD_REG_SET to avoid recalculations of correct register numbers and allow usage of SET/TEST_HARD_REG_BIT accessors. 2021-11-17 Uroš Bizjak gcc/ChangeLog: * config/i386/i386.c (indirect_thunks_used): Redefine as HARD_REG_SET. (ix86_code_end): Use

Re: [PATCH] x86: Remove "%!" before ret

2021-11-17 Thread Uros Bizjak via Gcc-patches
On Wed, Nov 17, 2021 at 8:44 PM H.J. Lu wrote: > > Before MPX was removed, "%!" was mapped to > > case '!': > if (ix86_bnd_prefixed_insn_p (current_output_insn)) > fputs ("bnd ", file); > return; > > After CET was added and MPX was removed, "%!" was mapped

[PATCH] x86: Remove "%!" before ret

2021-11-17 Thread H.J. Lu via Gcc-patches
Before MPX was removed, "%!" was mapped to case '!': if (ix86_bnd_prefixed_insn_p (current_output_insn)) fputs ("bnd ", file); return; After CET was added and MPX was removed, "%!" was mapped to case '!': if (ix86_notrack_prefixed_insn_p

Re: [PATCH v1 2/2] RISC-V: Add instruction fusion (for ventana-vt1)

2021-11-17 Thread Philipp Tomsich
On Wed, 17 Nov 2021 at 20:40, Palmer Dabbelt wrote: > [This is my first time trying my Rivos address on the lists, so sorry if > something goes off the rails.] > > On Wed, 17 Nov 2021 06:05:04 PST (-0800), gcc-patches@gcc.gnu.org wrote: > > Hi Philipp: > > > > Thanks for the patch, I like this

Re: [PATCH v1 2/2] RISC-V: Add instruction fusion (for ventana-vt1)

2021-11-17 Thread Palmer Dabbelt
[This is my first time trying my Rivos address on the lists, so sorry if something goes off the rails.] On Wed, 17 Nov 2021 06:05:04 PST (-0800), gcc-patches@gcc.gnu.org wrote: Hi Philipp: Thanks for the patch, I like this approach, that can easily configure different capabilities for each

[PATCH] i386: Introduce LEGACY_SSE_REGNO_P predicate

2021-11-17 Thread Uros Bizjak via Gcc-patches
Introduce LEGACY_SSE_REGNO_P predicate to simplify a couple of places. No functional changes. 2021-11-17 Uroš Bizjak gcc/ChangeLog: * config/i386/i386.h (LEGACY_SSE_REGNO_P): New predicate. (SSE_REGNO_P): Use LEGACY_SSE_REGNO_P predicate. * config/i386/i386.c

Re: [PATCH] restore ancient -Waddress for weak symbols [PR33925]

2021-11-17 Thread Martin Sebor via Gcc-patches
On 11/17/21 11:31 AM, Jason Merrill wrote: On 11/16/21 20:11, Martin Sebor wrote: On 11/16/21 1:23 PM, Jason Merrill wrote: On 10/23/21 19:06, Martin Sebor wrote: On 10/4/21 3:37 PM, Jason Merrill wrote: On 10/4/21 14:42, Martin Sebor wrote: While resolving the recent -Waddress enhancement

Re: [PATCH v2] rs6000: Test case adjustments for new builtins

2021-11-17 Thread Segher Boessenkool
On Wed, Nov 17, 2021 at 07:52:38AM -0600, Bill Schmidt wrote: > >> - For int_128bit-runnable.c, I chose not to do gimple folding on the > >> 128-bit > >>comparison operations in the new implementation, because doing so > >> results in > >>bad code that splits things into two 64-bit

Re: [PATCH] c++: implicit dummy object in requires clause [PR103198]

2021-11-17 Thread Jason Merrill via Gcc-patches
On 11/11/21 20:25, Patrick Palka wrote: In the testcase below satisfaction misbehaves for f and g ultimately because find_template_parameters fails to notice that the constraint 'val.x' depends on the template parameters of the class template. In contrast, satisfaction works just fine for h.

Re: [PATCH v3] c-family: Add __builtin_assoc_barrier

2021-11-17 Thread Jason Merrill via Gcc-patches
On 11/11/21 03:49, Matthias Kretz wrote: On Wednesday, 8 September 2021 15:49:27 CET Matthias Kretz wrote: On Wednesday, 8 September 2021 15:44:28 CEST Jason Merrill wrote: On 9/8/21 5:37 AM, Matthias Kretz wrote: On Tuesday, 7 September 2021 19:36:22 CEST Jason Merrill wrote: case

Re: [PATCH] restore ancient -Waddress for weak symbols [PR33925]

2021-11-17 Thread Jason Merrill via Gcc-patches
On 11/16/21 20:11, Martin Sebor wrote: On 11/16/21 1:23 PM, Jason Merrill wrote: On 10/23/21 19:06, Martin Sebor wrote: On 10/4/21 3:37 PM, Jason Merrill wrote: On 10/4/21 14:42, Martin Sebor wrote: While resolving the recent -Waddress enhancement request (PR PR102103) I came across a 2007

Re: [RFC] c++: Print function template parms when relevant (was: [PATCH v4] c++: Add gnu::diagnose_as attribute)

2021-11-17 Thread Jason Merrill via Gcc-patches
On 11/17/21 04:04, Matthias Kretz wrote: On Wednesday, 17 November 2021 07:09:18 CET Jason Merrill wrote: - if (CHECKING_P) -SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT (a, TREE_VEC_LENGTH (a)); + SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT (a, nondefault); should have been if (CHECKING_P ||

Re: [PATCH] rs6000: Better error messages for power8/9-vector builtins

2021-11-17 Thread Paul A. Clarke via Gcc-patches
On Wed, Nov 17, 2021 at 11:00:07AM -0600, Bill Schmidt via Gcc-patches wrote: > On 11/17/21 10:54 AM, Paul A. Clarke wrote: > > On Tue, Nov 16, 2021 at 11:12:35AM -0600, Bill Schmidt via Gcc-patches > > wrote: > >> Hi! During a previous patch review, Segher asked that I provide better > >>

[committed] libstdc++: Use std::construct_at in net::ip::address

2021-11-17 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. Using placement-new isn't valid in constant expressions, so this replaces it with std::construct_at (via the std::_Construct function that is usable before C++20). libstdc++-v3/ChangeLog: * include/experimental/internet (address): Use

[committed] libstdc++: Simplify std::string constructors

2021-11-17 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. Several std::basic_string constructors dispatch to one of the two-argument overloads of _M_construct, which then dispatches again to _M_construct_aux to detect whether the arguments are iterators or not. That then dispatches to one of

[committed] libstdc++: Set active member of union in std::string [PR103295]

2021-11-17 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. Clang diagnoses that the new constexpr std::string constructors are not usable in constant expressions, because they start to write to members of the union without setting an active member. This adds a new helper function which returns the address of

[committed] libstdc++: Fix std::type_info::before for ARM [PR103240]

2021-11-17 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, and briefly checkd on armv7hl-linux-gnueabi, pushed to trunk. The r179236 fix for std::type_info::operator== should also have been applied to std::type_info::before. Otherwise two distinct types can compare equivalent due to using a string comparison, when they should

[PATCH] DWARF: Match behaviour of .cfi_xxx when doing manual frame output.

2021-11-17 Thread Iain Sandoe via Gcc-patches
At present, for several reasons, it is not possible to switch Darwin to use .cfi instructions for frame output. When GCC uses .cfi_ instructions, the behaviour w.r.t frame sections (for a target with unwind frames by defaults): (no options ) .eh_frame (-g ) .eh_frame (-g -fno-unwind-tables

Re: [PATCH v5 1/1] [ARM] Add support for TLS register based stack protector canary access

2021-11-17 Thread Ard Biesheuvel via Gcc-patches
(+ Ramana) On Mon, 15 Nov 2021 at 19:04, Ard Biesheuvel wrote: > > Add support for accessing the stack canary value via the TLS register, > so that multiple threads running in the same address space can use > distinct canary values. This is intended for the Linux kernel running in > SMP mode,

Re: [PATCH] rs6000: Better error messages for power8/9-vector builtins

2021-11-17 Thread Bill Schmidt via Gcc-patches
On 11/17/21 10:54 AM, Paul A. Clarke wrote: > On Tue, Nov 16, 2021 at 11:12:35AM -0600, Bill Schmidt via Gcc-patches wrote: >> Hi! During a previous patch review, Segher asked that I provide better >> messages when builtins are unavailable because they require both a minimum >> CPU and the

[committed] Fix two mips target tests compromised by recent IPA work

2021-11-17 Thread Jeff Law via Gcc-patches
Jan's recent IPA work compromised two mips tests.   This restores the tests by disabling IPA analysis on the key function in both tests. Committed to the trunk, Jeffcommit c70546482388951b5c9c19cff002ee6ab920b7f5 Author: Jeff Law Date: Wed Nov 17 11:55:50 2021 -0500 Fix two mips target

Re: [PATCH] rs6000: Better error messages for power8/9-vector builtins

2021-11-17 Thread Paul A. Clarke via Gcc-patches
On Tue, Nov 16, 2021 at 11:12:35AM -0600, Bill Schmidt via Gcc-patches wrote: > Hi! During a previous patch review, Segher asked that I provide better > messages when builtins are unavailable because they require both a minimum > CPU and the enablement of VSX instructions. This patch does just

Re: [committed] analyzer: fix missing -Wanalyzer-write-to-const [PR102695]

2021-11-17 Thread Martin Sebor via Gcc-patches
On 11/16/21 7:05 PM, David Malcolm via Gcc-patches wrote: This patch fixes -Wanalyzer-write-to-const so that it will complain about attempts to write to functions, to labels. It also "teaches" the analyzer about strchr, in that strchr can either return a pointer into the input area (and thus

[OG11][committed][PATCH 21/22] graphite: Accept loops without data references

2021-11-17 Thread Frederik Harwath
It seems that the check that rejects loops without data references is only included to avoid handling non-profitable loops. Including those loops in Graphite's analysis enables more consistent diagnostic messages in OpenACC "kernels" code and does not introduce any testsuite regressions. If

[OG11][committed][PATCH 20/22] graphite: Adjust scop loop-nest choice

2021-11-17 Thread Frederik Harwath
The find_common_loop function is used in Graphite to obtain a common super-loop of all loops inside a SCoP. The function is applied to the loop of the destination block of the edge that leads into the SESE region and the loop of the source block of the edge that exits the region. The exit block

[OG11][committed][PATCH 19/22] graphite: Tune parameters for OpenACC use

2021-11-17 Thread Frederik Harwath
The default values of some parameters that restrict Graphite's resource usage are too low for many OpenACC codes. Furthermore, exceeding the limits does not alwas lead to user-visible diagnostic messages. This commit increases the parameter values on OpenACC functions. The values were chosen to

[OG11][committed][PATCH 18/22] openacc: Disable pass_pre on outlined functions analyzed by Graphite

2021-11-17 Thread Frederik Harwath
The additional dependences introduced by partial redundancy elimination proper and by the code hoisting step of the pass very often cause Graphite to fail on OpenACC functions. On the other hand, the pass can also enable the analysis of OpenACC loops (cf. e.g. the loop-auto-transfer-4.f90

[OG11][committed][PATCH 17/22] openacc: Handle internal function calls in pass_lim

2021-11-17 Thread Frederik Harwath
The loop invariant motion pass correctly refuses to move statements out of a loop if any other statement in the loop is unanalyzable. The pass does not know how to handle the OpenACC internal function calls which was not necessary until recently when the OpenACC device lowering pass was moved to

[OG11][committed][PATCH 16/22] openacc: Warn about "independent" "kernels" loops with data-dependences

2021-11-17 Thread Frederik Harwath
This commit concerns loops in OpenACC "kernels" region that have been marked up with an explicit "independent" clause by the user, but for which Graphite found data dependences. A discussion on the private internal OpenACC mailing list suggested that warning the user about the dependences woud be

[OG11][committed][PATCH 14/22] openacc: Add data optimization pass

2021-11-17 Thread Frederik Harwath
From: Andrew Stubbs Address PR90591 "Avoid unnecessary data transfer out of OMP construct", for simple (but common) cases. This commit adds a pass that optimizes data mapping clauses. Currently, it can optimize copy/map(tofrom) clauses involving scalars to copyin/map(to) and further to

[OG11][committed][PATCH 15/22] openacc: Add runtime alias checking for OpenACC kernels

2021-11-17 Thread Frederik Harwath
From: Andrew Stubbs This commit adds the code generation for the runtime alias checks for OpenACC loops that have been analyzed by Graphite. The runtime alias check condition gets generated in Graphite. It is evaluated by the code generated for the IFN_GOACC_LOOP internal function calls. If

[OG11][committed][PATCH 13/22] Add function for printing a single OMP_CLAUSE

2021-11-17 Thread Frederik Harwath
Commit 89f4f339130c ("For 'OMP_CLAUSE' in 'dump_generic_node', dump the whole OMP clause chain") changed the dumping behavior for OMP_CLAUSEs. The old behavior is required for a follow-up commit ("openacc: Add data optimization pass") that optimizes single OMP_CLAUSEs. gcc/ChangeLog: *

[OG11][committed][PATCH 11/22] openacc: Add further kernels tests

2021-11-17 Thread Frederik Harwath
Add some copies of tests to continue covering the old "parloops"-based "kernels" implementation - until it gets removed from GCC - and add further tests for the new Graphite-based implementation. libgomp/ChangeLog: * testsuite/libgomp.oacc-fortran/parallel-loop-auto-reduction-2.f90:

[OG11][committed][PATCH 12/22] openacc: Remove unused partitioning in "kernels" regions

2021-11-17 Thread Frederik Harwath
With the old "kernels" handling, unparallelized regions would get executed with 1x1x1 partitioning even if the user provided explicit num_gangs, num_workers clauses etc. This commit restores this behavior by removing unused partitioning after assigning the parallelism dimensions to loops.

[OG11][committed][PATCH 10/22] openacc: Add "can_be_parallel" flag info to "graph" dumps

2021-11-17 Thread Frederik Harwath
gcc/ChangeLog: * graph.c (oacc_get_fn_attrib): New declaration. (find_loop_location): New declaration. (draw_cfg_nodes_for_loop): Print value of the can_be_parallel flag at the top of loops in OpenACC functions. --- gcc/graph.c | 35

[OG11][committed][PATCH 08/22] graphite: Add runtime alias checking

2021-11-17 Thread Frederik Harwath
Graphite rejects a SCoP if it contains a pair of data references for which it cannot determine statically if they may alias. This happens very often, for instance in C code which does not use explicit "restrict". This commit adds the possibility to analyze a SCoP nevertheless and perform an alias

[OG11][committed][PATCH 07/22] Move compute_alias_check_pairs to tree-data-ref.c

2021-11-17 Thread Frederik Harwath
Move this function from tree-loop-distribution.c to tree-data-ref.c and make it non-static to enable its use from other parts of GCC. gcc/ChangeLog: * tree-loop-distribution.c (data_ref_segment_size): Remove function. (latch_dominated_by_data_ref): Likewise.

[OG11][committed][PATCH 05/22] graphite: Fix minor mistakes in comments

2021-11-17 Thread Frederik Harwath
gcc/ChangeLog: * graphite-sese-to-poly.c (build_poly_sr_1): Fix a typo and a reference to a variable which does not exist. * graphite-isl-ast-to-gimple.c (gsi_insert_earliest): Fix typo in comment. --- gcc/graphite-isl-ast-to-gimple.c | 2 +-

[OG11][committed][PATCH 04/22] graphite: Rename isl_id_for_ssa_name

2021-11-17 Thread Frederik Harwath
The SSA names for which this function gets used are always SCoP parameters and hence "isl_id_for_parameter" is a better name. It also explains the prefix "P_" for those names in the ISL representation. gcc/ChangeLog: * graphite-sese-to-poly.c (isl_id_for_ssa_name): Rename to ...

[OG11][committed][PATCH 02/22] openacc: Move pass_oacc_device_lower after pass_graphite

2021-11-17 Thread Frederik Harwath
The OpenACC device lowering pass must run after the Graphite pass to allow for the use of Graphite for automatic parallelization of kernels regions in the future. Experimentation has shown that it is best, performancewise, to run pass_oacc_device_lower together with the related passes

[OG11][committed][PATCH 03/22] graphite: Extend SCoP detection dump output

2021-11-17 Thread Frederik Harwath
Extend dump output to make understanding why Graphite rejects to include a loop in a SCoP easier (for GCC developers). ChangeLog: * graphite-scop-detection.c (scop_detection::can_represent_loop): Output reason for failure to dump file.

[OG11][committed][PATCH 01/22] Fortran: delinearize multi-dimensional array accesses

2021-11-17 Thread Frederik Harwath
From: Sandra Loosemore The Fortran front end presently linearizes accesses to multi-dimensional arrays by combining the indices for the various dimensions into a series of explicit multiplies and adds with refactoring to allow CSE of invariant parts of the computation. Unfortunately this

[OG11][committed][PATCH 00/22] OpenACC "kernels" Improvements

2021-11-17 Thread Frederik Harwath
Hi, this patch series implements the re-work of the OpenACC "kernels" implementation that has been announced at the GNU Tools Track of this year's Linux Plumbers Conference; see https://linuxplumbersconf.org/event/11/contributions/998/. The central step is contained in the commit titled

Re: [PATCH] libcpp: Fix up handling of block comments in -fdirectives-only mode [PR103130]

2021-11-17 Thread Marek Polacek via Gcc-patches
On Wed, Nov 17, 2021 at 10:22:32AM +0100, Jakub Jelinek wrote: > Hi! > > Normal preprocessing, -fdirectives-only preprocessing before the Nathan's > rewrite, and all other compilers I've tried on godbolt treat even \*/ > as end of a block comment, but the new -fdirectives-only handling doesn't. >

Re: [PATCH v2] x86: Add -mharden-sls=[none|all|return|indirect-branch]

2021-11-17 Thread Uros Bizjak via Gcc-patches
On Wed, Nov 17, 2021 at 4:35 PM H.J. Lu wrote: > > Add -mharden-sls= to mitigate against straight line speculation (SLS) > for function return and indirect branch by adding an INT3 instruction > after function return and indirect branch. > > gcc/ > > PR target/102952 > *

Re: [PATCH] x86: Add -mharden-sls=[none|all|return|indirect-branch]

2021-11-17 Thread H.J. Lu via Gcc-patches
On Wed, Nov 17, 2021 at 6:08 AM Uros Bizjak wrote: > > On Wed, Nov 17, 2021 at 2:46 PM H.J. Lu wrote: > > > > On Wed, Nov 17, 2021 at 1:05 AM Uros Bizjak wrote: > > > > > > On Tue, Nov 16, 2021 at 7:20 PM H.J. Lu via Gcc-patches > > > wrote: > > > > > > > > Add -mharden-sls= to mitigate

Re: [AArch64] Enable generation of FRINTNZ instructions

2021-11-17 Thread Richard Sandiford via Gcc-patches
> diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md > index > 4035e061706793849c68ae09bcb2e4b9580ab7b6..62adbc4cb6bbbe0c856f9fbe451aee08f2dea3b5 > 100644 > --- a/gcc/config/aarch64/aarch64.md > +++ b/gcc/config/aarch64/aarch64.md > @@ -7345,6 +7345,14 @@ (define_insn

[PATCH v2] x86: Add -mharden-sls=[none|all|return|indirect-branch]

2021-11-17 Thread H.J. Lu via Gcc-patches
Add -mharden-sls= to mitigate against straight line speculation (SLS) for function return and indirect branch by adding an INT3 instruction after function return and indirect branch. gcc/ PR target/102952 * config/i386/i386-opts.h (harden_sls): New enum. *

Re: [PATCH] handle folded nonconstant array bounds [PR101702]

2021-11-17 Thread Marek Polacek via Gcc-patches
On Tue, Nov 16, 2021 at 05:32:00PM -0700, Martin Sebor via Gcc-patches wrote: > -Warray-parameter and -Wvla-parameter assume that array bounds > in function parameters are either constant integers or variable, > but not something in between like a cast of a constant that's > not recognized as an

Re: [PATCH v1 2/8] RISC-V: costs: handle BSWAP

2021-11-17 Thread Kito Cheng via Gcc-patches
> diff --git a/gcc/config/riscv/riscv.c b/gcc/config/riscv/riscv.c > index c77b0322869..8480cf09294 100644 > --- a/gcc/config/riscv/riscv.c > +++ b/gcc/config/riscv/riscv.c > @@ -2131,6 +2131,14 @@ riscv_rtx_costs (rtx x, machine_mode mode, int > outer_code, int opno ATTRIBUTE_UN >*total

Re: [PATCH v1 1/8] bswap: synthesize HImode bswap from SImode or DImode

2021-11-17 Thread Kito Cheng via Gcc-patches
Hi Philipp: I would suggest add define_expand pattern for bswaphi2 rather than changing expand_unop with following reasons: - There is a comment above this change, and it also tried widen_bswap after this if-block, so I think this patch is kind of violating this comment. /* HImode is

Re: [PATCH] x86: Add -mharden-sls=[none|all|return|indirect-branch]

2021-11-17 Thread Uros Bizjak via Gcc-patches
On Wed, Nov 17, 2021 at 2:46 PM H.J. Lu wrote: > > On Wed, Nov 17, 2021 at 1:05 AM Uros Bizjak wrote: > > > > On Tue, Nov 16, 2021 at 7:20 PM H.J. Lu via Gcc-patches > > wrote: > > > > > > Add -mharden-sls= to mitigate against straight line speculation (SLS) > > > for function return and

Re: [PATCH v1 0/2] Basic support for the Ventana VT1 w/ instruction fusion

2021-11-17 Thread Kito Cheng via Gcc-patches
Hi Philipp: This patch set LGTM, feel free to commit once addressed those issues. On Mon, Nov 15, 2021 at 5:48 AM Philipp Tomsich wrote: > > > This series provides support for the Ventana VT1 (a 4-way superscalar > rv64gc_zba_zbb_zbc_zbs core) including support for the supported > instruction

Re: [PATCH v1 2/2] RISC-V: Add instruction fusion (for ventana-vt1)

2021-11-17 Thread Kito Cheng via Gcc-patches
Hi Philipp: Thanks for the patch, I like this approach, that can easily configure different capabilities for each core :) So there are only a few minor comments for this patch. On Mon, Nov 15, 2021 at 5:49 AM Philipp Tomsich wrote: > > From: Philipp Tomsich > > The Ventana VT1 core supports

RE: [PATCH][GCC] aarch64: Add new vector mode V8DI

2021-11-17 Thread Przemyslaw Wirkus via Gcc-patches
> -Original Message- > From: Richard Sandiford > Sent: 17 November 2021 10:08 > To: Przemyslaw Wirkus > Cc: gcc-patches@gcc.gnu.org; Richard Earnshaw > ; Kyrylo Tkachov ; > Marcus Shawcroft > Subject: Re: [PATCH][GCC] aarch64: Add new vector mode V8DI > > Oops, only just realised

Re: [PATCH] x86: Add -mindirect-branch-cs-prefix

2021-11-17 Thread H.J. Lu via Gcc-patches
On Wed, Nov 17, 2021 at 1:10 AM Uros Bizjak wrote: > > On Tue, Nov 16, 2021 at 7:51 PM H.J. Lu via Gcc-patches > wrote: > > > > Add -mindirect-branch-cs-prefix to add CS prefix to call and jmp to thunk > > via r8-r15 registers when converting indirect call and jump to increase > > the

Re: [PATCH v2] rs6000: Test case adjustments for new builtins

2021-11-17 Thread Bill Schmidt via Gcc-patches
On 11/17/21 6:44 AM, Segher Boessenkool wrote: > Hi! > > On Tue, Nov 16, 2021 at 02:26:22PM -0600, Bill Schmidt wrote: >> Hi! I recently submitted [1] to make adjustments to test cases for the new >> builtins >> support, mostly due to error messages changing for consistency. Thanks for >>

[PATCH v2] x86: Add -mindirect-branch-cs-prefix

2021-11-17 Thread H.J. Lu via Gcc-patches
Add -mindirect-branch-cs-prefix to add CS prefix to call and jmp to thunk via r8-r15 registers when converting indirect call and jump to increase the instruction length to 6, allowing the non-thunk form to be inlined. gcc/ PR target/102952 * config/i386/i386.c

Re: [PATCH] x86: Add -mharden-sls=[none|all|return|indirect-branch]

2021-11-17 Thread H.J. Lu via Gcc-patches
On Wed, Nov 17, 2021 at 1:05 AM Uros Bizjak wrote: > > On Tue, Nov 16, 2021 at 7:20 PM H.J. Lu via Gcc-patches > wrote: > > > > Add -mharden-sls= to mitigate against straight line speculation (SLS) > > for function return and indirect branch by adding an INT3 instruction > > after function

  1   2   >