Re: [PATCH] LoongArch: Support loading floating-point zero into MEM[base + index].

2023-09-01 Thread Xi Ruoyao via Gcc-patches
LGTM. Nit: it should be "storing" floating-point zero into MEM, not "loading". On Sat, 2023-09-02 at 12:47 +0800, Guo Jie wrote: > gcc/ChangeLog: > > * config/loongarch/loongarch.md: Support 'G' -> 'k' in > movsf_hardfloat and movdf_hardfloat. > > gcc/testsuite/ChangeLog: > >  

[PATCH] LoongArch: Support loading floating-point zero into MEM[base + index].

2023-09-01 Thread Guo Jie
gcc/ChangeLog: * config/loongarch/loongarch.md: Support 'G' -> 'k' in movsf_hardfloat and movdf_hardfloat. gcc/testsuite/ChangeLog: * gcc.target/loongarch/const-double-zero-stx.c: New test. --- gcc/config/loongarch/loongarch.md | 12 ++--

[PATCH] ssa_name_has_boolean_range vs signed-boolean:31 types

2023-09-01 Thread Andrew Pinski via Gcc-patches
This turns out to be a latent bug in ssa_name_has_boolean_range where it would return true for all boolean types but all of the uses of ssa_name_has_boolean_range was expecting 0/1 as the range rather than [-1,0]. So when I fixed vector lower to do all comparisons in boolean_type rather than still

Re: [PATCH v6] LoongArch:Implement 128-bit floating point functions in gcc.

2023-09-01 Thread chenglulu
Hi,RuoYao:  I have merged the V6 patch into trunk(r14-3635). If the generic optimization of copysignf128 cannot be solved,  we will mention the optimization code under the architecture again. Thanks! 在 2023/9/1 上午11:22, chenxiaolong 写道: Brief version history of patch set: v1 -> v2:

Re: [PATCH] c++: improve verify_constant diagnostic [PR91483]

2023-09-01 Thread Marek Polacek via Gcc-patches
On Fri, Sep 01, 2023 at 08:00:01PM -0400, Marek Polacek via Gcc-patches wrote: >if (TREE_OVERFLOW_P (t)) > diff --git a/gcc/testsuite/g++.dg/diagnostic/constexpr3.C > b/gcc/testsuite/g++.dg/diagnostic/constexpr3.C > new file mode 100644 > index 000..b6e43a93664 > --- /dev/null > +++

[PATCH] c++: improve verify_constant diagnostic [PR91483]

2023-09-01 Thread Marek Polacek via Gcc-patches
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- When verify_constant complains, it's pretty terse. Consider void test () { constexpr int i = 42; constexpr const int *p = } where it says "'& i' is not a constant expression". OK, but why? With this patch,

Re: [PATCH] diagnostics: Delete config pointer before overwriting it.

2023-09-01 Thread David Malcolm via Gcc-patches
On Fri, 2023-09-01 at 21:16 +0200, Mikael Morin via Gcc-patches wrote: > Hello, > > this is a fix for a small memory leak in the fortran frontend. > Tested on x86_64-pc-linux-gnu, nothing stands out besides the > apparently well-known guality instability. > OK for master ? LGTM, thanks! Dave

Re: [PATCH] analyzer: call off a superseding when diagnostics are unrelated [PR110830]

2023-09-01 Thread David Malcolm via Gcc-patches
On Fri, 2023-09-01 at 21:59 +0200, priour...@gmail.com wrote: > From: benjamin priour > > Hi, > > Patch succesfully regstrapped off trunk > 7f2ed06ddc825e8a4e0edfd1d66b5156e6dc1d34 > on x86_64-linux-gnu. > > Is it OK for trunk ? > > Thanks, > Benjamin. > [...snip...] >   > +/* Walk up the

[pushed] wwwdocs: gcc-12: Improve language around vectorizer and -O2

2023-09-01 Thread Gerald Pfeifer
Pushed. Gerald --- htdocs/gcc-12/changes.html | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/gcc-12/changes.html b/htdocs/gcc-12/changes.html index 3816d06f..b10f2aa4 100644 --- a/htdocs/gcc-12/changes.html +++ b/htdocs/gcc-12/changes.html @@ -127,10

Re: RFC: Introduce -fhardened to enable security-related flags

2023-09-01 Thread Qing Zhao via Gcc-patches
> On Aug 29, 2023, at 3:42 PM, Marek Polacek via Gcc-patches > wrote: > > Improving the security of software has been a major trend in the recent > years. Fortunately, GCC offers a wide variety of flags that enable extra > hardening. These flags aren't enabled by default, though. And since

Re: [PATCH 9/12] libgcc _BitInt support [PR102989]

2023-09-01 Thread Joseph Myers
On Wed, 9 Aug 2023, Jakub Jelinek via Gcc-patches wrote: > I know that soft-fp is owned by glibc and I think the op-common.h change > should be propagated there, but the bitint stuff is really GCC specific > and IMHO doesn't belong into the glibc copy. The op-common.h change is OK for glibc.

Re: [PATCH 14/12] libgcc _BitInt helper documentation [PR102989]

2023-09-01 Thread Joseph Myers
On Tue, 22 Aug 2023, Jakub Jelinek via Gcc-patches wrote: > +significant limb if @var{N} is not divisible by @var{N} should be @var{n}, throughout. > +@deftypefn {Runtime Function} void __bid_fixsdbitint (@code{UBILtype} > *@var{r}, int32_t @var{rprec}, _Decimal32 @var{a}) > +@deftypefnx

Re: [PATCH 8/12] libgcc: Generated tables for _BitInt <-> _Decimal* conversions [PR102989]

2023-09-01 Thread Joseph Myers
On Wed, 9 Aug 2023, Jakub Jelinek via Gcc-patches wrote: > Hi! > > The following patch adds a header with generated helper tables to support > computation of powers of 10 from 10^0 to 10^6111 inclusive into a > sufficiently large array of _BitInt limbs. This is split from the rest > of the

Re: [PATCH] analyzer: implement reference count checking for CPython plugin [PR107646]

2023-09-01 Thread Eric Feng via Gcc-patches
Thank you for the patch! On Fri, Sep 1, 2023 at 10:51 AM David Malcolm wrote: > > On Fri, 2023-09-01 at 04:49 +0200, Hans-Peter Nilsson wrote: > > (Looks like this was committed as r14-3580-g597b9ec69bca8a) > > > > > Cc: g...@gcc.gnu.org, gcc-patches@gcc.gnu.org, Eric Feng > > > > > > From:

Re: [PATCH] Fortran: runtime bounds-checking in presence of array constructors [PR31059]

2023-09-01 Thread Harald Anlauf via Gcc-patches
Hi Mikael, On 9/1/23 10:41, Mikael Morin via Gcc-patches wrote: Le 31/08/2023 à 22:42, Harald Anlauf via Fortran a écrit : Dear all, gfortran's array bounds-checking code does a mostly reasonable job for array sections in expressions and assignments, but forgot the case that (rank-1)

[PATCH] analyzer: call off a superseding when diagnostics are unrelated [PR110830]

2023-09-01 Thread Benjamin Priour via Gcc-patches
From: benjamin priour Hi, Patch succesfully regstrapped off trunk 7f2ed06ddc825e8a4e0edfd1d66b5156e6dc1d34 on x86_64-linux-gnu. Is it OK for trunk ? Thanks, Benjamin. Patch below. --- Before this patch, a saved_diagnostic would supersede another at the same statement if and only its vfunc

[PATCH v2] RISC-V: zicond: Fix opt2 pattern

2023-09-01 Thread Vineet Gupta
This was tripping up gcc.c-torture/execute/pr60003.c at -O1 since in failing case, pattern's asm czero.nez gets both rs2 and rs1 as non zero. We start with the following src code snippet: if (a == 0) return 0; else return x; } which is equivalent to: "x = (a !=

Re: [PATCH] RISC-V: zicond: remove bogus opt2 pattern

2023-09-01 Thread Vineet Gupta
On 9/1/23 10:40, Palmer Dabbelt wrote: Just working through this in email, as there's a lot of double-negatives and I managed to screw up my Linux PR this morning so I may not be thinking that well... The docs say "(if_then_else test true-value false-value)".  So in this case it's   

[PATCH] diagnostics: Delete config pointer before overwriting it.

2023-09-01 Thread Mikael Morin via Gcc-patches
Hello, this is a fix for a small memory leak in the fortran frontend. Tested on x86_64-pc-linux-gnu, nothing stands out besides the apparently well-known guality instability. OK for master ? -- >8 -- Delete m_client_data_hooks before it is reassigned in tree_diagnostics_defaults. This fixes a

[PATCH v2] c: don't emit -Wmissing-variable-declarations for register variables [PR110947]

2023-09-01 Thread Hamza Mahfooz
Resolves: PR c/110947 - Should -Wmissing-variable-declarations not trigger on register variables? gcc/c/ChangeLog: PR c/110947 * c-decl.cc (start_decl): don't emit -Wmissing-variable-declarations for DECL_REGISTER VAR_DECLs. gcc/testsuite/ChangeLog: PR c/110947

Re: [PATCH] RISC-V: zicond: remove bogus opt2 pattern

2023-09-01 Thread Vineet Gupta
On 9/1/23 06:13, Jeff Law wrote: I could very well be mistaken, but define_insn is a pattern match and opt2 has *ne* so the expression has to be in != form and thus needs to work with that condition. No ? My point was  that x = (a != 0) ? x : 0 is equivalent to x = (a == 0) ? 0 : x You

[PATCH] c: don't emit -Wmissing-variable-declarations for register variables [PR110947]

2023-09-01 Thread Hamza Mahfooz
Resolves: PR c/110947 - Should -Wmissing-variable-declarations not trigger on register variables? gcc/c/ChangeLog: PR c/110947 * c-decl.cc (start_decl): don't emit -Wmissing-variable-declarations for DECL_REGISTER VAR_DECLs. gcc/testsuite/ChangeLog: PR c/110947

Re: [PATCH] RISC-V: Add Types to Un-Typed Risc-v Instructions:

2023-09-01 Thread Jeff Law via Gcc-patches
On 8/31/23 11:32, Edwin Lu wrote: Related Discussion: https://inbox.sourceware.org/gcc-patches/12fb5088-3f28-0a69-de1e-f387371a5...@gmail.com/ This patch updates the riscv instructions to ensure that no insn is left without a type attribute. Added new types: "trap" (self explanatory) and

Re: [PATCH] RISC-V: zicond: remove bogus opt2 pattern

2023-09-01 Thread Palmer Dabbelt
On Thu, 31 Aug 2023 10:57:52 PDT (-0700), Vineet Gupta wrote: On 8/31/23 06:51, Jeff Law wrote: On 8/30/23 15:57, Vineet Gupta wrote: This was tripping up gcc.c-torture/execute/pr60003.c at -O1 since the pattern semantics can't be expressed by zicond instructions. This involves test code

Re: [PATCH] c++: Move consteval folding to cp_fold_r

2023-09-01 Thread Marek Polacek via Gcc-patches
On Fri, Sep 01, 2023 at 01:23:48PM -0400, Marek Polacek via Gcc-patches wrote: > --- a/gcc/cp/cp-gimplify.cc > +++ b/gcc/cp/cp-gimplify.cc [...] > case ADDR_EXPR: >if (TREE_CODE (TREE_OPERAND (stmt, 0)) == FUNCTION_DECL > - && DECL_IMMEDIATE_FUNCTION_P (TREE_OPERAND (stmt, 0)))

[PATCH 2/2] VR-VALUES: Rewrite test_for_singularity using range_op_handler

2023-09-01 Thread Andrew Pinski via Gcc-patches
So it turns out there was a simplier way of starting to improve VRP to start to fix PR 110131, PR 108360, and PR 108397. That was rewrite test_for_singularity to use range_op_handler and Value_Range. This patch implements that and OK? Bootstrapped and tested on x86_64-linux-gnu with no

[PATCH 1/2] VR-VALUES: Rename op0/op1 to op1/op2 for test_for_singularity

2023-09-01 Thread Andrew Pinski via Gcc-patches
As requested and make easier to understand with the new ranger code, rename the arguments op0/op1 to op1/op2. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions gcc/ChangeLog: * vr-values.cc (test_for_singularity): Rename arguments op0/op1 to op1/op2. ---

[PATCH] c++: Move consteval folding to cp_fold_r

2023-09-01 Thread Marek Polacek via Gcc-patches
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- In the review of P2564: it turned out that in order to correctly handle an example in the paper, we should stop doing immediate evaluation in build_over_call

[committed] libstdc++: Fix debug-mode tests for constexpr algorithms

2023-09-01 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- These tests started failing at some point: FAIL: 25_algorithms/copy/debug/constexpr_neg.cc (test for errors, line 49) FAIL: 25_algorithms/copy/debug/constexpr_neg.cc (test for excess errors) FAIL: 25_algorithms/equal/debug/constexpr_neg.cc (test

[committed] libstdc++: Add -Wno-self-move to two filesystem tests

2023-09-01 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * testsuite/27_io/filesystem/iterators/91067.cc: Add -Wno-self-move to options. * testsuite/27_io/filesystem/path/assign/copy.cc: Likewise. ---

Re: [PATCH] libstdc++: fix memory clobbering in std::vector [PR110879]

2023-09-01 Thread Jonathan Wakely via Gcc-patches
At Marek and Jason's suggestion I've moved the new test to a subdir: c++: Move new test to 'opt' sub-directory gcc/testsuite/ChangeLog: * g++.dg/pr110879.C: Moved to... * g++.dg/opt/pr110879.C: ...here.

Re: [RFC] libstdc++: Make --enable-libstdcxx-backtrace=auto default to yes

2023-09-01 Thread Jonathan Wakely via Gcc-patches
On Fri, 1 Sept 2023 at 12:16, Jonathan Wakely wrote: > > On Wed, 23 Aug 2023 at 17:03, Jonathan Wakely via Libstdc++ > wrote: > > > > Any objections to this? It's a C++23 feture, so should be enabled by > > default. > > I've pushed this to trunk, so let's see what breaks! This modules header

Re: [PATCH] analyzer: Add support of placement new and improved operator new [PR105948,PR94355]

2023-09-01 Thread David Malcolm via Gcc-patches
On Fri, 2023-09-01 at 16:48 +0200, Benjamin Priour wrote: > Patch has been updated as per your suggestions and successfully > regstrapped > on x86_64-linux-gnu. > > call_details::maybe_get_arg_region is now > /* If argument IDX's svalue at the callsite is of pointer type, >     return the region

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

2023-09-01 Thread Jonathan Wakely via Gcc-patches
On Mon, 31 Oct 2022 at 15:34, Eric Botcazou wrote: > > > 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. > > The tests fail randomly for me on

Re: [PATCH]AArch64 xorsign: Fix scalar xorsign lowering

2023-09-01 Thread Richard Sandiford via Gcc-patches
Tamar Christina writes: >> -Original Message- >> From: Richard Sandiford >> Sent: Friday, September 1, 2023 2:36 PM >> To: Tamar Christina >> Cc: gcc-patches@gcc.gnu.org; nd ; Richard Earnshaw >> ; Marcus Shawcroft >> ; Kyrylo Tkachov >> Subject: Re: [PATCH]AArch64 xorsign: Fix scalar

Re: [PATCH] libstdc++: fix memory clobbering in std::vector [PR110879]

2023-09-01 Thread Jonathan Wakely via Gcc-patches
On Thu, 17 Aug 2023 at 08:43, Vladimir Palevich wrote: > > On Thu, 17 Aug 2023 at 01:51, Jonathan Wakely wrote: > > > > On 09/08/23 01:34 +0300, Vladimir Palevich wrote: > > >Because of the recent change in _M_realloc_insert and _M_default_append, > > >call > > >to deallocate was ordered after

[committed] libstdc++: Use std::string::__resize_and_overwrite in std::filesystem

2023-09-01 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- There are a few places in the std::filesystem code that use a string as a buffer for OS APIs to write to. We can use the new extension __resize_and_overwrite to avoid redundant initialization of those buffers. libstdc++-v3/ChangeLog: *

[committed] libstdc++: Use a loop in atomic_ref::compare_exchange_strong [PR111077]

2023-09-01 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. Backport to gcc-13 needed too. -- >8 -- We need to use a loop in std::atomic_ref::compare_exchange_strong in order to properly implement the C++20 requirement that padding bits do not participate when checking the value for equality. The variable being

Re: [PATCH] analyzer: implement reference count checking for CPython plugin [PR107646]

2023-09-01 Thread David Malcolm via Gcc-patches
On Fri, 2023-09-01 at 04:49 +0200, Hans-Peter Nilsson wrote: > (Looks like this was committed as r14-3580-g597b9ec69bca8a) > > > Cc: g...@gcc.gnu.org, gcc-patches@gcc.gnu.org, Eric Feng > > > > From: Eric Feng via Gcc > > > gcc/testsuite/ChangeLog: > >   PR analyzer/107646 > > *

Re: [PATCH] analyzer: Add support of placement new and improved operator new [PR105948,PR94355]

2023-09-01 Thread Benjamin Priour via Gcc-patches
Patch has been updated as per your suggestions and successfully regstrapped on x86_64-linux-gnu. call_details::maybe_get_arg_region is now /* If argument IDX's svalue at the callsite is of pointer type, return the region it points to. Otherwise return NULL. */ const region *

[PATCH] c++, v3: Diagnose [basic.scope.block]/2 violations even in compound-stmt of function-try-block [PR52953]

2023-09-01 Thread Jakub Jelinek via Gcc-patches
On Fri, Sep 01, 2023 at 03:24:54PM +0200, Jakub Jelinek via Gcc-patches wrote: > So like this? > > It actually changes behaviour on the > void foo (int x) try {} catch (int x) {} case, where previously > this triggered the >|| (TREE_CODE (old) == PARM_DECL >&&

RE: [PATCH]AArch64 xorsign: Fix scalar xorsign lowering

2023-09-01 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Richard Sandiford > Sent: Friday, September 1, 2023 2:36 PM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; nd ; Richard Earnshaw > ; Marcus Shawcroft > ; Kyrylo Tkachov > Subject: Re: [PATCH]AArch64 xorsign: Fix scalar xorsign lowering > > Tamar

[PING][PATCH v2] Add clang's invalid-noreturn warning flag (gnu.org)

2023-09-01 Thread Julian Waters via Gcc-patches
Hi all, this is a gentle ping for the following patch: https://gcc.gnu.org/pipermail/gcc-patches/2023-August/627913.html

Re: [PING][PATCH] LoongArch: initial ada support on linux

2023-09-01 Thread Arnaud Charlet via Gcc-patches
> gcc/ChangeLog: > > * ada/Makefile.rtl: Add LoongArch support. > * ada/libgnarl/s-linux__loongarch.ads: New. > * ada/libgnat/system-linux-loongarch.ads: New. > * config/loongarch/loongarch.h: mark normalized options > passed from driver to gnat1 as explicit for

Re: [PATCH][Ada] Fix syntax errors in expect.c

2023-09-01 Thread Arnaud Charlet via Gcc-patches
Change is OK, thanks! > Noticed trivial syntax errors in gcc/ada/expect.c when tried to compile gcc > 13.2 as cross-compiler for target i686-pc-msdosdjgpp. > > Errors were there since > > Tiedostossa, joka sisällytettiin kohdasta expect.c:54: > expect.c:Funktio ”__gnat_waitpid”: >

Re: [PATCH]AArch64 xorsign: Fix scalar xorsign lowering

2023-09-01 Thread Richard Sandiford via Gcc-patches
Tamar Christina writes: > Hi All, > > In GCC-9 our scalar xorsign pattern broke and we didn't notice it because the > testcase was not strong enough. With this commit > > 8d2d39587d941a40f25ea0144cceb677df115040 is the first bad commit > commit 8d2d39587d941a40f25ea0144cceb677df115040 > Author:

[PATCH] c++, v2: Diagnose [basic.scope.block]/2 violations even for block externs [PR52953]

2023-09-01 Thread Jakub Jelinek via Gcc-patches
On Thu, Aug 31, 2023 at 05:46:28PM -0400, Jason Merrill wrote: > I've suggested this to Core. Thanks. > > So, I'm not really sure what to do. Intuitively the patch seems right > > because even block externs redeclare stuff and change meaning of the > > identifiers and void foo () { int i;

Re: [PATCH] ipa: Self-DCE of uses of removed call LHSs (PR 108007)

2023-09-01 Thread Martin Jambor
Hello and ping. Thanks, Martin On Fri, May 12 2023, Martin Jambor wrote: > Hi, > > PR 108007 is another manifestation where we rely on DCE to clean-up > after IPA-SRA and if the user explicitely switches DCE off, IPA-SRA > can leave behind statements which are fed uninitialized values and >

Re: [PATCH] ipa-sra: Allow IPA-SRA in presence of returns which will be removed

2023-09-01 Thread Martin Jambor
Hello and ping. Thanks, Martin On Fri, Aug 18 2023, Martin Jambor wrote: > Hi, > > testing on 32bit arm revealed that even the simplest case of PR 110378 > was still not resolved there because destructors were returning this > pointer. Needless to say, the return value of those destructors

[PATCH] c++, v2: Diagnose [basic.scope.block]/2 violations even in compound-stmt of function-try-block [PR52953]

2023-09-01 Thread Jakub Jelinek via Gcc-patches
On Thu, Aug 31, 2023 at 03:52:22PM -0400, Jason Merrill wrote: > On 8/31/23 03:20, Jakub Jelinek wrote: > > As the following testcase shows, while check_local_shadow diagnoses most of > > the [basic.scope.block]/2 violations, it doesn't diagnose when parameter's > > name is redeclared inside of

Re: [PATCH] Add Types to Un-Typed Pic Instructions:

2023-09-01 Thread Jeff Law via Gcc-patches
On 8/31/23 17:01, Edwin Lu wrote: Related Discussion: https://inbox.sourceware.org/gcc-patches/12fb5088-3f28-0a69-de1e-f387371a5...@gmail.com/ This patch updates the pic instructions to ensure that no insn is left without a type attribute. Tested for regressions using rv32/64 multilib with

Re: [PATCH] RISC-V: zicond: remove bogus opt2 pattern

2023-09-01 Thread Jeff Law via Gcc-patches
On 8/31/23 11:57, Vineet Gupta wrote: On 8/31/23 06:51, Jeff Law wrote: On 8/30/23 15:57, Vineet Gupta wrote: This was tripping up gcc.c-torture/execute/pr60003.c at -O1 since the pattern semantics can't be expressed by zicond instructions. This involves test code snippet:    if

[PATCH v8 4/4] c++modules: report module mapper files as a dependency

2023-09-01 Thread Ben Boeckel via Gcc-patches
It affects the build, and if used as a static file, can reliably be tracked using the `-MF` mechanism. gcc/cp/: * mapper-client.cc, mapper-client.h (open_module_client): Accept dependency tracking and track module mapper files as dependencies. * module.cc

[PATCH v8 3/4] c++modules: report imported CMI files as dependencies

2023-09-01 Thread Ben Boeckel via Gcc-patches
They affect the build, so report them via `-MF` mechanisms. gcc/cp/ * module.cc (do_import): Report imported CMI files as dependencies. gcc/testsuite/ * g++.dg/modules/depreport-1_a.C: New test. * g++.dg/modules/depreport-1_b.C: New test. *

[PATCH v8 2/4] p1689r5: initial support

2023-09-01 Thread Ben Boeckel via Gcc-patches
This patch implements support for [P1689R5][] to communicate to a build system the C++20 module dependencies to build systems so that they may build `.gcm` files in the proper order. Support is communicated through the following three new flags: - `-fdeps-format=` specifies the format for the

[PATCH v8 0/4] P1689R5 support

2023-09-01 Thread Ben Boeckel via Gcc-patches
Hi, This patch series adds initial support for ISO C++'s [P1689R5][], a format for describing C++ module requirements and provisions based on the source code. This is required because compiling C++ with modules is not embarrassingly parallel and need to be ordered to ensure that `import

[PATCH v8 1/4] spec: add a spec function to join arguments

2023-09-01 Thread Ben Boeckel via Gcc-patches
When passing `-o` flags to other options, the typical `-o foo` spelling leaves a leading whitespace when replacing elsewhere. This ends up creating flags spelled as `-some-option-with-arg= foo.ext` which doesn't parse properly. When attempting to make a spec function to just remove the leading

[PING][PATCH v2 2/2] libstdc++: Use new built-in trait __is_signed

2023-09-01 Thread Ken Matsui via Gcc-patches
Ping for the use of __is_signed built-in. Sincerely, Ken Matsui On Wed, Jul 12, 2023 at 6:45 PM Ken Matsui wrote: > > This patch lets libstdc++ use new built-in trait __is_signed. > > libstdc++-v3/ChangeLog: > > * include/std/type_traits (is_signed): Use __is_signed built-in trait. >

Re: [x86_64 PATCH] Improve __int128 argument passing (in ix86_expand_move).

2023-09-01 Thread Manolis Tsamis
On Fri, Sep 1, 2023 at 3:35 PM Roger Sayle wrote: > > > Hi Manolis, > Many thanks. If you haven't already, could you create/file a > bug report at https://gcc.gnu.org/bugzilla/ which ensures this > doesn't get lost/forgotten. It provides a PR number for tracking > discussions, and patches/fixes

[PING][PATCH v6 2/2] libstdc++: Use new built-in trait __is_pointer

2023-09-01 Thread Ken Matsui via Gcc-patches
Ping for the use of __is_pointer built-in. Sincerely, Ken Matsui On Thu, Jul 13, 2023 at 1:49 PM Ken Matsui wrote: > > This patch lets libstdc++ use new built-in trait __is_pointer. > > libstdc++-v3/ChangeLog: > > * include/bits/cpp_type_traits.h (__is_ptr): Use __is_pointer >

[PING][PATCH v3 2/2] libstdc++: use new built-in trait __is_array

2023-09-01 Thread Ken Matsui via Gcc-patches
Ping for the use of __is_array built-in. Sincerely, Ken Matsui On Fri, Jul 7, 2023 at 10:24 PM Ken Matsui wrote: > > This patch lets libstdc++ use new built-in trait __is_array. > > libstdc++-v3/ChangeLog: > > * include/std/type_traits (is_array): Use __is_array built-in trait. >

[PING][PATCH v10 5/5] libstdc++: Make std::is_object dispatch to new built-in traits

2023-09-01 Thread Ken Matsui via Gcc-patches
Ping for std::is_object. Sincerely, Ken Matsui On Wed, Jul 12, 2023 at 7:42 PM Ken Matsui wrote: > > This patch gets std::is_object to dispatch to new built-in traits, > __is_function and __is_reference. > > libstdc++-v3/ChangeLog: > * include/std/type_traits (is_object): Use new

[PING][PATCH v3 2/2] libstdc++: use new built-in trait __is_const

2023-09-01 Thread Ken Matsui via Gcc-patches
Ping for the use of __is_const built-in. Sincerely, Ken Matsui On Fri, Jul 7, 2023 at 10:27 PM Ken Matsui wrote: > > This patch lets libstdc++ use new built-in trait __is_const. > > libstdc++-v3/ChangeLog: > > * include/std/type_traits (is_const): Use __is_const built-in trait. >

[PING][PATCH v3 2/2] libstdc++: use new built-in trait __is_volatile

2023-09-01 Thread Ken Matsui via Gcc-patches
Ping for the use of __is_volatile built-in. Sincerely, Ken Matsui On Fri, Jul 7, 2023 at 10:19 PM Ken Matsui wrote: > > This patch lets libstdc++ use new built-in trait __is_volatile. > > libstdc++-v3/ChangeLog: > > * include/std/type_traits (is_volatile): Use __is_volatile built-in >

[PATCH]AArch64 xorsign: Fix scalar xorsign lowering

2023-09-01 Thread Tamar Christina via Gcc-patches
Hi All, In GCC-9 our scalar xorsign pattern broke and we didn't notice it because the testcase was not strong enough. With this commit 8d2d39587d941a40f25ea0144cceb677df115040 is the first bad commit commit 8d2d39587d941a40f25ea0144cceb677df115040 Author: Segher Boessenkool Date: Mon Oct 22

RE: [x86_64 PATCH] Improve __int128 argument passing (in ix86_expand_move).

2023-09-01 Thread Roger Sayle
Hi Manolis, Many thanks. If you haven't already, could you create/file a bug report at https://gcc.gnu.org/bugzilla/ which ensures this doesn't get lost/forgotten. It provides a PR number for tracking discussions, and patches/fixes with PR numbers are (often) prioritized during the review and

Re: [PATCH V6] Optimize '(X - N * M) / N' to 'X / N - M' if valid

2023-09-01 Thread Richard Biener via Gcc-patches
On Fri, 1 Sep 2023, Jiufu Guo wrote: > Hi, > > Integer expression "(X - N * M) / N" can be optimized to "X / N - M" with > the below conditions: > 1. There is no wrap/overflow/underflow. >wrap/overflow/underflow breaks the arithmetic operation. > 2. "X - N * M" and "X" are not of opposite

[committed] testsuite: Fix vectcond-1.C FAIL on i686-linux [PR19832]

2023-09-01 Thread Jakub Jelinek via Gcc-patches
On Thu, Aug 31, 2023 at 10:24:10AM -0700, Andrew Pinski via Gcc-patches wrote: > This patch adds the following match patterns to optimize these: > /* (a != b) ? (a - b) : 0 -> (a - b) */ These tests FAIL on i686-linux, with .../gcc/testsuite/gcc.dg/pr110915-1.c:8:1: warning: MMX vector return

[committed] testsuite: Fix up pr110915* tests on i686-linux [PR110915]

2023-09-01 Thread Jakub Jelinek via Gcc-patches
On Wed, Aug 30, 2023 at 03:25:11PM -0700, Andrew Pinski via Gcc-patches wrote: > This simple patch extends the min_value/max_value match to vector integer > types. > Using uniform_integer_cst_p makes this easy. These tests FAIL on i686-linux, with .../gcc/testsuite/gcc.dg/pr110915-1.c:8:1:

[PATCH v2] c++: Catch indirect change of active union member in constexpr [PR101631]

2023-09-01 Thread Nathaniel Shead via Gcc-patches
On Wed, Aug 30, 2023 at 04:28:18PM -0400, Jason Merrill wrote: > On 8/29/23 09:35, Nathaniel Shead wrote: > > This is an attempt to improve the constexpr machinery's handling of > > union lifetime by catching more cases that cause UB. Is this approach > > OK? > > > > I'd also like some feedback

Re: [PING][PATCH 1/2] Ada: Synchronized private extensions are always limited

2023-09-01 Thread Arnaud Charlet via Gcc-patches
> For some reason, your email is endeing up in a strange format, I almost > missed the .patch file attached, making the review harder. Never mind, I was on vacation earlier this month and then busy with a seminar last week, so I started looking at your ping email before the original email which

Re: [PING][PATCH 1/2] Ada: Synchronized private extensions are always limited

2023-09-01 Thread Arnaud Charlet via Gcc-patches
Richard, For some reason, your email is endeing up in a strange format, I almost missed the .patch file attached, making the review harder. There's a typo in the comment added: + -- explicit limitedness implied by a synchronized private extension + -- the does not derive from a

Re: [PATCH 08/13] [APX EGPR] Handle GPR16 only vector move insns

2023-09-01 Thread Jakub Jelinek via Gcc-patches
On Fri, Sep 01, 2023 at 07:34:16PM +0800, Hongyu Wang wrote: > > On Fri, Sep 01, 2023 at 05:07:53PM +0800, Hongyu Wang wrote: > > > Jakub Jelinek via Gcc-patches 于2023年8月31日周四 > > > 17:44写道: > > > > > > > > On Thu, Aug 31, 2023 at 04:20:19PM +0800, Hongyu Wang via Gcc-patches > > > > wrote: > >

Re: [PATCH v3] tree-optimization/110279- Check for nested FMA in reassoc

2023-09-01 Thread Richard Biener via Gcc-patches
On Wed, Aug 9, 2023 at 6:53 PM Di Zhao OS wrote: > > Hi, > > The previous version of this patch tries to solve two problems > at the same time. For better clarity, I'll separate them and > only deal with the "nested" FMA in this version. I plan to > propose another patch in avoiding bad shaped

Re: [PATCH 1/4] RISC-V: Adjust expand_cond_len_{unary,binop,op} api

2023-09-01 Thread Lehua Ding
On 2023/9/1 18:00, Robin Dapp via Gcc-patches wrote: Thanks, LGTM. Thanks, committed these patches. Btw. I haven't forgotten to respond to your last refactor but just didn't find the time yet. I figured I should have some proper draft before suggesting more things :) Well, let's talk

Re: [PATCH 08/13] [APX EGPR] Handle GPR16 only vector move insns

2023-09-01 Thread Hongyu Wang via Gcc-patches
Jakub Jelinek 于2023年9月1日周五 17:20写道: > > On Fri, Sep 01, 2023 at 05:07:53PM +0800, Hongyu Wang wrote: > > Jakub Jelinek via Gcc-patches 于2023年8月31日周四 > > 17:44写道: > > > > > > On Thu, Aug 31, 2023 at 04:20:19PM +0800, Hongyu Wang via Gcc-patches > > > wrote: > > > > For vector move insns like

[PATCH v5 4/4] libstdc++: Optimize is_compound trait performance

2023-09-01 Thread Ken Matsui via Gcc-patches
This patch optimizes the performance of the is_compound trait by dispatching to the new __is_arithmetic built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_compound): Do not use __not_. (is_compound_v): Use is_fundamental_v instead. Signed-off-by: Ken Matsui

Re: [PATCH 06/13] [APX EGPR] Map reg/mem constraints in inline asm to non-EGPR constraint.

2023-09-01 Thread Uros Bizjak via Gcc-patches
On Fri, Sep 1, 2023 at 12:36 PM Hongtao Liu wrote: > > On Fri, Sep 1, 2023 at 5:38 PM Uros Bizjak via Gcc-patches > wrote: > > > > On Fri, Sep 1, 2023 at 11:10 AM Hongyu Wang wrote: > > > > > > Uros Bizjak via Gcc-patches 于2023年8月31日周四 > > > 18:01写道: > > > > > > > > On Thu, Aug 31, 2023 at

[PATCH v5 3/4] libstdc++: Optimize is_fundamental trait performance

2023-09-01 Thread Ken Matsui via Gcc-patches
This patch optimizes the performance of the is_fundamental trait by dispatching to the new __is_arithmetic built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_fundamental_v): Use __is_arithmetic built-in trait. (is_fundamental): Likewise. Optimize the

[PATCH v5 2/4] libstdc++: Optimize is_arithmetic trait performance

2023-09-01 Thread Ken Matsui via Gcc-patches
This patch optimizes the performance of the is_arithmetic trait by dispatching to the new __is_arithmetic built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_arithmetic): Use __is_arithmetic built-in trait. (is_arithmetic_v): Likewise. Signed-off-by:

[PATCH v5 1/4] c++, libstdc++: Implement __is_arithmetic built-in trait

2023-09-01 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_arithmetic. gcc/cp/ChangeLog: * cp-trait.def: Define __is_arithmetic. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_ARITHMETIC. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise.

Re: [PATCH] MATCH: `(nop_convert)-a` into -(nop_convert)a if the negate is single use and a is known not to be signed min value

2023-09-01 Thread Richard Biener via Gcc-patches
On Fri, Sep 1, 2023 at 4:27 AM Andrew Pinski via Gcc-patches wrote: > > This pushes the conversion further down the chain which allows to optimize > away more > conversions in many cases. But when building (T1)(T2)-x it will make simplifying (T1)(T2) more difficult as we'd need a (convert

Re: [RFC] libstdc++: Make --enable-libstdcxx-backtrace=auto default to yes

2023-09-01 Thread Jonathan Wakely via Gcc-patches
On Wed, 23 Aug 2023 at 17:03, Jonathan Wakely via Libstdc++ wrote: > > Any objections to this? It's a C++23 feture, so should be enabled by > default. I've pushed this to trunk, so let's see what breaks! > > -- >8 -- > > This causes libstdc++_libbacktrace.a to be built by default. This might >

[committed] libstdc++: Use dg-require-filesystem-ts in link test

2023-09-01 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- This test expects to be able to link, which fails if there are undefined references to chdir, mkdir etc. in fs_ops.o in the libstdc++.a archive. libstdc++-v3/ChangeLog: * testsuite/27_io/filesystem/path/108636.cc: Add dg-require for

[committed] libstdc++: Avoid useless dependency on read_symlink from tzdb

2023-09-01 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- chrono::tzdb::current_zone uses filesystem::read_symlink, which creates a dependency on the fs_ops.o object in libstdc++.a, which then creates dependencies on several OS functions if --gc-sections isn't used. For more details see PR libstdc++/104167

Re: [PATCH 06/13] [APX EGPR] Map reg/mem constraints in inline asm to non-EGPR constraint.

2023-09-01 Thread Richard Sandiford via Gcc-patches
Uros Bizjak via Gcc-patches writes: > On Thu, Aug 31, 2023 at 11:18 AM Jakub Jelinek via Gcc-patches > wrote: >> >> On Thu, Aug 31, 2023 at 04:20:17PM +0800, Hongyu Wang via Gcc-patches wrote: >> > From: Kong Lingling >> > >> > In inline asm, we do not know if the insn can use EGPR, so disable

RE: [PATCH] RISC-V: Enable VECT_COMPARE_COSTS by default

2023-09-01 Thread Li, Pan2 via Gcc-patches
Committed, thank Robin. Pan -Original Message- From: Gcc-patches On Behalf Of Robin Dapp via Gcc-patches Sent: Friday, September 1, 2023 5:58 PM To: Juzhe-Zhong ; gcc-patches@gcc.gnu.org Cc: kito.ch...@sifive.com; kito.ch...@gmail.com Subject: Re: [PATCH] RISC-V: Enable

RE: [PATCH] RISC-V: Add dynamic LMUL compile option

2023-09-01 Thread Li, Pan2 via Gcc-patches
Committed, thanks Robin. Pan -Original Message- From: Gcc-patches On Behalf Of Robin Dapp via Gcc-patches Sent: Friday, September 1, 2023 5:58 PM To: Juzhe-Zhong ; gcc-patches@gcc.gnu.org Cc: kito.ch...@sifive.com; kito.ch...@gmail.com Subject: Re: [PATCH] RISC-V: Add dynamic LMUL

[committed] libstdc++: Fix how chrono::parse handles errors for time-of-day values

2023-09-01 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- We fail to diagnose an error and extract an incorrect time for cases like "25:59" >> parse("%H:%M", mins). The bad "25" hour value gets ignored (on the basis that we might not care about it if trying to extract something like a weekday or a month

[committed] libstdc++: Simplify __format::_Sink::_M_reset

2023-09-01 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- Using an offset as the second argument instead of an iterator makes it easier for callers, as they don't need to create an lvalue span in order to get an iterator from it for the _M_reset call. libstdc++-v3/ChangeLog: * include/std/format

[committed] libstdc++: Do not allow chrono::parse to overflow for %C [PR111162]

2023-09-01 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: PR libstdc++/62 * include/bits/chrono_io.h (_Parser::Operator()): Check %C values are in range of year::min() to year::max(). * testsuite/std/time/parse.cc: Check out of range centuries.

Re: [RFC] gimple ssa: SCCP - A new PHI optimization pass

2023-09-01 Thread Richard Biener via Gcc-patches
On Fri, 1 Sep 2023, Filip Kastl wrote: > > That's interesting. Your placement at > > > > NEXT_PASS (pass_cd_dce, false /* update_address_taken_p */); > > NEXT_PASS (pass_phiopt, true /* early_p */); > > + NEXT_PASS (pass_sccp); > > > > and > > > >NEXT_PASS

Re: [PATCH] expmed: Allow extract_bit_field via mem for low-precision modes.

2023-09-01 Thread Richard Sandiford via Gcc-patches
Robin Dapp via Gcc-patches writes: >> It's not just a question of which byte though. It's also a question >> of which bit. >> >> One option would be to code-generate for even X and for odd X, and select >> between them at runtime. But that doesn't scale well to 2+2X and 1+1X. >> >> Otherwise

Re: [x86_64 PATCH] Improve __int128 argument passing (in ix86_expand_move).

2023-09-01 Thread Manolis Tsamis
Hi Roger, I've (accidentally) found a codegen regression that I bisected down to this patch. For these two functions: typedef struct { float minx, miny; float maxx, maxy; } AABB; int TestOverlap(AABB a, AABB b) { return a.minx <= b.maxx && a.miny <= b.maxy && a.maxx >= b.minx

Re: [PATCH v4 4/4] libstdc++: Optimize is_compound trait performance

2023-09-01 Thread Ken Matsui via Gcc-patches
On Tue, Aug 8, 2023 at 1:33 PM Jonathan Wakely wrote: > > > > On Tue, 18 Jul 2023 at 08:44, Ken Matsui via Libstdc++ > wrote: >> >> This patch optimizes the performance of the is_compound trait by >> dispatching to the new __is_arithmetic built-in trait. >> >> libstdc++-v3/ChangeLog: >> >>

Re: [PATCH] expmed: Allow extract_bit_field via mem for low-precision modes.

2023-09-01 Thread Robin Dapp via Gcc-patches
> It's not just a question of which byte though. It's also a question > of which bit. > > One option would be to code-generate for even X and for odd X, and select > between them at runtime. But that doesn't scale well to 2+2X and 1+1X. > > Otherwise I think we need to treat the bit position

Re: [PATCH 11/13] [APX EGPR] Handle legacy insns that only support GPR16 (3/5)

2023-09-01 Thread Hongtao Liu via Gcc-patches
On Thu, Aug 31, 2023 at 5:31 PM Richard Biener via Gcc-patches wrote: > > On Thu, Aug 31, 2023 at 11:26 AM Richard Biener > wrote: > > > > On Thu, Aug 31, 2023 at 10:25 AM Hongyu Wang via Gcc-patches > > wrote: > > > > > > From: Kong Lingling > > > > > > Disable EGPR usage for below legacy

Re: [PATCH 06/13] [APX EGPR] Map reg/mem constraints in inline asm to non-EGPR constraint.

2023-09-01 Thread Hongtao Liu via Gcc-patches
On Fri, Sep 1, 2023 at 5:38 PM Uros Bizjak via Gcc-patches wrote: > > On Fri, Sep 1, 2023 at 11:10 AM Hongyu Wang wrote: > > > > Uros Bizjak via Gcc-patches 于2023年8月31日周四 18:01写道: > > > > > > On Thu, Aug 31, 2023 at 11:18 AM Jakub Jelinek via Gcc-patches > > > wrote: > > > > > > > > On Thu,

Re: [PATCH 4/4] RISC-V: Add conditional autovec convert(INT<->FP) patterns

2023-09-01 Thread Robin Dapp via Gcc-patches
This one is OK as well, thanks. Regards Robin

[PATCH] riscv: xtheadcondmov: Don't run tests with -Oz

2023-09-01 Thread Christoph Muellner
From: Christoph Müllner Recently, these xtheadcondmov tests regressed with -Oz: * FAIL: gcc.target/riscv/xtheadcondmov-mveqz-imm-eqz.c * FAIL: gcc.target/riscv/xtheadcondmov-mveqz-imm-not.c * FAIL: gcc.target/riscv/xtheadcondmov-mvnez-imm-cond.c * FAIL:

  1   2   >