Re: [PATCH] vect: Fix SLP layout handling of masked loads [PR106794]

2022-09-16 Thread Richard Biener via Gcc-patches
On Fri, 16 Sep 2022, Richard Sandiford wrote: PR106794 shows that I'd forgotten about masked loads when doing the SLP layout changes. These loads can't currently be permuted independently of their mask input, so during construction they never get a load permutation. (If we did support

Re: [PATCH] vect: Fix missed gather load opportunity

2022-09-16 Thread Richard Biener via Gcc-patches
On Fri, 16 Sep 2022, Richard Sandiford wrote: While writing a testcase for PR106794, I noticed that we failed to vectorise the testcase in the patch for SVE. The code that recognises gather loads tries to optimise the point at which the offset is calculated, to avoid unnecessary extensions

[PATCH] RISC-V: Suppress riscv-selftests.cc warning.

2022-09-16 Thread juzhe . zhong
From: Ju-Zhe Zhong This patch is a fix patch for: https://gcc.gnu.org/pipermail/gcc-patches/2022-September/601643.html Suppress the warning as follows: ../../../riscv-gcc/gcc/poly-int.h: In function ‘poly_int64 eval_value(rtx, std::map&)’: ../../../riscv-gcc/gcc/poly-int.h:845:48: warning:

Re: [PATCH] C-SKY: Fix unsigned comparison warning

2022-09-16 Thread Jeff Law via Gcc-patches
On 9/12/22 06:19, Jan-Benedict Glaw wrote: Hi! When -mfloat-abi=hard support was added, a cast went missing that used to silence a warning in common code: /usr/lib/gcc-snapshot/bin/g++ -fno-PIE -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti

Re: [PATCH] riscv: implement TARGET_MODE_REP_EXTENDED

2022-09-16 Thread Jeff Law via Gcc-patches
On 9/6/22 05:39, Alexander Monakov via Gcc-patches wrote: On Mon, 5 Sep 2022, Philipp Tomsich wrote: +riscv_mode_rep_extended (scalar_int_mode mode, scalar_int_mode mode_rep) +{ + /* On 64-bit targets, SImode register values are sign-extended to DImode. */ + if (TARGET_64BIT && mode ==

[PATCH][PUSHED] Fix for an AutoFDO test.

2022-09-16 Thread Eugene Rozenfeld via Gcc-patches
After https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=c17975d81aaed49ff759c20c68b31304a6953d58 the expected inlining in indir-call-prof-2.c test happens during afdo phase instead of einline. This patch adjusts the test accordingly. gcc/testsuite/ChangeLog: *

Re: [PATCH] c++: constraint matching, TEMPLATE_ID_EXPR, current inst

2022-09-16 Thread Jason Merrill via Gcc-patches
On 9/16/22 10:59, Patrick Palka wrote: On Fri, 16 Sep 2022, Jason Merrill wrote: On 9/15/22 11:58, Patrick Palka wrote: Here we're crashing during constraint matching for the instantiated hidden friends due to two issues with dependent substitution into a TEMPLATE_ID_EXPR naming a template

Re: [PATCH] c++: Implement C++23 P1169R4 - static operator() [PR106651]

2022-09-16 Thread Jason Merrill via Gcc-patches
On 9/13/22 12:42, Jakub Jelinek wrote: Hi! The following patch attempts to implement C++23 P1169R4 - static operator() paper's compiler side (there is some small library side too not implemented yet). This allows static members as user operator() declarations and static specifier on lambdas

[committed] libstdc++: Add preprocessor conditions for freestanding [PR106953]

2022-09-16 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. This doesn't actually change anything for the freestanding build, so is effectively a no-op. _GLIBCXX_HOSTED is always defined to 1 when these headers are included. However, somebody else is working on installing the additional headers for freestanding, so

[committed] libstdc++: Move allocator-related helpers to

2022-09-16 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. -- >8 -- The __alloc_swap and __shrink_to_fit_aux helpers are not specific to std::allocator, so don't belong in . This also simplifies enabling for freestanding, as now we can just omit the whole of for freestanding. libstdc++-v3/ChangeLog: *

[committed] libstdc++: Make more internal headers include their own dependencies

2022-09-16 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. -- >8 -- This adds required headers to a few internal headers that currently assume their deps will be included first. It's more robust to make them include their own dependencies, so that later refactoring or reuse of those headers in new contexts doesn't

[ping] [PATCH] C-SKY: Fix unsigned comparison warning

2022-09-16 Thread Jan-Benedict Glaw
On Mon, 2022-09-12 14:19:23 +0200, Jan-Benedict Glaw wrote: > 2022-09-06 Jan-Benedict Glaw > > gcc/ChangeLog: > * config/csky/csky.h (FUNCTION_ARG_REGNO_P): Cast REGNO to (int) > to prevent warning. > > diff --git a/gcc/config/csky/csky.h b/gcc/config/csky/csky.h > index

[PATCH 09/10] fortran: Support clobbering of variable subreferences [PR88364]

2022-09-16 Thread Mikael Morin via Gcc-patches
This adds support for clobbering of partial variable references, when they are passed as actual argument and the associated dummy has the INTENT(OUT) attribute. Support includes array elements, derived type component references, and complex real or imaginary parts. This is done by removing the

[PATCH 07/10] fortran: Support clobbering of ASSOCIATE variables [PR87397]

2022-09-16 Thread Mikael Morin via Gcc-patches
This is in spirit a revert of: r9-3051-gc109362313623d83fe0a5194bceaf994cf0c6ce0 That commit added a condition to avoid generating ICE with clobbers of ASSOCIATE variables. The test added at that point continues to pass if we remove that condition now. PR fortran/87397 PR

[PATCH 10/10] fortran: Support clobbering of derived types [PR41453]

2022-09-16 Thread Mikael Morin via Gcc-patches
This is probably the most risky patch in the series. A previous version of this patch allowing all exactly matching derived types showed two regressions. One of them uncovered PR106817 for which I added a fix in this series, and for the other I have excluded types with allocatable components

[PATCH 05/10] fortran: Support clobbering of reference variables [PR41453]

2022-09-16 Thread Mikael Morin via Gcc-patches
This adds support for clobbering of variables passed by reference, when the reference is forwarded to a subroutine as actual argument whose associated dummy has the INTENT(OUT) attribute. This was explicitly disabled and enabling it seems to work, as demonstrated by the new testcase. PR

[PATCH 08/10] fortran: Support clobbering of allocatables and pointers [PR41453]

2022-09-16 Thread Mikael Morin via Gcc-patches
This adds support for clobbering of allocatable and pointer scalar variables passed as actual argument to a subroutine when the associated dummy has the INTENT(OUT) attribute. Support was explicitly disabled, but the clobber generation code seems to support it well, as demonstrated by the newly

[PATCH 04/10] fortran: Support clobbering with implicit interfaces [PR105012]

2022-09-16 Thread Mikael Morin via Gcc-patches
From: Harald Anlauf Before procedure calls, we clobber actual arguments whose associated dummy is INTENT(OUT). This only applies to procedures with explicit interfaces, as the knowledge of the interface is necessary to know whether an argument has the INTENT(OUT) attribute. This change also

[PATCH 06/10] fortran: Support clobbering of SAVE variables [PR87395]

2022-09-16 Thread Mikael Morin via Gcc-patches
This is in spirit a revert of: r9-3032-gee7fb0588c6361b4d77337ab0f7527be64fcdde2 That commit added a condition to avoid generating ICE with clobbers of variables with the SAVE attribute. The test added at that point continues to pass if we remove that condition now. PR fortran/87395

[PATCH 00/10] fortran: clobber fixes [PR41453]

2022-09-16 Thread Mikael Morin via Gcc-patches
Hello, this is a set of changes around the clobber we generate in the caller before a procedure call, for each actual argument whose associated dummy has the INTENT(OUT) attribute. The first patch is a refactoring moving the clobber generation in gfc_conv_procedure_call where it feels more

[PATCH 02/10] fortran: Fix invalid function decl clobber ICE [PR105012]

2022-09-16 Thread Mikael Morin via Gcc-patches
The fortran frontend, as result symbol for a function without declared result symbol, uses the function symbol itself. This caused an invalid clobber of a function decl to be emitted, leading to an ICE, whereas the intended behaviour was to clobber the function result variable. This change fixes

[PATCH 01/10] fortran: Move the clobber generation code

2022-09-16 Thread Mikael Morin via Gcc-patches
This change inlines the clobber generation code from gfc_conv_expr_reference to the single caller from where the add_clobber flag can be true, and removes the add_clobber argument. What motivates this is the standard making the procedure call a cause for a variable to become undefined, which

[PATCH 03/10] fortran: Move clobbers after evaluation of all arguments [PR106817]

2022-09-16 Thread Mikael Morin via Gcc-patches
For actual arguments whose dummy is INTENT(OUT), we used to generate clobbers on them at the same time we generated the argument reference for the function call. This was wrong if for an argument coming later, the value expression was depending on the value of the just- clobbered argument, and we

[committed] libstdc++: Fix compare_exchange_padding.cc test for std::atomic_ref

2022-09-16 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. The test was only failing for me with -m32 (and not -m64), so I didn't notice until now. That probably means we should make the test fail more reliably if the padding isn't being cleared. -- >8 -- This test was written assuming that std::atomic_ref clears

[PATCH] gcc/config/t-i386: add build dependencies on i386-builtin-types.inc

2022-09-16 Thread Sergei Trofimovich via Gcc-patches
From: Sergei Trofimovich i386-builtin-types.inc is included indirectly via i386-builtins.h into 4 files: i386.cc i386-builtins.cc i386-expand.cc i386-features.cc Only i386.cc dependency was present in gcc/config/t-i386 makefile. As a result parallel builds occasionally fail as: g++ ... -o

Re: [PATCH] c++: modules ICE with typename friend declaration

2022-09-16 Thread Bernhard Reutner-Fischer via Gcc-patches
On 16 September 2022 17:54:32 CEST, Patrick Palka via Gcc-patches wrote: >+++ b/gcc/testsuite/g++.dg/modules/typename-friend_a.C >@@ -0,0 +1,11 @@ >+// { dg-additional-options "-fmodules-ts" } >+export module foo; >+// { dg-module-cmi foo } >+ If that's a constant, repeating pain, you could

Re: [PATCH] c++: Implement P1467R9 - Extended floating-point types and standard names compiler part except for bfloat16 [PR106652]

2022-09-16 Thread Jakub Jelinek via Gcc-patches
On Fri, Sep 16, 2022 at 01:48:54PM +0200, Jason Merrill wrote: > On 9/12/22 04:05, Jakub Jelinek wrote: > > The following patch implements the compiler part of C++23 > > P1467R9 - Extended floating-point types and standard names compiler part > > by introducing _Float{16,32,64,128} as keywords and

[committed] libstdc++: Fix tr1::variate_generator::engine_value_type

2022-09-16 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. -- >8 -- The tr1/5_numerical_facilities/random/variate_generator/37986.cc test fails for strict -std=c++98 mode because _Adaptor(const _Engine&) is ill-formed in C++98 when _Engine is a reference type. Rather than attempt to make the _Adaptor handle

[committed] libstdc++: Remove __alloc_neq helper

2022-09-16 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. -- >8 -- This class template and partial specialization were added 15 years ago to optimize allocator equality comparisons in std::list. I think it's safe to assume that GCC is now capable of optimizing an inline operator!= that just returns false at least

[committed] libstdc++: Do not use nullptr in C++03-compatible code

2022-09-16 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. -- >8 -- This has to be valid as C++98/C++03. libstdc++-v3/ChangeLog: * include/debug/formatter.h [_GLIBCXX_DEBUG_BACKTRACE] (_Error_formatter): Use 0 as null pointer constant. --- libstdc++-v3/include/debug/formatter.h | 3 +-- 1 file

[committed] libstdc++: Fix Doxygen commands

2022-09-16 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. -- >8 -- Remove the bogus -D__allocator_base=std::__new_allocator macro definition for Doxygen, because that's an alias template for C++11 and later, not a macro. Fix the @cond/@endcond pair that span the end of an @addtogroup group. Add another @endcond

Re: [PATCH] c++: modules ICE with typename friend declaration

2022-09-16 Thread Patrick Palka via Gcc-patches
On Fri, 16 Sep 2022, Nathan Sidwell wrote: > Thanks, this looks right. Sigh templates can mess up ones mental invariants! > The test case should really be a foo_[ab].C kind, to test both sides of the > streaming. Bonus points for using the template after importing.  And you need > the

Re: [PATCH] c++: constraint matching, TEMPLATE_ID_EXPR, current inst

2022-09-16 Thread Patrick Palka via Gcc-patches
On Fri, 16 Sep 2022, Patrick Palka wrote: > On Fri, 16 Sep 2022, Jason Merrill wrote: > > > On 9/15/22 11:58, Patrick Palka wrote: > > > Here we're crashing during constraint matching for the instantiated > > > hidden friends due to two issues with dependent substitution into a > > >

Re: [PATCH] c++: constraint matching, TEMPLATE_ID_EXPR, current inst

2022-09-16 Thread Patrick Palka via Gcc-patches
On Fri, 16 Sep 2022, Jason Merrill wrote: > On 9/15/22 11:58, Patrick Palka wrote: > > Here we're crashing during constraint matching for the instantiated > > hidden friends due to two issues with dependent substitution into a > > TEMPLATE_ID_EXPR naming a template from the current instantiation

Re: [PATCH v4] eliminate mutex in fast path of __register_frame

2022-09-16 Thread Jason Merrill via Gcc-patches
On 9/16/22 06:19, Thomas Neumann wrote: The __register_frame/__deregister_frame functions are used to register unwinding frames from JITed code in a sorted list. That list itself is protected by object_mutex, which leads to terrible performance in multi-threaded code and is somewhat expensive

Re: [PATCH] [x86]Don't optimize cmp mem, 0 to load mem, reg + test reg, reg

2022-09-16 Thread Alexander Monakov via Gcc-patches
On Fri, 16 Sep 2022, Uros Bizjak via Gcc-patches wrote: > On Fri, Sep 16, 2022 at 3:32 AM Jeff Law via Gcc-patches > wrote: > > > > > > On 9/15/22 19:06, liuhongt via Gcc-patches wrote: > > > There's peephole2 submit in 1990s which split cmp mem, 0 to load mem, > > > reg + test reg, reg. I don't

Re: [PATCH] Rewrite NAN and sign handling in frange

2022-09-16 Thread Aldy Hernandez via Gcc-patches
On Fri, Sep 16, 2022 at 10:33 AM Richard Sandiford wrote: > > Aldy Hernandez via Gcc-patches writes: > > On Thu, Sep 15, 2022 at 9:06 AM Richard Biener > > wrote: > >> > >> On Thu, Sep 15, 2022 at 7:41 AM Aldy Hernandez wrote: > >> > > >> > Hi Richard. Hi all. > >> > > >> > The attatched

[pushed] c++: member fn in omp loc list [PR106858]

2022-09-16 Thread Jason Merrill via Gcc-patches
this->f names a member function, which isn't an addressable lvalue. Give a helpful error instead of crashing. The first hunk makes the error range cover the whole expression. Tested x86_64-pc-linux-gnu, applying to trunk. PR c++/106858 gcc/cp/ChangeLog: * parser.cc

Re: [PATCH] testsuite: Disable zero-scratch-regs-{7, 9, 11}.c on arm

2022-09-16 Thread Torbjorn SVENSSON via Gcc-patches
Hi all, Appears that this is just a problem for gcc11 (and perhaps gcc12?). Master already has the needed implementation, so the patch below is not needed. Sorry for the buzz. Kind regards, Torbjörn On 2022-09-15 08:54, Torbjörn SVENSSON wrote: -fzero-call-used-regs=all and

[PATCH v2] MIPS: improve -march=native arch detection

2022-09-16 Thread YunQiang Su
If we cannot get info from options and cpuinfo, we try to get from: 1. getauxval(AT_BASE_PLATFORM), introduced since Linux 5.7 2. _MIPS_ARCH from host compiler. mnan=2008 option is also used if __mips_nan2008__ is used. This can fix the wrong loader usage on r5/r6 platform with

Re: [PATCH] c++: 'mutable' within constexpr [PR92505]

2022-09-16 Thread Jason Merrill via Gcc-patches
On 9/15/22 14:03, Patrick Palka wrote: This patch permits accessing 'mutable' members of local objects during constexpr evaluation (which other compilers seem to accept in C++14 mode, while we reject), while continuing to reject it for global objects (as in the last line of

Re: [PATCH] c++: constraint matching, TEMPLATE_ID_EXPR, current inst

2022-09-16 Thread Jason Merrill via Gcc-patches
On 9/15/22 11:58, Patrick Palka wrote: Here we're crashing during constraint matching for the instantiated hidden friends due to two issues with dependent substitution into a TEMPLATE_ID_EXPR naming a template from the current instantiation (as performed from maybe_substitute_reqs_for for C<3>

Re: [PATCH] Introduce -nolibstdc++ option

2022-09-16 Thread Jason Merrill via Gcc-patches
On 9/16/22 07:52, Jason Merrill wrote: On 6/24/22 01:23, Alexandre Oliva via Gcc-patches wrote: On Jun 23, 2022, Alexandre Oliva wrote: Here's the patch.  Regstrapped on x86_64-linux-gnu, also tested with a cross to aarch64-rtems6.  Ok to install? Introduce -nostdlib++ option Uhh, I

Re: [PATCH] Introduce -nolibstdc++ option

2022-09-16 Thread Jason Merrill via Gcc-patches
On 6/24/22 01:23, Alexandre Oliva via Gcc-patches wrote: On Jun 23, 2022, Alexandre Oliva wrote: Here's the patch. Regstrapped on x86_64-linux-gnu, also tested with a cross to aarch64-rtems6. Ok to install? Introduce -nostdlib++ option Uhh, I went ahead and installed this. The earlier

Re: [PATCH] c++: Implement P1467R9 - Extended floating-point types and standard names compiler part except for bfloat16 [PR106652]

2022-09-16 Thread Jason Merrill via Gcc-patches
On 9/12/22 04:05, Jakub Jelinek wrote: Hi! The following patch implements the compiler part of C++23 P1467R9 - Extended floating-point types and standard names compiler part by introducing _Float{16,32,64,128} as keywords and builtin types like they are implemented for C already since GCC 7. It

[PATCH v4] eliminate mutex in fast path of __register_frame

2022-09-16 Thread Thomas Neumann via Gcc-patches
The __register_frame/__deregister_frame functions are used to register unwinding frames from JITed code in a sorted list. That list itself is protected by object_mutex, which leads to terrible performance in multi-threaded code and is somewhat expensive even if single-threaded. There was already

[committed] libstdc++: Document new libstdc++.so symbol versions

2022-09-16 Thread Jonathan Wakely via Gcc-patches
Pushed to trunk. I'll backport the first line to gcc-12 too. -- >8 -- libstdc++-v3/ChangeLog: * doc/xml/manual/abi.xml: Document GLIBCXX_3.4.30 and GLIBCXX_3.4.31 versions. * doc/html/manual/abi.html: Regenerate. --- libstdc++-v3/doc/html/manual/abi.html | 2 +-

Re: [PATCH] Rewrite NAN and sign handling in frange

2022-09-16 Thread Richard Sandiford via Gcc-patches
Aldy Hernandez via Gcc-patches writes: > On Thu, Sep 15, 2022 at 9:06 AM Richard Biener > wrote: >> >> On Thu, Sep 15, 2022 at 7:41 AM Aldy Hernandez wrote: >> > >> > Hi Richard. Hi all. >> > >> > The attatched patch rewrites the NAN and sign handling, dropping both >> > tristates in favor of

[PATCH] vect: Fix SLP layout handling of masked loads [PR106794]

2022-09-16 Thread Richard Sandiford via Gcc-patches
PR106794 shows that I'd forgotten about masked loads when doing the SLP layout changes. These loads can't currently be permuted independently of their mask input, so during construction they never get a load permutation. (If we did support permuting masked loads in future, the mask would need to

[PATCH] vect: Fix missed gather load opportunity

2022-09-16 Thread Richard Sandiford via Gcc-patches
While writing a testcase for PR106794, I noticed that we failed to vectorise the testcase in the patch for SVE. The code that recognises gather loads tries to optimise the point at which the offset is calculated, to avoid unnecessary extensions or truncations: /* Don't include the

Re: [PATCH] c++: modules ICE with typename friend declaration

2022-09-16 Thread Nathan Sidwell via Gcc-patches
Thanks, this looks right. Sigh templates can mess up ones mental invariants! The test case should really be a foo_[ab].C kind, to test both sides of the streaming. Bonus points for using the template after importing. And you need the dg-module-cmi annotation to check /and then delete/ the gcm

RE: [PATCH] i386: Fixed vec_init_dup_v16bf [PR106887]

2022-09-16 Thread Liu, Hongtao via Gcc-patches
> -Original Message- > From: Kong, Lingling > Sent: Friday, September 16, 2022 3:40 PM > To: Hongtao Liu > Cc: gcc-patches@gcc.gnu.org; Liu, Hongtao > Subject: RE: [PATCH] i386: Fixed vec_init_dup_v16bf [PR106887] > > Hi, > > > > machine_mode hvmode = (mode == V16HImode ?

RE: [PATCH] i386: Fixed vec_init_dup_v16bf [PR106887]

2022-09-16 Thread Kong, Lingling via Gcc-patches
Hi, > > machine_mode hvmode = (mode == V16HImode ? V8HImode > > : mode == V16HFmode ? V8HFmode > > +: mode == V16BFmode ? V8BFmode > Can it be written as switch case? Sure, I fixed it in new patch. Thanks again for take a

Re: [PATCH] Modernize ix86_builtin_vectorized_function with corresponding expanders.

2022-09-16 Thread Uros Bizjak via Gcc-patches
On Fri, Sep 16, 2022 at 2:55 AM liuhongt via Gcc-patches wrote: > > For ifloor/lfloor/iceil/lceil/irint/lrint/iround/lround when size of > in_mode is not equal out_mode, vectorizer doesn't go to internal fn > way,still left that part in the ix86_builtin_vectorized_function. > > Remove others

Re: [PATCH] [x86]Don't optimize cmp mem, 0 to load mem, reg + test reg, reg

2022-09-16 Thread Uros Bizjak via Gcc-patches
On Fri, Sep 16, 2022 at 3:32 AM Jeff Law via Gcc-patches wrote: > > > On 9/15/22 19:06, liuhongt via Gcc-patches wrote: > > There's peephole2 submit in 1990s which split cmp mem, 0 to load mem, > > reg + test reg, reg. I don't know exact reason why gcc do this. > > > > For latest x86 processors,

[PATCH] [x86] Adjust issue_rate for latest Intel processors.

2022-09-16 Thread liuhongt via Gcc-patches
For Skylake based processor, decoder is 4-way. For Sunny Cove and Willow Cove, decoder is 5-way. For Golden cove, decoder is 6-way. Bootstrapped and regtested on x86-64-pc-linux-gnu{-m32,}. Ready to install. gcc/ChangeLog: * config/i386/x86-tune-sched.cc (ix86_issue_rate): Adjust for