Re: [PATCH 10/10] c++/modules: Validate external linkage definitions in header units [PR116401]

2024-09-25 Thread Nathaniel Shead
On Tue, Sep 24, 2024 at 09:47:17AM +1000, Nathaniel Shead wrote: > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > -- >8 -- > > [module.import] p6 says "A header unit shall not contain a definition of > a non-inline function or variable whose name has external linkage." > >

[r15-3862 Regression] FAIL: gcc.dg/pr109393.c scan-tree-dump-times optimized "return 1;" 3 on Linux/x86_64

2024-09-25 Thread haochen.jiang
On Linux/x86_64, 08b8341f209be7c7e301853bdbbcad4f8e1695f5 is the first bad commit commit 08b8341f209be7c7e301853bdbbcad4f8e1695f5 Author: Konstantinos Eleftheriou Date: Thu Sep 5 15:59:59 2024 +0200 match: Change (A * B) + (-C) to (B - C/A) * A, if C multiple of A [PR109393] caused FAIL:

[COMMITTED] testsuite: Fix testcase g++.dg/modules/indirect-1_b.C [PR116846]

2024-09-25 Thread Nathaniel Shead
Tested x86_64-pc-linux-gnu, committing as obvious. -- >8 -- r15-3878 exposed a mistake in the testcase, probably from an older version of the dumping logic. Apart from the slightly different syntax for the dump line, also check for importing the type_decl rather than the const_decl (we need the

[PATCH] configure: Always add pre-installed header directories to search path

2024-09-25 Thread Stephanos Ioannidis
configure script was adding the target directory flags, including the '-B' flags for the executable prefix and the '-isystem' flags for the pre-installed header directories, to the target flags only for non-Canadian builds under the premise that the host binaries under the executable prefix will no

Re: [PATCH] libgcc, libstdc++: Make more entities no longer TU-local [PR115126]

2024-09-25 Thread Nathaniel Shead
On Wed, Sep 25, 2024 at 01:30:55PM +0200, Jakub Jelinek wrote: > On Wed, Sep 25, 2024 at 12:18:07PM +0100, Jonathan Wakely wrote: > > > > And whether similarly we couldn't use > > > > __attribute__((__visibility__ ("hidden"))) on the static block scope > > > > vars for C++ (again, if compiler supp

Re: [PATCH v2] gfortran testsuite: Remove unit-files in files having open-statements, PR116701

2024-09-25 Thread rep . dot . nop
On 25 September 2024 13:51:07 CEST, Andre Vehreschild wrote: >Hi Hans-Peter, > >preface: I am not a testsuite nor an m4 expert. > >So I may be wrong in arguing that your changes look reasonable. I like the >"automatic" clean-up process very much. So by me, ok for mainline. But you may >want to wai

Re: [PATCH] c++: compile time evaluation of prvalues [PR116416]

2024-09-25 Thread Jason Merrill
On 9/25/24 4:21 PM, Marek Polacek wrote: On Wed, Sep 25, 2024 at 08:54:46AM -0400, Jason Merrill wrote: On 9/24/24 5:10 PM, Marek Polacek wrote: On Fri, Sep 20, 2024 at 06:39:52PM -0400, Jason Merrill wrote: On 9/20/24 12:18 AM, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-g

Re: [PATCH] c++: compile time evaluation of prvalues [PR116416]

2024-09-25 Thread Marek Polacek
On Wed, Sep 25, 2024 at 08:54:46AM -0400, Jason Merrill wrote: > On 9/24/24 5:10 PM, Marek Polacek wrote: > > On Fri, Sep 20, 2024 at 06:39:52PM -0400, Jason Merrill wrote: > > > On 9/20/24 12:18 AM, Marek Polacek wrote: > > > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > >

[PATCH] c++/coro: ignore cleanup_point_exprs while expanding awaits [PR116793]

2024-09-25 Thread Arsen Arsenović
Tested on x86_64-pc-linux-gnu. OK for trunk? TIA -- >8 -- If we reach a CLEANUP_POINT_EXPR while trying to walk statements, we actually care about the statement or statement list contained within it. Indeed, such a construction started happening with r15-3513-g964577c31df206, aft

ping: [PATCH] libcpp: Support extended characters for #pragma {push,pop}_macro [PR109704]

2024-09-25 Thread Lewis Hyatt
Hello- May I please ping this one? Is there something maybe sub-optimal about how I organized it? I can adjust or break it into two maybe if that's helpful. Or else, if it's just that #pragma push_macro is not widely used or cared about... I think it's still worth fixing clear gaps in the support

[COMMITTED 1/2] testsuite: fix dejagnu typos with underscores

2024-09-25 Thread Sam James
Fix typos in dejagnu 'dg-*' directives with erroneous underscores like 'dg_'. gcc/testsuite/ChangeLog: PR debug/30161 PR c++/91826 PR c++/116846 * g++.dg/debug/dwarf2/template-func-params-7.C: Fix errant underscore. Cleanup whitespace in directives too.

[COMMITTED 2/2] testsuite: XFAIL g++.dg/modules/indirect-1_b.C

2024-09-25 Thread Sam James
Mark the newly typo-fixed dg-final bits as XFAIL until investigated. gcc/testsuite/ChangeLog: PR c++/116846 * g++.dg/modules/indirect-1_b.C: Add XFAIL. --- Committed as obvious. gcc/testsuite/g++.dg/modules/indirect-1_b.C | 9 + 1 file changed, 5 insertions(+), 4 deletio

Re: [PATCH] gfortran testsuite: Remove unit-files in files having open-statements, PR116701

2024-09-25 Thread rep . dot . nop
>Your interpretation of my typo is correct. Along with Andre I like auto >cleanup. On new test cases we try to have them self delete whether they pass >or fail. > so why don't we issue the cleanup then, regardless? >So your changes are ok with me. > >> No. >> >>>

Re: [PATCH] x86: Extend AVX512 Vectorization for Popcount in Various Modes

2024-09-25 Thread Hongtao Liu
On Tue, Sep 24, 2024 at 10:16 AM Levy Hsu wrote: > > This patch enables vectorization of the popcount operation for V2QI, V4QI, > V8QI, V2HI, V4HI, and V2SI modes. Ok. > > gcc/ChangeLog: > > * config/i386/mmx.md: > (VQI_16_32_64): New mode iterator for 8-byte, 4-byte, and 2-byte >

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

2024-09-25 Thread Jennifer Schmitz
This patch implements the optabs reduc_and_scal_, reduc_ior_scal_, and reduc_xor_scal_ for Advanced SIMD integers for TARGET_SVE in order to use the SVE instructions ANDV, ORV, and EORV for fixed-width bitwise reductions. For example, the test case int32_t foo (int32_t *a) { int32_t b = -1; fo

Re: [PATCH] x86/{,V}AES: adjust when to force EVEX encoding

2024-09-25 Thread Hongtao Liu
On Wed, Sep 25, 2024 at 2:56 PM Jan Beulich wrote: > > Commit a79d13a01f8c ("i386: Fix aes/vaes patterns [PR114576]") correctly > said "..., but we need to emit {evex} prefix in the assembly if AES ISA > is not enabled". Yet it did so only for the TARGET_AES insns. Going from > the alternative cho

[PATCH] i386, v2: Add GENERIC and GIMPLE folders of __builtin_ia32_{min,max}* [PR116738]

2024-09-25 Thread Jakub Jelinek
On Wed, Sep 25, 2024 at 10:17:50AM +0800, Hongtao Liu wrote: > > + for (int i = 0; i < 2; ++i) > > + { > > + unsigned count = vector_cst_encoded_nelts (args[i]), j; > > + for (j = 0; j < count; ++j) > > + if (!tree_expr_nan_p (VECTOR

Re: [PATCH] x86/{,V}AES: adjust when to force EVEX encoding

2024-09-25 Thread Jan Beulich
On 25.09.2024 10:52, Hongtao Liu wrote: > On Wed, Sep 25, 2024 at 3:55 PM Jan Beulich wrote: >> >> On 25.09.2024 09:38, Hongtao Liu wrote: >>> On Wed, Sep 25, 2024 at 2:56 PM Jan Beulich wrote: Commit a79d13a01f8c ("i386: Fix aes/vaes patterns [PR114576]") correctly said "..., but

Re: [PATCH] i386, v2: Add GENERIC and GIMPLE folders of __builtin_ia32_{min,max}* [PR116738]

2024-09-25 Thread Hongtao Liu
On Wed, Sep 25, 2024 at 4:42 PM Jakub Jelinek wrote: > > On Wed, Sep 25, 2024 at 10:17:50AM +0800, Hongtao Liu wrote: > > > + for (int i = 0; i < 2; ++i) > > > + { > > > + unsigned count = vector_cst_encoded_nelts (args[i]), j; > > > + for (j = 0;

Re: [PATCH 1/3] Add an alternative testcase for PR 70740

2024-09-25 Thread Richard Biener
On Tue, Sep 24, 2024 at 6:14 PM Andrew Pinski wrote: > > While looking into improving phiprop, I noticed that > the current pr70740.c testcase was being optimized almost > all the way before phiprop because the addresses were considered > the same; the arrays were all zero in size. > > This adds a

[PATCH] MATCH: Simplify `min(a, b) op max(a, b)` to `a op b` [PR109401]

2024-09-25 Thread Eikansh Gupta
This patch simplify `min(a,b) op max(a,b)` to `a op b`. This optimization will work for all the binary commutative operations. So, the `op` here can be one of {plus, mult, bit_and, bit_xor, bit_ior, eq, ne, min, max}. PR tree-optimization/109878 PR 109401 gcc/ChangeLog: *

Re: [PATCH 2/3] phiprop: Skip over clobbers [PR116823]

2024-09-25 Thread Richard Biener
On Tue, Sep 24, 2024 at 6:15 PM Andrew Pinski wrote: > > In C++ code the clobber gets in the way of phiprop. > E.g. > ``` > if (lr_bitpos.2401_412 < rr_bitpos.2402_413) > goto ; [INV] > else > goto ; [INV] > >: > >: > MEM[(struct poly_int *)&D.192544] ={v} {CLOBBER(bob)}; >

Re: [PATCH 3/3] phiprop: VOP phi confuses phiprop [PR116824]

2024-09-25 Thread Richard Biener
On Tue, Sep 24, 2024 at 6:14 PM Andrew Pinski wrote: > > Another small phiprop improvement, in some cases > we could have a vop defining statement be a phi which might > be the same bb as the load happens. This is ok since the phi > here is not a store so we can just accept it. > > Bootstrapped an

Re: [PATCH] x86/{,V}AES: adjust when to force EVEX encoding

2024-09-25 Thread Hongtao Liu
On Wed, Sep 25, 2024 at 3:55 PM Jan Beulich wrote: > > On 25.09.2024 09:38, Hongtao Liu wrote: > > On Wed, Sep 25, 2024 at 2:56 PM Jan Beulich wrote: > >> > >> Commit a79d13a01f8c ("i386: Fix aes/vaes patterns [PR114576]") correctly > >> said "..., but we need to emit {evex} prefix in the assembl

Re: [PATCH] x86/{,V}AES: adjust when to force EVEX encoding

2024-09-25 Thread Jan Beulich
On 25.09.2024 09:38, Hongtao Liu wrote: > On Wed, Sep 25, 2024 at 2:56 PM Jan Beulich wrote: >> >> Commit a79d13a01f8c ("i386: Fix aes/vaes patterns [PR114576]") correctly >> said "..., but we need to emit {evex} prefix in the assembly if AES ISA >> is not enabled". Yet it did so only for the TARG

Re: [PATCH] Fortran: Added support for locality specs in DO CONCURRENT (Fortran 2018/23)

2024-09-25 Thread Andre Vehreschild
Hi all, I finally managed to apply the fixed patch. It still had some stray line break so check_GNU_style.py wouldn't succeed. But with that fixed I agree to have only some nonsense bickering of the script. As to the patch (I have stripped large parts.): > diff --git a/gcc/fortran/gfortran.h b/g

Re: [PATCH] libgcc, libstdc++: Make more entities no longer TU-local [PR115126]

2024-09-25 Thread Jakub Jelinek
On Wed, Sep 25, 2024 at 10:43:50AM +0100, Jonathan Wakely wrote: > > libgcc/ChangeLog: > > > > * gthr-posix.h (__GTHREAD_INLINE): New macro. > > (__gthread_active): Convert from variable to function. > > (__gthread_trigger): Mark as __GTHREAD_INLINE instead of static. > >

[Fortran, Patch, PR80235, v1] Fix ICE when coarray from module is referenced in submodule.

2024-09-25 Thread Andre Vehreschild
Hi all and esp. Paul, the attached patch fixes an ICE with coarrays defined in modules and then used in submodules. Referencing the variable relied on the curr_module being set in the gfc_build_qualified_array routine, which it was not. I therefore took the name from the symbol. I don't know if th

Re: [PATCH v2] Provide more contexts for -Warray-bounds warning messages

2024-09-25 Thread Qing Zhao
Sorry for the late reply (just back to work after the Cauldron and LPC conferences). Thanks a lot for your suggestions. Yes, I agree that the option need a better name -:) and we will figure this out after more study. During this year’s Cauldron and LPC, I got quite some good comments and

Re: [PATCH 1/2 v2] Introduce __builtin_is_virtual_base_of

2024-09-25 Thread Patrick Palka
On Wed, 25 Sep 2024, Jason Merrill wrote: > On 7/30/24 6:49 PM, Giuseppe D'Angelo wrote: > > On 29/07/2024 22:53, Giuseppe D'Angelo wrote: > > > Hi, > > > > > > The attached patch is a stab at adding the necessary compiler builtin to > > > support std::is_virtual_base_of (P2985R0, approved for C+

Re: [PATCH 1/2 v2] Introduce __builtin_is_virtual_base_of

2024-09-25 Thread Jason Merrill
On 7/30/24 6:49 PM, Giuseppe D'Angelo wrote: On 29/07/2024 22:53, Giuseppe D'Angelo wrote: Hi, The attached patch is a stab at adding the necessary compiler builtin to support std::is_virtual_base_of (P2985R0, approved for C++26). The name of the builtin matches the one just merged into clang:

Re: [PATCH] gfortran testsuite: Remove unit-files in files having open-statements, PR116701

2024-09-25 Thread Jerry D
On 9/24/24 5:46 PM, Hans-Peter Nilsson wrote: Thanks for the review! Date: Tue, 24 Sep 2024 17:10:27 -0700 Cc: Jerry D From: Jerry D On 9/23/24 11:21 PM, Hans-Peter Nilsson wrote: I hope the inclusion of gfortran-dg.exp in fortran-torture.exp is not controversial, but there's no fortran-spec

[COMMITTED] libstdc++: testsuite: fix dg-bogus directive syntax

2024-09-25 Thread Sam James
These dg-bogus directives were bogus as they missed a closing brace. ``` +PASS: 23_containers/array/capacity/empty.cc -std=gnu++17 (test for bogus messages, line 54) PASS: 23_containers/array/capacity/empty.cc -std=gnu++17 (test for excess errors) PASS: 23_containers/array/capacity/empty.cc

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

2024-09-25 Thread François Dumont
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 even when iterators used in range are not const ones. This pa

Re: [PATCH 1/2 v2] Introduce __builtin_is_virtual_base_of

2024-09-25 Thread Jason Merrill
On 9/25/24 12:44 PM, Patrick Palka wrote: On Wed, 25 Sep 2024, Jason Merrill wrote: On 7/30/24 6:49 PM, Giuseppe D'Angelo wrote: On 29/07/2024 22:53, Giuseppe D'Angelo wrote: Hi, The attached patch is a stab at adding the necessary compiler builtin to support std::is_virtual_base_of (P2985R0

[PATCH v1] RISC-V: Cleanup debug code for SAT_* testcases [NFC]

2024-09-25 Thread pan2 . li
From: Pan Li Some print code for debugging is committed by mistake, remove them from the test header file. It is test only patch and obvious up to a point, will commit it directly if no comments in next 48H. gcc/testsuite/ChangeLog: * gcc.target/riscv/scalar_sat_binary_run_xxx.h: Remov

Re: [PATCH] i386, v2: Add GENERIC and GIMPLE folders of __builtin_ia32_{min,max}* [PR116738]

2024-09-25 Thread Jakub Jelinek
On Wed, Sep 25, 2024 at 11:36:33AM +0200, Richard Biener wrote: > I'll note it would be much simpler if we could write x > y ? x : y in > the intrinsic header. Unfortunately, not so much. It can do that only for simple cases like _mm_min_p{s,d} or similar, which aren't masked, aren't the "scalar"

Re: [PATCH] libgfortran: Replace mutex with rwlock

2024-09-25 Thread Jonathan Wakely
On 27/12/22 08:33 -0800, H.J. Lu wrote: On Sun, Dec 25, 2022 at 4:58 PM Steve Kargl via Gcc-patches wrote: On Wed, Dec 21, 2022 at 07:27:11PM -0500, Lipeng Zhu via Fortran wrote: > This patch try to introduce the rwlock and split the read/write to > unit_root tree and unit_cache with rwlock in

[PING^7][PATCH v2] rs6000: Fix issue in specifying PTImode as an attribute [PR106895]

2024-09-25 Thread jeevitha
Ping * 7 Please review! On 21/03/24 6:21 pm, jeevitha wrote: > Hi All, > > The following patch has been bootstrapped and regtested on powerpc64le-linux. > > PTImode assists in generating even/odd register pairs on 128 bits. When the > user > specifies PTImode as an attribute, it breaks becaus

[PATCH] fortran: Fix default initialization of finalizable non-polymorphic intent(out) arguments [PR116829]

2024-09-25 Thread Tomáš Trnka
This fixes PR fortran/116829 by making sure that s->value is always applied to non-allocatable BT_DERIVED intent(out) arguments, no matter if they are finalizable or not. Tested on x86_64-pc-linux-gnu (Fedora 40), any feedback is welcome. gcc/fortran/ChangeLog: * trans-decl.cc (init_inte

[Bug tree-optimization/109429] [PATCH v2] ivopts: fixed complexities

2024-09-25 Thread Aleksandar Rakic
Hi, I think I managed to fix indentation from the previous version. When comparing the tables showing the candidates for the group 1 before and after applying this patch, it can be observed that complexities for the candidates where the computation depends on the invariant expressions or the inv

Re: [PATCH] tree-optimization/114855 - speed up dom_oracle::register_transitives

2024-09-25 Thread Andrew MacLeod
On 9/25/24 06:51, Richard Biener wrote: dom_oracle::register_transitives contains an unbound dominator walk which for the testcase in PR114855 dominates the profile. I've also noticed odd behavior in the case when set_one_relation returns NULL, we'd then completely abort processing other relati

Re: [PATCH v2] gfortran testsuite: Remove unit-files in files having open-statements, PR116701

2024-09-25 Thread Hans-Peter Nilsson
> Date: Wed, 25 Sep 2024 13:51:07 +0200 > From: Andre Vehreschild > Hi Hans-Peter, > > preface: I am not a testsuite nor an m4 expert. Neither am I. Luckily, this has nothing to do with m4, and not really that much to do with tcl or dejagnu either, being just basic code, no language-specific t

[PATCH] aarch64: testsuite: Disable branch protection for ACLE SVE2 asm tests

2024-09-25 Thread Richard Earnshaw
Configuring the compiler with, for example, --with-standard-branch-protection can permute the generated code in a way that a very large number of scan-assembler tests will fail. Rather than add a large number of alternatives to each test, it's better to just disable this feature when scanning

[PATCH] aarch64: Set Armv9-A generic L1 cache line size to 64 bytes

2024-09-25 Thread Kyrylo Tkachov
Hi all, I'd like to use a value of 64 bytes for the L1 cache size for Armv9-A generic tuning. As described in g:9a99559a478111f7fbeec29bd78344df7651c707 this value is used to set the std::hardware_destructive_interference_size value which we want to be not overly large when running concurrent appli

Re: [PATCH 1/2] rtl-optimization/114855 - slow add_store_equivs in IRA

2024-09-25 Thread Richard Biener
On Tue, 24 Sep 2024, Jeff Law wrote: > > > On 9/24/24 6:34 AM, Richard Biener wrote: > > For the testcase in PR114855 at -O1 add_store_equivs shows up as the > > main sink for bitmap_set_bit because it uses a bitmap to mark all > > seen insns by UID to make sure the forward walk in memref_used_b

Re: [PATCH v1 1/3] Match: Support form 1 for scalar signed integer SAT_SUB

2024-09-25 Thread Richard Biener
On Wed, Sep 25, 2024 at 4:56 AM wrote: > > From: Pan Li > > This patch would like to support the form 1 of the scalar signed > integer SAT_SUB. Aka below example: > > Form 1: > #define DEF_SAT_S_SUB_FMT_1(T, UT, MIN, MAX) \ > T __attribute__((noinline)) \ > sat_s_sub_##T##

Re: [PATCH] i386, v2: Add GENERIC and GIMPLE folders of __builtin_ia32_{min,max}* [PR116738]

2024-09-25 Thread Richard Biener
On Wed, Sep 25, 2024 at 10:49 AM Hongtao Liu wrote: > > On Wed, Sep 25, 2024 at 4:42 PM Jakub Jelinek wrote: > > > > On Wed, Sep 25, 2024 at 10:17:50AM +0800, Hongtao Liu wrote: > > > > + for (int i = 0; i < 2; ++i) > > > > + { > > > > + unsigned count = vector

[PATCH] x86: Don't use address override with segment regsiter

2024-09-25 Thread H.J. Lu
Address override only applies to the (reg32) part in the thread address fs:(reg32). Don't rewrite thread address like (set (reg:CCZ 17 flags) (compare:CCZ (reg:SI 98 [ __gmpfr_emax.0_1 ]) (mem/c:SI (plus:SI (plus:SI (unspec:SI [ (const_int 0 [0])

Re: [PATCH] libgcc, libstdc++: Make more entities no longer TU-local [PR115126]

2024-09-25 Thread Jonathan Wakely
On Wed, 25 Sept 2024 at 01:50, Nathaniel Shead wrote: > > I found that my previous minimal change to libstdc++ was only sufficient > to pass regtest on x86_64-pc-linux-gnu; Linaro complained about ARM and > aarch64. This patch removes the rest of the internal-linkage entities I > could find expos

Re: [PATCH v1] RISC-V: Cleanup debug code for SAT_* testcases [NFC]

2024-09-25 Thread 钟居哲
OK juzhe.zh...@rivai.ai From: pan2.li Date: 2024-09-25 16:10 To: gcc-patches CC: juzhe.zhong; kito.cheng; jeffreyalaw; rdapp.gcc; Pan Li Subject: [PATCH v1] RISC-V: Cleanup debug code for SAT_* testcases [NFC] From: Pan Li Some print code for debugging is committed by mistake, remove them f

[PATCH] c++: Add testcase for DR 2728

2024-09-25 Thread Jakub Jelinek
Hi! Seems we already handle delete expressions the way the DR clarifies, so this patch just adds a testcase which verifies that. Tested on x86_64-linux, ok for trunk? 2024-09-25 Jakub Jelinek * g++.dg/DRs/dr2728.C: New test. --- gcc/testsuite/g++.dg/DRs/dr2728.C.jj2024-09-25

[PATCH] c++: Add testcase for DR 2836

2024-09-25 Thread Jakub Jelinek
Hi! Seems we already handle it the way the DR clarifies, if double/long double and std::float64_t have the same mode, foo has long double type (while x + y would be _Float64 in C23), so this patch just adds a testcase which verifies that. Tested on x86_64-linux, powerpc64-linux and powerpc64le-li

[PATCH] c++: Add testcase for DR 2874

2024-09-25 Thread Jakub Jelinek
Hi! Seems we already allow the partial specializations the way the DR clarifies, so this patch just adds a testcase which verifies that. Tested on x86_64-linux, ok for trunk? 2024-09-25 Jakub Jelinek * g++.dg/DRs/dr2874.C: New test. --- gcc/testsuite/g++.dg/DRs/dr2874.C.jj20

Re: [PATCH] c++: Add testcase for DR 2728

2024-09-25 Thread Jason Merrill
On 9/25/24 9:57 AM, Jakub Jelinek wrote: Hi! Seems we already handle delete expressions the way the DR clarifies, so this patch just adds a testcase which verifies that. Tested on x86_64-linux, ok for trunk? OK. 2024-09-25 Jakub Jelinek * g++.dg/DRs/dr2728.C: New test. --- gcc/

Re: [PATCH] c++: Add testcase for DR 2836

2024-09-25 Thread Jason Merrill
On 9/25/24 10:00 AM, Jakub Jelinek wrote: Hi! Seems we already handle it the way the DR clarifies, if double/long double and std::float64_t have the same mode, foo has long double type (while x + y would be _Float64 in C23), so this patch just adds a testcase which verifies that. Tested on x86_

Re: [PATCH] c++: Add testcase for DR 2874

2024-09-25 Thread Jason Merrill
On 9/25/24 10:01 AM, Jakub Jelinek wrote: Hi! Seems we already allow the partial specializations the way the DR clarifies, so this patch just adds a testcase which verifies that. Tested on x86_64-linux, ok for trunk? OK. 2024-09-25 Jakub Jelinek * g++.dg/DRs/dr2874.C: New test.

[PATCH] arm: Fix missed CE optimization for armv8.1-m.main [PR 116444]

2024-09-25 Thread Andre Vieira (lists)
Hi, This patch restores missed optimizations for armv8.1-m.main targets that were missed when the generation of csinc, csinv and csneg were enabled or the same with patch series containing: commit c2bb84be4a6e581bbf45891457ee632a07416982 Author: Sudi Das Date: Fri Sep 18 15:47:46 2020 +010

Re: [PATCH v4] match: Fix A || B not optimized to true when !B implies A [PR114326]

2024-09-25 Thread Philipp Tomsich
Applied to master with a fixup for the spurious whitespace-change/removal of newline (at the end of the file), thanks! --Philipp. On Wed, 25 Sept 2024 at 15:02, Richard Biener wrote: > > On Thu, Sep 19, 2024 at 2:18 PM Konstantinos Eleftheriou > wrote: > > > > From: kelefth > > > > In expressio

[PATCH] Remove recursion in simplify_control_stmt_condition_1 [PR114855].

2024-09-25 Thread Richard Biener
From: Aldy Hernandez Remove some ad-hoc simplification code in the forward threader, as the call into the ranger in m_simplifier->simplify() will handle anything we can do manually in simplify_control_stmt_condition_1. In PR114855, DOM time is reduced from 120s to 92s (-23%) and overall compilat

[PATCH] tree-optimization/114855 - speed up dom_oracle::register_transitives

2024-09-25 Thread Richard Biener
dom_oracle::register_transitives contains an unbound dominator walk which for the testcase in PR114855 dominates the profile. I've also noticed odd behavior in the case when set_one_relation returns NULL, we'd then completely abort processing other relations. The following fixes the latter by con

Re: [PATCH] libgcc, libstdc++: Make more entities no longer TU-local [PR115126]

2024-09-25 Thread Jonathan Wakely
On Wed, 25 Sept 2024 at 11:47, Jonathan Wakely wrote: > > On Wed, 25 Sept 2024 at 11:29, Jakub Jelinek wrote: > > > > On Wed, Sep 25, 2024 at 10:43:50AM +0100, Jonathan Wakely wrote: > > > > libgcc/ChangeLog: > > > > > > > > * gthr-posix.h (__GTHREAD_INLINE): New macro. > > > > (_

Re: [PATCH v2] gfortran testsuite: Remove unit-files in files having open-statements, PR116701

2024-09-25 Thread Andre Vehreschild
Hi Hans-Peter, preface: I am not a testsuite nor an m4 expert. So I may be wrong in arguing that your changes look reasonable. I like the "automatic" clean-up process very much. So by me, ok for mainline. But you may want to wait for one other ok from some one who has more experience in the gfort

Re: [PATCH] Speed up get_bitmask_from_range

2024-09-25 Thread Jakub Jelinek
On Wed, Sep 25, 2024 at 01:42:04PM +0200, Richard Biener wrote: > When min != max we know min ^ max != 0. > > Bootstrap and regtest running on x86_64-unknown-linux-gnu. > > * value-range.cc (get_bitmask_from_range): Remove redundant > compare of xorv with zero. LGTM. Jakub

[PATCH] Use tree view for find_always_executed_bbs result

2024-09-25 Thread Richard Biener
The following makes us use bitmap tree view for the always-executed-BBs bitmap as computed by IPA utils find_always_executed_bbs and used by IPA modref (where it shows up in the profile for PR114855. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. * ipa-utils.cc (find_always_

Re: [Patch] OpenMP: Update OMP_REQUIRES_TARGET_USED for declare_target + interop

2024-09-25 Thread Tobias Burnus
Hi now committed the following as r15-3856-gfcff9c3dad4f35 with two testcase additions (and improved changelog wording). Tobias Burnus wrote: OpenMP mandates that when certain clauses are used with 'omp requires' that in all compilation units this requires clause appears. Those clauses infl

Re: [PATCH] libgcc, libstdc++: Make more entities no longer TU-local [PR115126]

2024-09-25 Thread Jakub Jelinek
On Wed, Sep 25, 2024 at 12:18:07PM +0100, Jonathan Wakely wrote: > > > And whether similarly we couldn't use > > > __attribute__((__visibility__ ("hidden"))) on the static block scope > > > vars for C++ (again, if compiler supports that), so that the changes > > > don't affect ABI of C++ libraries

gcc-patches@gcc.gnu.org

2024-09-25 Thread Richard Biener
wide_int_storage shows up high in the profile for the testcase in PR114855 where the apparent issue is that the conditional jump on 'precision' after the (inlined) memcpy stalls the pipeline due to the data dependence and required store-to-load forwarding. We can add scheduling freedom by instead

[PATCH] Speed up get_bitmask_from_range

2024-09-25 Thread Richard Biener
When min != max we know min ^ max != 0. Bootstrap and regtest running on x86_64-unknown-linux-gnu. * value-range.cc (get_bitmask_from_range): Remove redundant compare of xorv with zero. --- gcc/value-range.cc | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a

gcc-patches@gcc.gnu.org

2024-09-25 Thread Jakub Jelinek
On Wed, Sep 25, 2024 at 01:41:51PM +0200, Richard Biener wrote: > wide_int_storage shows up high in the profile for the testcase in > PR114855 where the apparent issue is that the conditional jump > on 'precision' after the (inlined) memcpy stalls the pipeline due > to the data dependence and requi

Re: [PATCH] c++: compile time evaluation of prvalues [PR116416]

2024-09-25 Thread Jason Merrill
On 9/24/24 5:10 PM, Marek Polacek wrote: On Fri, Sep 20, 2024 at 06:39:52PM -0400, Jason Merrill wrote: On 9/20/24 12:18 AM, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- This PR reports a missed optimization. When we have: Str str{"Test"};

Re: [PATCH v2] match: Change (A * B) + (-C) to (B - C/A) * A, if C multiple of A [PR109393]

2024-09-25 Thread Richard Biener
On Tue, Sep 17, 2024 at 9:43 AM Konstantinos Eleftheriou wrote: > > From: kelefth > > The following function: > > int foo(int *a, int j) > { > int k = j - 1; > return a[j - 1] == a[k]; > } > > does not fold to `return 1;` using -O2 or higher. The cause of this is that > the expression `4 * j

Re: [PATCH] ltmain.sh: allow more flags at link-time

2024-09-25 Thread Sam James
Alan Modra writes: > On Thu, Sep 19, 2024 at 11:52:48PM +0100, Sam James wrote: >> Sam James writes: >> >> > Sam James writes: >> > >> >> libtool defaults to filtering flags passed at link-time. >> >> >> >> This brings the filtering in GCC's 'fork' of libtool into sync with >> >> upstream libt

Re: [PATCH 1/2 v2] Introduce __builtin_is_virtual_base_of

2024-09-25 Thread Patrick Palka
On Wed, 31 Jul 2024, Giuseppe D'Angelo wrote: > On 29/07/2024 22:53, Giuseppe D'Angelo wrote: > > Hi, > > > > The attached patch is a stab at adding the necessary compiler builtin to > > support std::is_virtual_base_of (P2985R0, approved for C++26). The name > > of the builtin matches the one jus

Re: [PATCH 1/2 v2] Introduce __builtin_is_virtual_base_of

2024-09-25 Thread Patrick Palka
[CC'ing Jason] On Wed, 25 Sep 2024, Patrick Palka wrote: > On Wed, 31 Jul 2024, Giuseppe D'Angelo wrote: > > > On 29/07/2024 22:53, Giuseppe D'Angelo wrote: > > > Hi, > > > > > > The attached patch is a stab at adding the necessary compiler builtin to > > > support std::is_virtual_base_of (P298

Re: [PATCH v4] match: Fix A || B not optimized to true when !B implies A [PR114326]

2024-09-25 Thread Richard Biener
On Thu, Sep 19, 2024 at 2:18 PM Konstantinos Eleftheriou wrote: > > From: kelefth > > In expressions like (a != b || ((a ^ b) & c) == d) and > (a != b || (a ^ b) == c), (a ^ b) is folded to false. > In the equivalent expressions (((a ^ b) & c) == d || a != b) and > ((a ^ b) == c || a != b) this i

Re: [PATCH] MATCH: add abs support for half float

2024-09-25 Thread Richard Biener
On Wed, Sep 25, 2024 at 12:12 PM Kugan Vivekanandarajah wrote: > > Hi Richard, > > > On 24 Sep 2024, at 6:16 pm, Richard Biener > > wrote: > > > > External email: Use caution opening links or attachments > > > > > > On Mon, Sep 23, 2024 at 10:52 AM Kugan Vivekanandarajah > > wrote: > >> > >> Hi

Re: [PATCH] ltmain.sh: allow more flags at link-time

2024-09-25 Thread Richard Biener
On Wed, 25 Sep 2024, Sam James wrote: > Alan Modra writes: > > > On Thu, Sep 19, 2024 at 11:52:48PM +0100, Sam James wrote: > >> Sam James writes: > >> > >> > Sam James writes: > >> > > >> >> libtool defaults to filtering flags passed at link-time. > >> >> > >> >> This brings the filtering in

Re: [PATCH v2] match: Fix `a != 0 ? a * b : 0` patterns for things that trap [PR116772]

2024-09-25 Thread Richard Biener
On Tue, Sep 24, 2024 at 2:59 AM Andrew Pinski wrote: > > For generic, `a != 0 ? a * b : 0` would match where `b` would be an expression > which trap (in the case of the testcase, it was an integer division but it > could be any). > > This adds a new helper function, expr_no_side_effects_p which t

Re: [PATCH v1 1/2] Match: Support form 3 for vector signed integer .SAT_ADD

2024-09-25 Thread Richard Biener
On Sat, Sep 21, 2024 at 4:23 PM wrote: > > From: Pan Li > > This patch would like to support the form 3 of the vector signed > integer .SAT_ADD. Aka below example: > > Form 3: > #define DEF_VEC_SAT_S_ADD_FMT_3(T, UT, MIN, MAX) \ > void __attribute__((noinline))

[PATCH] c++: use TARGET_EXPR accessors

2024-09-25 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- While futzing around with PR116416 I noticed that we can use the _SLOT and _INITIAL macros to make the code more readable. gcc/c-family/ChangeLog: * c-pretty-print.cc (c_pretty_printer::primary_expression): Use

Re: [PATCH v2] match: Change (A * B) + (-C) to (B - C/A) * A, if C multiple of A [PR109393]

2024-09-25 Thread Philipp Tomsich
Applied to master, thanks! --Philipp. On Wed, 25 Sept 2024 at 14:56, Richard Biener wrote: > > On Tue, Sep 17, 2024 at 9:43 AM Konstantinos Eleftheriou > wrote: > > > > From: kelefth > > > > The following function: > > > > int foo(int *a, int j) > > { > > int k = j - 1; > > return a[j - 1]

Re: [PATCH] libgcc, libstdc++: Make more entities no longer TU-local [PR115126]

2024-09-25 Thread Jonathan Wakely
On Wed, 25 Sept 2024 at 11:29, Jakub Jelinek wrote: > > On Wed, Sep 25, 2024 at 10:43:50AM +0100, Jonathan Wakely wrote: > > > libgcc/ChangeLog: > > > > > > * gthr-posix.h (__GTHREAD_INLINE): New macro. > > > (__gthread_active): Convert from variable to function. > > > (__g

Re: [PATCH] x86: Don't use address override with segment regsiter

2024-09-25 Thread Uros Bizjak
On Wed, Sep 25, 2024 at 11:42 AM H.J. Lu wrote: > > Address override only applies to the (reg32) part in the thread address > fs:(reg32). Don't rewrite thread address like > > (set (reg:CCZ 17 flags) > (compare:CCZ (reg:SI 98 [ __gmpfr_emax.0_1 ]) > (mem/c:SI (plus:SI (plus:SI (unspec

[PATCH] remove dominator recursion from reassoc

2024-09-25 Thread Richard Biener
The reassoc pass currently walks dominators in a recursive way where I ran into a stack overflow with. The following replaces it with worklists following patterns used elsewhere. Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. Richard. * tree-ssa-reassoc.cc (break_up_subt

Re: [PATCH] c++: use TARGET_EXPR accessors

2024-09-25 Thread Jason Merrill
On 9/25/24 9:31 AM, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? OK (and obvious, IMO). -- >8 -- While futzing around with PR116416 I noticed that we can use the _SLOT and _INITIAL macros to make the code more readable. gcc/c-family/ChangeLog: *

Re: [PATCH] doc: Remove @code wrapping of fortran option names [PR116801]

2024-09-25 Thread Mikael Morin
Le 23/09/2024 à 20:43, Arsen Arsenović a écrit : Andreas Schwab writes: It's only about the @opindex. The vast majority have those variable parts removed from the index entry. We can probably do both at the same time, either via makeinfos -D option and some special macro, or by emitting a m

Re: [PATCH v5] Provide new GCC builtin __builtin_counted_by_ref [PR116016]

2024-09-25 Thread Qing Zhao
Sorry for the late reply (just came back from LPC after Cauldron). > On Sep 17, 2024, at 05:13, Jakub Jelinek wrote: > > On Sat, Sep 14, 2024 at 08:58:28PM +0200, Jakub Jelinek wrote: >>if (has_counted_by_object (e_p->value)) >> expr.value = get_counted_by_ref (e_p->value); >>else

Re: [PATCH] doc: Remove @code wrapping of fortran option names [PR116801]

2024-09-25 Thread Mikael Morin
Le 23/09/2024 à 20:37, Andreas Schwab a écrit : On Sep 23 2024, Mikael Morin wrote: For options where the variable is not a separate argument, I think it's preferable to keep the variable. For example, -ffree-line-length-@var{n} looks better on the index page as "-ffree-line-length-n" (with th

Re: [PATCH v5] Provide new GCC builtin __builtin_counted_by_ref [PR116016]

2024-09-25 Thread Qing Zhao
> On Sep 17, 2024, at 07:05, Jakub Jelinek wrote: > > On Tue, Sep 17, 2024 at 11:13:09AM +0200, Jakub Jelinek wrote: >> So maybe better >>tree arg = e_p->value; >>tree f; >>if ((in_typeof || in_alignof) >> && TREE_CODE (arg) == COMPONENT_REF >> && (f = TREE_OPERAND (arg, 1)) >> && T