[PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-02 Thread Alejandro Colomar
Hi! This operator is as voted in a WG14 meeting yesterday, with the only difference that we name it __lengthof__ instead of _Lengthof, to be able to add it without being bound by ISO bureaucracy. No semantic changes since v12; only the rename, according to what WG14 preferred. WG14 agreed on the

[PATCH v13 4/4] c: Add __lengthof__ operator

2024-10-02 Thread Alejandro Colomar
This operator is similar to sizeof but can only be applied to an array, and returns its number of elements. FUTURE DIRECTIONS: - We should make it work with array parameters to functions, and somehow magically return the number of elements of the array, regardless of it being really a poin

[PATCH] libstdc++: Add __gnu_cxx::__alloc_traits::_Destroy_static_type [PR110057]

2024-10-02 Thread Jonathan Wakely
We could also use this in all containers (and node handles) and in the control block created by std::allocate_shared. To use it for containers we will need to decide whether to change the non-standard std::_Destroy(FwdIter, FwdIter, Allocator&) to use this, or whether to add a new _Destroy_static

[PATCH] libstdc++: Enable _GLIBCXX_ASSERTIONS by default for -O0 [PR112808]

2024-10-02 Thread Jonathan Wakely
I think we should do this. Tested x86_64-linux. -- >8 -- Too many users don't know about -D_GLIBCXX_ASSERTIONS and so are missing valuable checks for C++ standard library preconditions. This change enables libstdc++ assertions by default when compiling with -O0 so that we diagnose more bugs by d

[RFC PATCH] Allow limited extended asm at toplevel

2024-10-02 Thread Jakub Jelinek
Hi! In the Cauldron IPA/LTO BoF we've discussed toplevel asms and it was discussed it would be nice to tell the compiler something about what the toplevel asm does. Sure, I'm aware the kernel people said they aren't willing to use something like that, but perhaps other projects do. And for kerne

[PATCH] testsuite/116596 - fix gcc.dg/vect/slp-11a.c

2024-10-02 Thread Richard Biener
The condition on "vectorizing stmts using SLP" needs to match that of "vectorized 1 loops", obviously. Pushed. PR testsuite/116596 * gcc.dg/vect/slp-11a.c: Fix. --- gcc/testsuite/gcc.dg/vect/slp-11a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsui

[PATCH 3/3] Record template specialization hash

2024-10-02 Thread Richard Biener
For a specific testcase a lot of compile-time is spent in re-hashing hashtable elements upon expansion. The following records the hash in the hash element. This speeds up compilation by 20%. There's probably module-related uses that need to be adjusted. Bootstrap failed (guess I was expecting t

[PATCH 1/3] Speedup iterative_hash_template_arg

2024-10-02 Thread Richard Biener
Using iterative_hash_object is expensive compared to using iterative_hash_hashval_t which is fit for integer sized values. The following reduces the number of perf cycles spent in iterative_hash_template_arg and iterative_hash combined by 20%. Bootstrapped and tested on x86_64-unknown-linux-gnu.

[PATCH 2/3] Release expanded template argument vector

2024-10-02 Thread Richard Biener
This reduces peak memory usage by 20% for a specific testcase. Bootstrapped and tested on x86_64-unknown-linux-gnu. It's very ugly so I'd appreciate suggestions on how to handle such situations better? gcc/cp/ * pt.cc (coerce_template_parms): Release expanded argument vector when

Re: [PATCH 1/3] Speedup iterative_hash_template_arg

2024-10-02 Thread Jason Merrill
On 10/2/24 7:49 AM, Richard Biener wrote: Using iterative_hash_object is expensive compared to using iterative_hash_hashval_t which is fit for integer sized values. The following reduces the number of perf cycles spent in iterative_hash_template_arg and iterative_hash combined by 20%. Bootstrapp

[PATCH v2] Improve vsetvl vconfig alignment

2024-10-02 Thread Dusan Stojkovic
This patch is a new version of: https://gcc.gnu.org/pipermail/gcc-patches/2024-September/662745.html > Can you elaborate a bit on that? Rearranging the CFG shouldn't matter > in general and relying on the specific TARGET_SFB_ALU feels overly > specific. > Why does the same register in the if_then

Re: [RFC PATCH] Allow limited extended asm at toplevel

2024-10-02 Thread Richard Biener
On Wed, 2 Oct 2024, Jakub Jelinek wrote: > Hi! > > In the Cauldron IPA/LTO BoF we've discussed toplevel asms and it was > discussed it would be nice to tell the compiler something about what > the toplevel asm does. Sure, I'm aware the kernel people said they > aren't willing to use something li

Re: [PATCH] [PR113816] AArch64: Use SVE bit op reduction for vector reductions

2024-10-02 Thread Kyrylo Tkachov
> On 2 Oct 2024, at 13:43, Richard Sandiford wrote: > > External email: Use caution opening links or attachments > > > Tamar Christina writes: >> Hi Jennifer, >> >>> -Original Message- >>> From: Richard Sandiford >>> Sent: Tuesday, October 1, 2024 12:20 PM >>> To: Jennifer Schmitz

[PATCH v13 2/4] gcc/: Rename array_type_nelts() => array_type_nelts_minus_one()

2024-10-02 Thread Alejandro Colomar
The old name was misleading. While at it, also rename some temporary variables that are used with this function, for consistency. Link: gcc/ChangeLog: *

[PATCH v13 3/4] Merge definitions of array_type_nelts_top()

2024-10-02 Thread Alejandro Colomar
There were two identical definitions, and none of them are available where they are needed for implementing __nelementsof__. Merge them, and provide the single definition in gcc/tree.{h,cc}, where it's available for __nelementsof__, which will be added in the following commit. gcc/ChangeLog:

[PATCH v13 1/4] contrib/: Add support for Cc: and Link: tags

2024-10-02 Thread Alejandro Colomar
contrib/ChangeLog: * gcc-changelog/git_commit.py (GitCommit): Add support for 'Cc: ' and 'Link: ' tags. Cc: Jason Merrill Signed-off-by: Alejandro Colomar --- contrib/gcc-changelog/git_commit.py | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/gcc

[committed] libstdc++: Fix -Wlong-long warning in

2024-10-02 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. -- >8 -- For 32-bit targets __INT64_TYPE__ expands to long long, which gives a pedwarn for C++98 mode, causing: FAIL: 17_intro/headers/c++1998/all_pedantic_errors.cc -std=gnu++98 (test for excess errors) Excess errors: .../bits/postypes.h:64: error: ISO C+

Re: [PATCH] libstdc++: Fix rounding in chrono::parse

2024-10-02 Thread Jonathan Wakely
Nobody had any comments, so I've pushed it to trunk now. On Thu, 26 Sept 2024 at 13:57, Jonathan Wakely wrote: > > Does this rounding heuristic seem reasonable? I have discussed it with > Howard and he agreed that rounding "2024-09-22 18:34:56" up to the next > day, 2024-09-23, could be surprisin

[PATCH] doc: Drop GCC 2.6 ABI change note for H8/h8300-hms

2024-10-02 Thread Gerald Pfeifer
Hi Jeff, going through doc/install.texi I noticed there is same really old note on h8300-hms, even predating egcs. :-) Shall we drop that? Gerald gcc: PR target/69374 * doc/install.texi (Specific) : Drop GCC 2.6 ABI change note. --- gcc/doc/install.texi | 5 - 1 f

[committed v2] libstdc++: Populate std::time_get::get's %c format for C locale

2024-10-02 Thread Jonathan Wakely
The v1 patch included fixes to a new file for the POSIX-2008 locale, config/locale/ieee_1003.1-2008/time_members.cc, but I haven't actually pushed the POSIX-2008 locale to trunk yet. So this v2 patch removes the changes to that file, and if/when I push the POSIX-2008 work this fix will be in there

[PATCH] libstdc++: Simplify std::aligned_storage and fix for versioned namespace [PR61458]

2024-10-02 Thread Jonathan Wakely
Tested x86_64-linux. -- >8 -- This simplifies the implementation of std::aligned_storage. For the unstable ABI it also fixes the bug where its size is too large when the default alignment is used. We can't fix that for the stable ABI though, so just add a comment about the bug. libstdc++-v3/Chan

[PATCH] un-XFAIL gcc.dg/vect/vect-double-reduc-5.c

2024-10-02 Thread Richard Biener
The testcase now passes, we can handle double reductions with multiple types fine. Pushed. * gcc.dg/vect/vect-double-reduc-5.c: Un-XFAIL everywhere. --- gcc/testsuite/gcc.dg/vect/vect-double-reduc-5.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/gcc/testsuite/g

Re: [RFC PATCH] Allow limited extended asm at toplevel

2024-10-02 Thread Uros Bizjak
On Wed, Oct 2, 2024 at 1:03 PM Jakub Jelinek wrote: > > Hi! > > In the Cauldron IPA/LTO BoF we've discussed toplevel asms and it was > discussed it would be nice to tell the compiler something about what > the toplevel asm does. Sure, I'm aware the kernel people said they > aren't willing to use

[PATCH] Adjust expectation for gcc.dg/vect/slp-19c.c

2024-10-02 Thread Richard Biener
We can now vectorize the first loop with SLP when using V2SImode vectors since then we can handle the non-power-of-two interleaving. We can also SLP the second loop reliably now after adding induction support for VLA vectors. Pushed. * gcc.dg/vect/slp-19c.c: Adjust expectation. --- gcc/t

[PATCH] Adjust gcc.dg/vect/vect-double-reduc-5.c

2024-10-02 Thread Richard Biener
The testcase XPASSes now and should do so everywhere I think. Pushed. * gcc.dg/vect/vect-double-reduc-5.c: Adjust. --- gcc/testsuite/gcc.dg/vect/vect-double-reduc-5.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/gcc/testsuite/gcc.dg/vect/vect-double-reduc-5.c

Re: [PATCH] [PR113816] AArch64: Use SVE bit op reduction for vector reductions

2024-10-02 Thread Richard Sandiford
Tamar Christina writes: > Hi Jennifer, > >> -Original Message- >> From: Richard Sandiford >> Sent: Tuesday, October 1, 2024 12:20 PM >> To: Jennifer Schmitz >> Cc: gcc-patches@gcc.gnu.org; Kyrylo Tkachov >> Subject: Re: [PATCH] [PR113816] AArch64: Use SVE bit op reduction for vector >>

[PATCH] Adjust gcc.dg/vect/slp-12a.c

2024-10-02 Thread Richard Biener
We can now SLP the loop. There's PR116583 tracking that this still fails for VLA vectors when load-lanes doesn't support a group of size 8. We can't express this right now so the testcase keeps FAILing for aarch64 with SVE (but passes now for riscv). Pushed. * gcc.dg/vect/slp-12a.c: Adj

Re: [PATCH v12 0/4] c: Add __nelementsof__ operator

2024-10-02 Thread Alejandro Colomar
Hi! On Sat, Aug 31, 2024 at 04:56:28PM GMT, Alejandro Colomar wrote: > Hi! > > v12 changes: > > - Fix typo in changelog entry. > > For ISO C2y, I'm proposing either nelementsof() or a contracted version > of that name. However, since in GCC we want an uglified name that > already takes four c

[PATCH v3] RISC-V: Implement TARGET_CAN_INLINE_P

2024-10-02 Thread Yangyu Chen
Currently, we lack support for TARGET_CAN_INLINE_P on the RISC-V ISA. As a result, certain functions cannot be optimized with inlining when specific options, such as __attribute__((target("arch=+v"))) . This can lead to potential performance issues when building retargetable binaries for RISC-V. T

Re: [PATCH] phiopt: Fix VCE moving by rewriting it into cast [PR116098]

2024-10-02 Thread Richard Biener
On Wed, Oct 2, 2024 at 1:11 AM Andrew Pinski wrote: > > Phiopt match_and_simplify might move a well defined VCE assign statement > from being conditional to being uncondtitional; that VCE might no longer > being defined. It will need a rewrite into a cast instead. > > This adds the rewriting code

Re: [PATCH] backprop: Fix deleting of a phi node [PR116922]

2024-10-02 Thread Richard Biener
On Wed, Oct 2, 2024 at 5:13 AM Andrew Pinski wrote: > > The problem here is remove_unused_var is called on a name that is > defined by a phi node but it deletes it like removing a normal statement. > remove_phi_node should be called rather than gsi_remove for phinodes. > > Note there is a possibil

[PATCH v2] RISC-V: Improve vsetvl vconfig alignment

2024-10-02 Thread Dusan Stojkovic
This patch is a new version of: https://gcc.gnu.org/pipermail/gcc-patches/2024-September/662745.html > Can you elaborate a bit on that? Rearranging the CFG shouldn't matter > in general and relying on the specific TARGET_SFB_ALU feels overly > specific. > Why does the same register in the if_then

[PATCH v2] RISC-V: Improve vsetvl vconfig alignment

2024-10-02 Thread Dusan Stojkovic
This patch is a new version of: https://gcc.gnu.org/pipermail/gcc-patches/2024-September/662745.html > Can you elaborate a bit on that? Rearranging the CFG shouldn't matter > in general and relying on the specific TARGET_SFB_ALU feels overly > specific. > Why does the same register in the if_then

[PATCH 1/2] aarch64: Split FCMA feature bit from Armv8.3-A

2024-10-02 Thread Andre Vieira
This patch splits out FCMA as a feature from Armv8.3-A and adds it as a separate feature bit which now controls 'TARGET_COMPLEX'. gcc/ChangeLog: * config/aarch64/aarch64-arches.def (FCMA): New feature bit, can not be used as an extension in the command-line. * config/aarc

[PATCH 2/2] aarch64: remove SVE2 requirement from SME and diagnose it as unsupported

2024-10-02 Thread Andre Vieira
As per the AArch64 ISA FEAT_SME does not require FEAT_SVE2, so we are removing that false dependency in GCC. However, we chose for now to not support this combination of features and will diagnose the combination of FEAT_SME without FEAT_SVE2 as unsupported by GCC. We may choose to support this

[PATCH 0/2] aarch64: remove SVE2 requirement from SME and diagnose it as unsupported

2024-10-02 Thread Andre Vieira
This patch series removes the requirement of SVE2 for SME, so when a user passes +sme, SVE2 is not enabled as a result of that. We do this to be compliant with the ISA and behave in a compatible manner to other toolchains, to prevent unexpected behavior when switching between them. However, for th

[patch, testsuite, applied] ad PR52641: Make strict-flex-array-3.c work on int != 32-bit targets

2024-10-02 Thread Georg-Johann Lay
gcc.dg/strict-flex-array-3.c used hard-coded values instead of __SIZEOF_INT__ or equivalent expressions. Fixed as obvious. Plus, on AVR, printf doesn't support %zd, so that expect() is now special-cased. Johann -- testsuite/52641 - Make gcc.dg/strict-flex-array-3.c work on int != 32 bits.

Re: [PATCH] libstdc++: Enable _GLIBCXX_ASSERTIONS by default for -O0 [PR112808]

2024-10-02 Thread Patrick Palka
On Wed, 2 Oct 2024, Jonathan Wakely wrote: > I think we should do this. > > Tested x86_64-linux. > > -- >8 -- > > Too many users don't know about -D_GLIBCXX_ASSERTIONS and so are missing > valuable checks for C++ standard library preconditions. This change > enables libstdc++ assertions by defa

Re: [PATCH] libstdc++: Enable _GLIBCXX_ASSERTIONS by default for -O0 [PR112808]

2024-10-02 Thread Arsen Arsenović
Patrick Palka writes: > On Wed, 2 Oct 2024, Jonathan Wakely wrote: > >> I think we should do this. >> >> Tested x86_64-linux. >> >> -- >8 -- >> >> Too many users don't know about -D_GLIBCXX_ASSERTIONS and so are missing >> valuable checks for C++ standard library preconditions. This change >>

RE: [PATCH 2/2]AArch64: support encoding integer immediates using floating point moves

2024-10-02 Thread Tamar Christina
Hi, > -Original Message- > From: Richard Sandiford > Sent: Monday, September 30, 2024 6:33 PM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; nd ; Richard Earnshaw > ; Marcus Shawcroft > ; ktkac...@gcc.gnu.org > Subject: Re: [PATCH 2/2]AArch64: support encoding integer immediates us

Re: [Fortran, Patch, PR51815, v1] Fix parsing of substring refs in coarrays.

2024-10-02 Thread Andre Vehreschild
Hi Harald, we could do something like this: diff --git a/gcc/fortran/primary.cc b/gcc/fortran/primary.cc index d73d5eaed84..5000906f5f2 100644 --- a/gcc/fortran/primary.cc +++ b/gcc/fortran/primary.cc @@ -2823,6 +2823,16 @@ check_substring: if (substring) primary->ts.u.cl =

[PATCH] gcc-wwwdocs: Mention check-c++-all target for C++ front end patch testing

2024-10-02 Thread Simon Martin
This is a follow-up to the discussion about testing changes to the C++ front end in https://gcc.gnu.org/pipermail/gcc-patches/2024-October/664258.html It also clarifies that the make invocation examples should be made from the *build* tree. Validated fine via https://validator.w3.org. --- htdocs

[PATCH] libstdc++: Fix formatting of chrono::duration with character rep [PR116755]

2024-10-02 Thread Jonathan Wakely
Tested x86_64-linux. -- >8 -- Implement Peter Dimov's suggestion for resolving LWG 4118, which is to use +d.count() so that character types are promoted to an integer type before formatting them. This didn't have unanimous consensus in the committee as Howard Hinnant proposed that we should forma

Re: [PATCH 0/8] [RFC] Introduce floating point fetch_add builtins

2024-10-02 Thread Jonathan Wakely
On Wed, 2 Oct 2024 at 17:48, Matthew Malcomson wrote: > > Thanks Jonathan, > > I agree with your point that having just the check against one of the > overloaded versions is not very robust and having multiple checks against > different versions would be better. > > Unfortunately — while asking

[PATCH] libstdc++: Tweak %c formatting for chrono types

2024-10-02 Thread Jonathan Wakely
Tested x86_64-linux. -- >8 -- libstdc++-v3/ChangeLog: * include/bits/chrono_io.h (__formatter_chrono::_M_c): Add [[unlikely]] attribute to condition for missing %c format in locale. Use %T instead of %H:%M:%S in fallback. --- libstdc++-v3/include/bits/chrono_io.h | 4 ++-

[PATCH 1/2] libstdc++: Make std::construct_at support arrays (LWG 3436)

2024-10-02 Thread Jonathan Wakely
Is the g++ test change OK? Tested x86_64-linux. -- >8 -- The issue was approved at the recent St. Louis meeting, requiring support for bounded arrays, but only without arguments to initialize the array elements. libstdc++-v3/ChangeLog: * include/bits/stl_construct.h (construct_at): Sup

[PATCH 2/2] libstdc++: Do not cast away const-ness in std::construct_at (LWG 3870)

2024-10-02 Thread Jonathan Wakely
Tested x86_64-linux. -- >8 -- This change also requires implementing the proposed resolution of LWG 3216 so that std::make_shared and std::allocate_shared still work, and the proposed resolution of LWG 3891 so that std::expected still works. libstdc++-v3/ChangeLog: * include/bits/shared

Re: [PATCH] tree-optimization/116566 - single lane SLP for VLA inductions

2024-10-02 Thread Andrew Pinski
On Tue, Oct 1, 2024 at 5:04 AM Richard Biener wrote: > > The following adds SLP support for vectorizing single-lane inductions > with variable length vectors. This introduces a bootstrap failure on aarch64 due to a maybe uninitialized variable. inlined from ‘bool vectorizable_induction(loop_

Re: [Fortran, Patch, PR51815, v1] Fix parsing of substring refs in coarrays.

2024-10-02 Thread Harald Anlauf
Hi Andre, Am 02.10.24 um 10:49 schrieb Andre Vehreschild: Hi Harald, we could do something like this: diff --git a/gcc/fortran/primary.cc b/gcc/fortran/primary.cc index d73d5eaed84..5000906f5f2 100644 --- a/gcc/fortran/primary.cc +++ b/gcc/fortran/primary.cc @@ -2823,6 +2823,16 @@ check_substr

[pushed] doc: Drop h8300-hms reference to binaries downloads

2024-10-02 Thread Gerald Pfeifer
There aren't actually any H8/h8300-hms anywhere near our binaries docs, so simply removing this stale reference appears best. Pushed. Gerald gcc: PR target/69374 * doc/install.texi (Specific) : Drop obsolete reference to binaries download docs. --- gcc/doc/install.texi

[PATCH] testsuite/116660 - adjust testcases unexpectedly failing on 32bit sparc

2024-10-02 Thread Richard Biener
Both testcases miss some effective target requires. Pushed. PR testsuite/116660 * gcc.dg/vect/no-scevccp-outer-12.c: Add vect_pack_trunc. * gcc.dg/vect/vect-multitypes-6.c: Add vect_char_add, remove explicit 32bit sparc XFAIL. --- gcc/testsuite/gcc.dg/vect/no-scev

[PATCH v1] Add -ftime-report-wall

2024-10-02 Thread Andi Kleen
From: Andi Kleen Time vars normally use times(2) to get the user/sys/wall time, which is always a system call. I don't think the system time is very useful because most overhead is in user time. If we only use the wall (or monotonic) time modern OS have an optimized path to get it directly from a

[PATCH v2] c: ICE in build_counted_by_ref [PR116735]

2024-10-02 Thread Qing Zhao
From: qing zhao Hi, this is the 2nd version of the patch. compared to the 1st version, the major changes are to address Marek and Jacub's comments. bootstrapped and regression tested on both x86 and aarch64. Okay for committing? thanks. Qing == When handling the counted

Re: [PATCH] RISC-V: Define LOGICAL_OP_NON_SHORT_CIRCUIT to 1 [PR116615]

2024-10-02 Thread Andrew Waterman
On Wed, Oct 2, 2024 at 5:56 AM Jeff Law wrote: > > > > On 9/5/24 12:52 PM, Palmer Dabbelt wrote: > > We have cheap logical ops, so let's just move this back to the default > > to take advantage of the standard branch/op hueristics. > > > > gcc/ChangeLog: > > > > PR target/116615 > > *

Re: [PATCH] expr: Don't clear whole unions [PR116416]

2024-10-02 Thread Jason Merrill
On 10/2/24 3:20 PM, Marek Polacek wrote: On Sat, Sep 28, 2024 at 08:39:12AM +0200, Jakub Jelinek wrote: On Fri, Sep 27, 2024 at 04:01:33PM +0200, Jakub Jelinek wrote: So, I think we should go with (but so far completely untested except for pr78687.C which is optimized with Marek's patch and the

Re: [PATCH] c++: Fix g++.dg/ext/sve-sizeless-1.C regression

2024-10-02 Thread Andrew Pinski
On Fri, Sep 13, 2024 at 12:24 AM Jonathan Wakely wrote: > > I'll wait for Linaro CI to confirm this works, and then push. > > I didn't see the regression because I only tested on x86_64. You never pushed this fix. Thanks, Andrew > > -- >8 -- > > This aarch64-*-* test needs an update for the dia

Re: [PATCH] RISC-V: Define LOGICAL_OP_NON_SHORT_CIRCUIT to 1 [PR116615]

2024-10-02 Thread Jeff Law
On 10/2/24 4:39 PM, Andrew Waterman wrote: On Wed, Oct 2, 2024 at 5:56 AM Jeff Law wrote: On 9/5/24 12:52 PM, Palmer Dabbelt wrote: We have cheap logical ops, so let's just move this back to the default to take advantage of the standard branch/op hueristics. gcc/ChangeLog: PR ta

Re: [PATCH]middle-end: support SLP early break

2024-10-02 Thread Richard Biener
On Tue, 1 Oct 2024, Tamar Christina wrote: > Hi all, > > This patch introduces feature parity for early break int the SLP only > vectorizer. > > The approach taken here is to treat the early exits as root statements for an > SLP tree. This means that we don't need any changes to build_slp to su

Re: [PATCH] RISC-V: Define LOGICAL_OP_NON_SHORT_CIRCUIT to 1 [PR116615]

2024-10-02 Thread Jeff Law
On 9/5/24 12:52 PM, Palmer Dabbelt wrote: We have cheap logical ops, so let's just move this back to the default to take advantage of the standard branch/op hueristics. gcc/ChangeLog: PR target/116615 * config/riscv/riscv.h (LOGICAL_OP_NON_SHORT_CIRCUIT): Remove. So on the BP

Re: [PATCH 2/3] Release expanded template argument vector

2024-10-02 Thread Jason Merrill
On 10/2/24 7:50 AM, Richard Biener wrote: This reduces peak memory usage by 20% for a specific testcase. Bootstrapped and tested on x86_64-unknown-linux-gnu. It's very ugly so I'd appreciate suggestions on how to handle such situations better? gcc/cp/ * pt.cc (coerce_template_parms): R

RE: [PATCH] [PR113816] AArch64: Use SVE bit op reduction for vector reductions

2024-10-02 Thread Tamar Christina
> -Original Message- > From: Kyrylo Tkachov > Sent: Wednesday, October 2, 2024 1:09 PM > To: Richard Sandiford > Cc: Tamar Christina ; Jennifer Schmitz > ; gcc-patches@gcc.gnu.org; Kyrylo Tkachov > > Subject: Re: [PATCH] [PR113816] AArch64: Use SVE bit op reduction for vector > reduction

Re: [PATCH v2] Improve vsetvl vconfig alignment

2024-10-02 Thread Dusan Stojkovic
I accidentally forgot to include RISC-V in the title of the patch. Please ignore this patch since I have sent a fixed one. https://gcc.gnu.org/pipermail/gcc-patches/2024-October/664305.html Sorry for the inconvenience. From: Dusan Stojkovic Sent: Wednesday, October

Re: [PATCH] doc: Drop GCC 2.6 ABI change note for H8/h8300-hms

2024-10-02 Thread Jeff Law
On 10/2/24 4:45 AM, Gerald Pfeifer wrote: Hi Jeff, going through doc/install.texi I noticed there is same really old note on h8300-hms, even predating egcs. :-) Shall we drop that? Yea, I'd think so. I don't think we even have the -hms configurations anymore (they were COFF based IIRC).

[patch,testsuite,applied] ad PR52641: Require int32 for gcc.dg/pr93820-2.c

2024-10-02 Thread Georg-Johann Lay
gcc.dg/pr93820-2.c requires int32, thus added dg-require-effective-target int32. Johann -- testsuite/52641 - Require int32 for gcc.dg/pr93820-2.c. PR testsuite/52641 gcc/testsuite/ * gcc.dg/pr93820-2.c: Add dg-require-effective-target int32. diff --git a/gcc/te

[PATCH] C/116735 - ICE in build_counted_by_ref

2024-10-02 Thread Qing Zhao
From: qing zhao When handling the counted_by attribute, if the corresponding field doesn't exit, in additiion to issue error, we should also remove the already added non-existing "counted_by" attribute from the field_decl. bootstrapped and regression tested on both x86 and aarch64. Okay for comm

[PATCH] libstdc++: Unroll loop in load_bytes function

2024-10-02 Thread Dmitry Ilvokhin
Instead of looping over every byte of the tail, unroll loop manually using switch statement, then compilers (at least GCC and Clang) will generate a jump table [1], which is faster on a microbenchmark [2]. [1]: https://godbolt.org/z/aE8Mq3j5G [2]: https://quick-bench.com/q/ylYLW2R22AZKRvameYYtbYxa

Re: [PATCH] libstdc++: Unroll loop in load_bytes function

2024-10-02 Thread Jonathan Wakely
On Wed, 2 Oct 2024 at 19:16, Jonathan Wakely wrote: > > On Wed, 2 Oct 2024 at 19:15, Dmitry Ilvokhin wrote: > > > > Instead of looping over every byte of the tail, unroll loop manually > > using switch statement, then compilers (at least GCC and Clang) will > > generate a jump table [1], which is

Re: [PATCH] libstdc++: Unroll loop in load_bytes function

2024-10-02 Thread Jonathan Wakely
On Wed, 2 Oct 2024 at 19:15, Dmitry Ilvokhin wrote: > > Instead of looping over every byte of the tail, unroll loop manually > using switch statement, then compilers (at least GCC and Clang) will > generate a jump table [1], which is faster on a microbenchmark [2]. > > [1]: https://godbolt.org/z/a

Re: [PATCH] libstdc++: Unroll loop in load_bytes function

2024-10-02 Thread Jonathan Wakely
On Wed, 2 Oct 2024 at 19:25, Jonathan Wakely wrote: > > On Wed, 2 Oct 2024 at 19:16, Jonathan Wakely wrote: > > > > On Wed, 2 Oct 2024 at 19:15, Dmitry Ilvokhin wrote: > > > > > > Instead of looping over every byte of the tail, unroll loop manually > > > using switch statement, then compilers (a

Re: [PATCH] expr: Don't clear whole unions [PR116416]

2024-10-02 Thread Marek Polacek
On Sat, Sep 28, 2024 at 08:39:12AM +0200, Jakub Jelinek wrote: > On Fri, Sep 27, 2024 at 04:01:33PM +0200, Jakub Jelinek wrote: > > So, I think we should go with (but so far completely untested except > > for pr78687.C which is optimized with Marek's patch and the above testcase > > which doesn't h

Re: [RFC PATCH] Allow limited extended asm at toplevel

2024-10-02 Thread Andi Kleen
Jakub Jelinek writes: > And for kernel perhaps we should add some new option which allows > some dumb parsing of the toplevel asms and gather something from that > parsing. See also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107779 > The restrictions I've implemented are: > 1) asm qualifiers

Re: [RFC PATCH] Allow limited extended asm at toplevel

2024-10-02 Thread Jakub Jelinek
On Wed, Oct 02, 2024 at 01:59:03PM +0200, Richard Biener wrote: > As you are using input constraints to mark symbol uses maybe we can > use output constraints with a magic identifier (and a constraint letter > specifying 'identifier'): > > asm (".globl %0; %0: ret" : "_D" (extern int foo()) : ...)

[PATCH] Replace another missed iterative_hash_object

2024-10-02 Thread Richard Biener
I missed one that's actually hit quite a lot, hashing of the canonical type TYPE_HASH. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed as obvious after the previous approval. Richard. * pt.cc (iterative_hash_template_arg): Use iterative_hash_hashval_t to hash TYPE_HAS

Re: [PATCH v2] c++: Don't ICE due to artificial constructor parameters [PR116722]

2024-10-02 Thread Simon Martin
Hi Jason, On 2 Oct 2024, at 0:18, Jason Merrill wrote: > On 10/1/24 12:44 PM, Simon Martin wrote: >> Hi Jason, >> >> On 30 Sep 2024, at 19:56, Jason Merrill wrote: >> >>> On 9/23/24 4:44 AM, Simon Martin wrote: Hi Jason, On 20 Sep 2024, at 18:01, Jason Merrill wrote: > On

[PATCH] testsuite: Unset torture_current_flags after use

2024-10-02 Thread Richard Sandiford
Before running a test with specific torture options, gcc-dg-runtest sets the global variable torture_current_flags to the set of torture options that will be used. However, it never unset the variable afterwards, which meant that the last options would hang around and potentially confuse later non

[PATCH] testsuite: Make check-function-bodies work with LTO

2024-10-02 Thread Richard Sandiford
This patch tries to make check-function-bodies automatically choose between reading the regular assembly file and reading the LTO assembly file. There should only ever be one right answer, since check-function-bodies doesn't make sense on slim LTO output. Maybe this will turn out to be impossible

[PATCH] aarch64: Fix SVE ACLE gimple folds for C++ LTO [PR116629]

2024-10-02 Thread Richard Sandiford
The SVE ACLE code has two ways of handling overloaded functions. One, used by C, is to define a single dummy function for each unique overloaded name, with resolve_overloaded_builtin then resolving calls to real non-overloaded functions. The other, used by C++, is to define a separate function for

Re: [PATCH] testsuite: Unset torture_current_flags after use

2024-10-02 Thread Richard Biener
> Am 02.10.2024 um 15:48 schrieb Richard Sandiford : > > Before running a test with specific torture options, gcc-dg-runtest > sets the global variable torture_current_flags to the set of torture > options that will be used. However, it never unset the variable > afterwards, which meant that

Re: [PATCH] middle-end: Fix ifcvt predicate generation for masked function calls

2024-10-02 Thread Victor Do Nascimento
On 10/1/24 13:10, Richard Biener wrote: On Mon, Sep 30, 2024 at 8:40 PM Tamar Christina wrote: Hi Victor, Thanks! This looks good to me with one minor comment: -Original Message- From: Victor Do Nascimento Sent: Monday, September 30, 2024 2:34 PM To: gcc-patches@gcc.gnu.org Cc: Tam

Re: [PATCH] C/116735 - ICE in build_counted_by_ref

2024-10-02 Thread Jakub Jelinek
On Wed, Oct 02, 2024 at 11:48:16AM -0400, Marek Polacek wrote: > > + error_at (DECL_SOURCE_LOCATION (field_decl), > > + "argument %qE to the %qE attribute is not a field declaration" > > + " in the same structure as %qD", fieldname, > > + (get_attribute_name (attr

[PATCH] middle-end: reorder masking priority of math functions

2024-10-02 Thread Victor Do Nascimento
Given the categorization of math built-in functions as `ECF_CONST', when if-converting their uses, their calls are not masked and are thus called with an all-true predicate. This, however, is not appropriate where built-ins have library equivalents, wherein they may exhibit highly architecture-spe

Re: [PATCH] Fix const constraint in std::stable_sort and std::inplace_merge

2024-10-02 Thread Jonathan Wakely
On Wed, 25 Sept 2024 at 18:22, François Dumont wrote: > > Hi > > Once https://gcc.gnu.org/pipermail/libstdc++/2024-September/059568.html > will be accepted we will be able fix this long lasting issue that > std::stable_sort and std::inplace_merge are forcing the functor to take > const& parameters

Re: [PATCH 0/8] [RFC] Introduce floating point fetch_add builtins

2024-10-02 Thread Matthew Malcomson
Thanks Jonathan, I agree with your point that having just the check against one of the overloaded versions is not very robust and having multiple checks against different versions would be better. Unfortunately - while asking the clang folk about this I realised that clang doesn't expose the r

[patch,avr,applied] Make gcc.dg/pr113596.c work on AVR

2024-10-02 Thread Georg-Johann Lay
gcc.dg/pr113596.c alloca'tes up to 8 KiB on stack, which is too much for AVR. This patch requests less memory on AVR. Johann -- AVR: Make gcc.dg/pr113596.c work. gcc/testsuite/ * gcc.dg/pr113596.c: Require less memory so it works on AVR. diff --git a/gcc/testsuite/gcc.dg

[PATCH v4 3/7] OpenMP: C front-end support for dispatch + adjust_args

2024-10-02 Thread Paul-Antoine Arras
This patch adds support to the C front-end to parse the `dispatch` construct and the `adjust_args` clause. It also includes some common C/C++ bits for pragmas and attributes. Additional common C/C++ testcases are in a later patch in the series. gcc/c-family/ChangeLog: * c-attribs.cc (c_c

[PATCH v4 1/7] OpenMP: dispatch + adjust_args tree data structures and front-end interfaces

2024-10-02 Thread Paul-Antoine Arras
This patch introduces the OMP_DISPATCH tree node, as well as two new clauses `nocontext` and `novariants`. It defines/exposes interfaces that will be used in subsequent patches that add front-end and middle-end support, but nothing generates these nodes yet. gcc/ChangeLog: * builtin-types

[PATCH v4 0/7] OpenMP: dispatch + adjust_args support

2024-10-02 Thread Paul-Antoine Arras
This is a respin of my patchset implementing both the `dispatch` construct and the `adjust_args` clause to the `declare variant` directive. The previous submission can be found there: https://gcc.gnu.org/pipermail/gcc-patches/2024-August/659719.html Compared to v3, this new iteration handles Tobi

[PATCH v4 5/7] OpenMP: common C/C++ testcases for dispatch + adjust_args

2024-10-02 Thread Paul-Antoine Arras
gcc/testsuite/ChangeLog: * c-c++-common/gomp/declare-variant-2.c: Adjust dg-error directives. * c-c++-common/gomp/adjust-args-1.c: New test. * c-c++-common/gomp/adjust-args-2.c: New test. * c-c++-common/gomp/dispatch-1.c: New test. * c-c++-common/gomp/dispat

Re: [PATCH] C/116735 - ICE in build_counted_by_ref

2024-10-02 Thread Qing Zhao
> On Oct 2, 2024, at 11:48, Marek Polacek wrote: > > On Wed, Oct 02, 2024 at 03:26:26PM +, Qing Zhao wrote: >> From: qing zhao >> >> When handling the counted_by attribute, if the corresponding field >> doesn't exit, in additiion to issue error, we should also remove >> the already added

[PATCH v4 6/7] OpenMP: Fortran front-end support for dispatch + adjust_args

2024-10-02 Thread Paul-Antoine Arras
This patch adds support for the `dispatch` construct and the `adjust_args` clause to the Fortran front-end. Handling of `adjust_args` across translation units is missing due to PR115271. gcc/fortran/ChangeLog: * dump-parse-tree.cc (show_omp_clauses): Handle novariants and nocontext

[PATCH v4 2/7] OpenMP: middle-end support for dispatch + adjust_args

2024-10-02 Thread Paul-Antoine Arras
This patch adds middle-end support for the `dispatch` construct and the `adjust_args` clause. The heavy lifting is done in `gimplify_omp_dispatch` and `gimplify_call_expr` respectively. For `adjust_args`, this mostly consists in emitting a call to `gomp_get_mapped_ptr` for the adequate device. For

[PATCH v4 7/7] OpenMP: update documentation for dispatch and adjust_args

2024-10-02 Thread Paul-Antoine Arras
libgomp/ChangeLog: * libgomp.texi: --- libgomp/libgomp.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libgomp/libgomp.texi b/libgomp/libgomp.texi index c6464ece32e..7026f32f867 100644 --- a/libgomp/libgomp.texi +++ b/libgomp/libgomp.texi @@ -294,8 +294,8 @@ T

[PATCH v4 4/7] OpenMP: C++ front-end support for dispatch + adjust_args

2024-10-02 Thread Paul-Antoine Arras
This patch adds C++ support for the `dispatch` construct and the `adjust_args` clause. It relies on the c-family bits comprised in the corresponding C front end patch for pragmas and attributes. Additional C/C++ common testcases are provided in a subsequent patch in the series. gcc/cp/ChangeLog:

Re: [PATCH] C/116735 - ICE in build_counted_by_ref

2024-10-02 Thread Qing Zhao
> On Oct 2, 2024, at 12:05, Jakub Jelinek wrote: > > On Wed, Oct 02, 2024 at 11:48:16AM -0400, Marek Polacek wrote: >>> + error_at (DECL_SOURCE_LOCATION (field_decl), >>> + "argument %qE to the %qE attribute is not a field declaration" >>> + " in the same structure as %qD", fieldname, >>>

Re: [PATCH][_Hashtable] Fix some implementation inconsistencies

2024-10-02 Thread Jonathan Wakely
On Mon, 13 May 2024 at 05:34, François Dumont wrote: > > libstdc++: [_Hashtable] Fix some implementation inconsistencies > > Get rid of the different usages of the mutable keyword except in > _Prime_rehash_policy where it is preserved for abi compatibility > reason. > > Fix com

Re: [PATCH] Fix const constraint in std::stable_sort and std::inplace_merge

2024-10-02 Thread Jonathan Wakely
On Wed, 2 Oct 2024 at 17:39, Jonathan Wakely wrote: > > On Wed, 25 Sept 2024 at 18:22, François Dumont wrote: > > > > Hi > > > > Once https://gcc.gnu.org/pipermail/libstdc++/2024-September/059568.html > > will be accepted we will be able fix this long lasting issue that > > std::stable_sort and s

Re: [PATCH] RISC-V: Define LOGICAL_OP_NON_SHORT_CIRCUIT to 1 [PR116615]

2024-10-02 Thread Andrew Waterman
On Wed, Oct 2, 2024 at 4:41 PM Jeff Law wrote: > > > > On 10/2/24 4:39 PM, Andrew Waterman wrote: > > On Wed, Oct 2, 2024 at 5:56 AM Jeff Law wrote: > >> > >> > >> > >> On 9/5/24 12:52 PM, Palmer Dabbelt wrote: > >>> We have cheap logical ops, so let's just move this back to the default > >>> to

[PATCH] aarch64: Fix early ra for -fno-delete-dead-exceptions [PR116927]

2024-10-02 Thread Andrew Pinski
Early-RA was considering throwing instructions as being dead and removing them even if -fno-delete-dead-exceptions was in use. This fixes that oversight. Built and tested for aarch64-linux-gnu. PR target/116927 gcc/ChangeLog: * config/aarch64/aarch64-early-ra.cc (early_ra::is_de

Re: [PATCH v1] Add -ftime-report-wall

2024-10-02 Thread David Malcolm
On Wed, 2024-10-02 at 14:14 -0700, Andi Kleen wrote: > From: Andi Kleen > > Time vars normally use times(2) to get the user/sys/wall time, which > is always a > system call. I don't think the system time is very useful because > most overhead > is in user time. If we only use the wall (or monoton

[patch,testsuite,applied] Fix gcc.dg/signbit-6.c for int != 32-bit targets

2024-10-02 Thread Georg-Johann Lay
This test failed on int != 32-bit targets due to a[0] = b[0] = INT_MIN instead of using INT32_MIN. Johann -- testsuite/52641 - Fix gcc.dg/signbit-6.c for int != 32-bit targets. PR testsuite/52641 gcc/testsuite/ * gcc.dg/signbit-6.c (main): Initialize a[0] and b[

  1   2   >