Re: [PATCH] c++: Prune lambda captures from more places [PR119755]

2025-04-14 Thread Nathaniel Shead
On Mon, Apr 14, 2025 at 05:33:05PM -0400, Jason Merrill wrote: > On 4/13/25 6:32 AM, Nathaniel Shead wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? > > > > -- >8 -- > > > > Currently, pruned lambda captures are still leftover in the function's > > BLOCK and topmost BI

Re: RISC-V: revert pr114194 tests on gcc-14 [PR118601]

2025-04-14 Thread Kito Cheng
LGTM, thanks :) Alexandre Oliva 於 2025年4月15日 週二 12:25 寫道: > > And here's another that came up more recently: > > The gcc-14 backport that split the pr114194 testcase for rv32 and rv64 > would only generate the expected rv32 sequence if commit > 6b315907c0353f71169a7555e653d29a981fef67 had also b

Re: [PATCH] RISC-V: Minimal support for ssnpm, smnpm and smmpm extensions.

2025-04-14 Thread chendongyan
This patch support ssnpm, smnpm, smmpm, sspm and supm extensions[1]. To enable GCC to recognize and process ssnpm, smnpm, smmpm, sspm and supm extensions correctly at compile time. [1] https://github.com/riscv/riscv-j-extension/blob/master/zjpm/instructions.adoc Changes for v2: - Add the ssp

[PATCH] MATCH: Fix patterns of type (a != b) and (a == b) [PR117760]

2025-04-14 Thread Eikansh Gupta
The patterns can be simplified as shown below: (a != b) & ((a|b) != 0) -> (a != b) (a != b) | ((a|b) != 0) -> ((a|b) != 0) The similar simplification can be there for (a == b). This patch adds simplification for above patterns. The forwprop pass was modifying the patterns to some other form and

Re: RISC-V: adjust testcase for gcc-14 [PR118182]

2025-04-14 Thread Kito Cheng
OK for GCC 14 branch, thanks :) On Tue, Apr 15, 2025 at 12:23 PM Alexandre Oliva wrote: > > On Apr 14, 2025, Jeff Law wrote: > > > No strong opinion. I'd lean towards xfail or twiddling the test since > > that's obviously super-save WRT codegen on the gcc-14 release branch. > > Twiddling it is,

[PUSHED 1/3] Add 'std::bad_cast' exception test cases for GCN, nvptx target and OpenACC, OpenMP 'target' offloading

2025-04-14 Thread Thomas Schwinge
gcc/testsuite/ * g++.target/gcn/exceptions-bad_cast-1.C: New. * g++.target/nvptx/exceptions-bad_cast-1.C: Likewise. libgomp/ * testsuite/libgomp.c++/target-exceptions-bad_cast-1.C: New. * testsuite/libgomp.oacc-c++/exceptions-bad_cast-1.C: Likewise. -

Re: [PATCH] [testsuite] [ppc] disable -mpowerpc64 for various ilp32 asm-out checks

2025-04-14 Thread Alexandre Oliva
On Apr 14, 2025, Peter Bergner wrote: > But -mcpu= should not enable -mpowerpc64 by default for -m32 compiles. Oh, is that so? It seems to have been the case for quite a long time. I can trivially see that GCC 9 already did that, but it may have been around for much longer than that. And TBH i

[PUSHED/13 3/4] phiopt: Reset the number of iterations information of a loop when changing an exit from the loop [PR117243]

2025-04-14 Thread Andrew Pinski
After r12-5300-gf98f373dd822b3, phiopt could get the following bb structure: | middle-bb -| || | || | phi<1, 2> | | cond | | || | |+---| Which was considered 2 loops. The inner loop had esimtate of upper

[PUSHED/13 4/4] phiopt: Fix value_replacement for middle bb having phi nodes [PR118922]

2025-04-14 Thread Andrew Pinski
After r12-5300-gf98f373dd822b3, value_replacement would be able to look at the following cfg structure: ``` [local count: 1014686024]: if (h_6 != 0) goto ; [94.50%] else goto ; [5.50%] [local count: 114863530]: # h_6 = PHI <0(4), 1(5)> [local count: 1073741824]: # f_8 = P

[PUSHED/13 0/4] Backported patches to gcc 13

2025-04-14 Thread Andrew Pinski
Just a set of 4 patches backported from the trunk via 14 branch to the GCC 13 release branch. These all fix regressions. Andrew Pinski (4): vec-lowering: Fix ABSU lowering [PR111285] backprop: Fix deleting of a phi node [PR116922] phiopt: Reset the number of iterations information of a loop

[PUSHED/13 2/4] backprop: Fix deleting of a phi node [PR116922]

2025-04-14 Thread Andrew Pinski
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 possibility of using simple_dce_from_worklist instead but that is for an

[PUSHED/13 1/4] vec-lowering: Fix ABSU lowering [PR111285]

2025-04-14 Thread Andrew Pinski
ABSU_EXPR lowering incorrectly used the resulting type for the new expression but in the case of ABSU the resulting type is an unsigned type and with ABSU is folded away. The fix is to use a signed type for the expression instead. Bootstrapped and tested on x86_64-linux-gnu. PR middle-end

Re: [PATCH] [testsuite] [ppc] block-cmp-8 should require powerpc64

2025-04-14 Thread Alexandre Oliva
On Apr 14, 2025, Peter Bergner wrote: > That said, I hate the name "powerpc64" and it should probably be > renamed to "powerpc64_hw" to be more clear about what it's testing. Yeah, that would make sense. > That said, that should be done in a separate patch. *nod*. Do you mean you're going to

Re: [PATCH] [testsuite] [ppc] compile [PR112822] with -mvsx

2025-04-14 Thread Alexandre Oliva
On Apr 14, 2025, Peter Bergner wrote: > This is an architecture independent test case, so I'm surprised this > doesn't FAIL on non-powerpc targets since they don't know anything > about altivec. AFAICT we ignore attributes we don't know about. I'd think the following fix should help them too.

RISC-V: revert pr114194 tests on gcc-14 [PR118601]

2025-04-14 Thread Alexandre Oliva
And here's another that came up more recently: The gcc-14 backport that split the pr114194 testcase for rv32 and rv64 would only generate the expected rv32 sequence if commit 6b315907c0353f71169a7555e653d29a981fef67 had also been backported, but it wasn't. Without it, we get the same code as be

RISC-V: adjust testcase for gcc-14 [PR118182]

2025-04-14 Thread Alexandre Oliva
On Apr 14, 2025, Jeff Law wrote: > No strong opinion. I'd lean towards xfail or twiddling the test since > that's obviously super-save WRT codegen on the gcc-14 release branch. Twiddling it is, then (pending approval ;-) The pr118182-2.c testcase backported from gcc-15 depended on the late com

[PATCH] combine: Correct comment about combine_validate_cost

2025-04-14 Thread Hans-Peter Nilsson
Noticed while investigating a regression for cris-elf with r15-9239-g4d7a634f6d4102 "combine: Allow 2->2 combinations, but with a tweak [PR116398]" (to-be-reported). The comment was introduced when breaking out the combine_validate_cost function, in r0-59417-g64b8935d4809f3. I thought about words

[COMMITTED] Doc: always_inline attribute vs multiple TUs and LTO [PR113203]

2025-04-14 Thread Sandra Loosemore
gcc/ChangeLog PR ipa/113203 * doc/extend.texi (Common Function Attributes): Explain how to use always_inline in programs that have multiple translation units, and that LTO inlining additionally needs optimization enabled. --- gcc/doc/extend.texi | 7 +++

[pushed] c++: shortcut constexpr vector ctor [PR113835]

2025-04-14 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- Since std::vector became usable in constant evaluation in C++20, a vector variable with static storage duration might be manifestly constant-evaluated, so we properly try to constant-evaluate its initializer. But it can never succeed since t

Re: [PATCH] [testsuite] [ppc] disable -mpowerpc64 for various ilp32 asm-out checks

2025-04-14 Thread Peter Bergner
On 4/11/25 1:05 PM, Alexandre Oliva wrote: > Multiple tests on ilp32 get TARGET_POWERPC64 enabled by -mdejagnu-cpu > options, but the results they expect are only attained without > enabling it, so disable it explicitly. [snip] > diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-

Re: [PATCH v2] RISC-V: Do not lift up vsetvl into non-transparent blocks [PR119547].

2025-04-14 Thread Zhijin Zeng
LGTM. Thank you. Zhijin Zeng. > From: "Robin Dapp" > Date:  Wed, Apr 9, 2025, 20:09 > Subject:  [PATCH v2] RISC-V: Do not lift up vsetvl into non-transparent > blocks [PR119547]. > To: "gcc-patches" > Cc: , , , > , , , > , "Vineet Gupta" > Hi, >  > when lifting up a vsetvl into a block we cur

[COMMITTED 05/19] gccrs: typecheck: Properly select methods when dealing with specialization

2025-04-14 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-expr.cc (is_default_fn): New. (emit_ambiguous_resolution_error): New. (handle_multiple_candidates): Properly handle multiple candidates in the case of specialization. (TypeCheckExpr::vi

[COMMITTED] Doc: clarify -march=pentiumpro has no MMX support [PR42683]

2025-04-14 Thread Sandra Loosemore
gcc/ChangeLog PR target/42683 * doc/invoke.texi (x86 Options): Clarify that -march=pentiumpro doesn't include MMX. --- gcc/doc/invoke.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 67155eeeda7..1f7657

[PATCH] c++: prev declared hidden tmpl friend inst, cont [PR119807]

2025-04-14 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk and later 14? -- >8 -- When remapping existing specializations of a hidden template friend from a previous declaration to the new definition, we must remap only those specializations that match this new definition, but

Re: [PATCH] APX: Don't use red-zone with APX and no caller-saved registers

2025-04-14 Thread Hongtao Liu
On Mon, Apr 14, 2025 at 8:56 PM H.J. Lu wrote: > > On Mon, Apr 14, 2025 at 2:39 AM Uros Bizjak wrote: > > > > On Mon, Apr 14, 2025 at 8:54 AM Hongtao Liu wrote: > > > > > > On Mon, Apr 14, 2025 at 7:36 AM H.J. Lu wrote: > > > > > > > > Don't use red-zone when there are no caller-saved registers

[PUSHED/14 0/2] A few backports to GCC 14

2025-04-14 Thread Andrew Pinski
These 2 had simple resolvable conflicts when backporting. In the case of value_replacement, there was some minor code movement in value_replacement which needed to be resolved. In the case of PR117243, there was an extra include that was not on the branch. Andrew Pinski (2): phiopt: Fix value_re

[PUSHED14 2/2] phiopt: Reset the number of iterations information of a loop when changing an exit from the loop [PR117243]

2025-04-14 Thread Andrew Pinski
After r12-5300-gf98f373dd822b3, phiopt could get the following bb structure: | middle-bb -| || | || | phi<1, 2> | | cond | | || | |+---| Which was considered 2 loops. The inner loop had esimtate of upper

[PUSHED14 1/2] phiopt: Fix value_replacement for middle bb having phi nodes [PR118922]

2025-04-14 Thread Andrew Pinski
After r12-5300-gf98f373dd822b3, value_replacement would be able to look at the following cfg structure: ``` [local count: 1014686024]: if (h_6 != 0) goto ; [94.50%] else goto ; [5.50%] [local count: 114863530]: # h_6 = PHI <0(4), 1(5)> [local count: 1073741824]: # f_8 = P

[PUSHED] GCN, nvptx: Support '-mfake-exceptions', and use it for offloading compilation [PR118794]

2025-04-14 Thread Thomas Schwinge
With '-mfake-exceptions' enabled, the user-visible behavior in presence of exception handling constructs changes such that the compile-time 'sorry, unimplemented: exception handling not supported' is skipped, code generation proceeds, and instead, exception handling constructs 'abort' at run time.

Re: [PATCH] aarch64: Fix CFA offsets in non-initial stack probes [PR119610]

2025-04-14 Thread Jeff Law
On 4/11/25 4:22 AM, Richard Biener wrote: On Fri, Apr 11, 2025 at 12:18 PM Richard Sandiford wrote: Richard Biener writes: On Fri, Apr 11, 2025 at 11:10 AM Richard Sandiford wrote: Richard Biener writes: On Thu, Apr 10, 2025 at 10:10 PM Richard Sandiford wrote: PR119610 is about i

Re: [RFC] [C]New syntax for the argument of counted_by attribute for C language

2025-04-14 Thread Bill Wendling
On Mon, Apr 14, 2025 at 1:56 PM Qing Zhao wrote: > > Hi, Bill, > > Thanks for your new proposal. > > If I understand correctly, this new proposal basically is back to one of our > previous proposal: > > Adding a new structure scoping for counted_by attribute into C; > > With this approach, there

[PUSHED] Add 'g++.target/gcn/gcn.exp' for GCN-specific C++ test cases

2025-04-14 Thread Thomas Schwinge
Like 'gcc.target/gcn/gcn.exp' is modeled after 'gcc.dg/dg.exp', this new 'g++.target/gcn/gcn.exp' is modeled after 'g++.dg/dg.exp'. gcc/testsuite/ * g++.target/gcn/gcn.exp: New. --- gcc/testsuite/g++.target/gcn/gcn.exp | 56 1 file changed, 56 insertio

Re: [PATCH] [riscv] vec_dup immediate constants in pred_broadcast expand [PR118182]

2025-04-14 Thread Jeff Law
On 4/13/25 11:03 PM, Alexandre Oliva wrote: On Apr 12, 2025, Jeff Law wrote: for gcc/ChangeLog PR target/118182 * config/riscv/vector.md (@pred_broadcast): Expand to _zero and _imm variants without vec_duplicate. I'd said this should tend to wait for gcc-16 since it doesn't fix a regressi

[PUSHED 3/3] Add 'throw', dead code test cases for GCN, nvptx target and OpenACC, OpenMP 'target' offloading

2025-04-14 Thread Thomas Schwinge
gcc/testsuite/ * g++.target/gcn/exceptions-throw-3.C: New. * g++.target/nvptx/exceptions-throw-3.C: Likewise. libgomp/ * testsuite/libgomp.c++/target-exceptions-throw-3.C: New. * testsuite/libgomp.oacc-c++/exceptions-throw-3.C: Likewise. --- .../g++.

[PUSHED 2/3] Add 'throw', caught test cases for GCN, nvptx target and OpenACC, OpenMP 'target' offloading

2025-04-14 Thread Thomas Schwinge
gcc/testsuite/ * g++.target/gcn/exceptions-throw-2.C: New. * g++.target/nvptx/exceptions-throw-2.C: Likewise. libgomp/ * testsuite/libgomp.c++/target-exceptions-throw-2.C: New. * testsuite/libgomp.c++/target-exceptions-throw-2-offload-sorry-GCN.C: Li

Re: [PATCH] [testsuite] [ppc] block-cmp-8 should require powerpc64

2025-04-14 Thread Peter Bergner
On 4/11/25 1:04 PM, Alexandre Oliva wrote: > --- a/gcc/testsuite/gcc.target/powerpc/block-cmp-8.c > +++ b/gcc/testsuite/gcc.target/powerpc/block-cmp-8.c > @@ -1,6 +1,6 @@ > /* { dg-do run { target ilp32 } } */ > /* { dg-options "-O2 -mpowerpc64" } */ > -/* { dg-require-effective-target has_arch_p

[r15-9427 Regression] FAIL: gcc.dg/ipa/pr119530.c execution test on Linux/x86_64

2025-04-14 Thread haochen.jiang
On Linux/x86_64, de1c734a8ae034c92f485e7f58b7fcb1c921ecd2 is the first bad commit commit de1c734a8ae034c92f485e7f58b7fcb1c921ecd2 Author: Martin Jambor Date: Mon Apr 14 14:21:15 2025 +0200 ipa-cp: Make propagation of bits in IPA-CP aware of type conversions (PR119318) caused FAIL: gcc.d

[PUSHED 1/3] Add 'throw' test cases for GCN, nvptx target and OpenACC, OpenMP 'target' offloading

2025-04-14 Thread Thomas Schwinge
gcc/testsuite/ * g++.target/gcn/exceptions-throw-1.C: New. * g++.target/nvptx/exceptions-throw-1.C: Likewise. libgomp/ * testsuite/libgomp.c++/target-exceptions-throw-1.C: New. * testsuite/libgomp.c++/target-exceptions-throw-1-O0.C: Likewise.

[PUSHED 3/3] Add 'std::bad_cast' exception, dead code test cases for GCN, nvptx target and OpenACC, OpenMP 'target' offloading

2025-04-14 Thread Thomas Schwinge
gcc/testsuite/ * g++.target/gcn/exceptions-bad_cast-3.C: New. * g++.target/nvptx/exceptions-bad_cast-3.C: Likewise. libgomp/ * testsuite/libgomp.c++/target-exceptions-bad_cast-3.C: New. * testsuite/libgomp.oacc-c++/exceptions-bad_cast-3.C: Likewise. -

[PUSHED 2/3] Add 'std::bad_cast' exception, caught test cases for GCN, nvptx target and OpenACC, OpenMP 'target' offloading

2025-04-14 Thread Thomas Schwinge
gcc/testsuite/ * g++.target/gcn/exceptions-bad_cast-2.C: New. * g++.target/nvptx/exceptions-bad_cast-2.C: Likewise. libgomp/ * testsuite/libgomp.c++/target-exceptions-bad_cast-2.C: New. * testsuite/libgomp.c++/target-exceptions-bad_cast-2-offload-sor

[PUSHED] Add test cases for exception handling constructs in dead code for GCN, nvptx target and OpenMP 'target' offloading [PR118794]

2025-04-14 Thread Thomas Schwinge
PR target/118794 gcc/testsuite/ * g++.target/gcn/exceptions-pr118794-1.C: New. * g++.target/nvptx/exceptions-pr118794-1.C: Likewise. libgomp/ * testsuite/libgomp.c++/target-exceptions-pr118794-1.C: New. * testsuite/libgomp.c++/target-exceptio

[PUSHED] Add PR119692 "C++ 'typeinfo', 'vtable' vs. OpenACC, OpenMP 'target' offloading" test cases [PR119692]

2025-04-14 Thread Thomas Schwinge
... documenting the status quo. PR c++/119692 gcc/testsuite/ * g++.target/gcn/pr119692-1-1.C: New. * g++.target/nvptx/pr119692-1-1.C: Likewise. libgomp/ * testsuite/libgomp.c++/pr119692-1-1.C: New. * testsuite/libgomp.c++/pr119692-1-2.C: Like

Re: [PATCH] [testsuite] [ppc] pr87600, pr89313: test for __PPC__ as well

2025-04-14 Thread Peter Bergner
On 4/11/25 1:03 PM, Alexandre Oliva wrote: > gcc.dg/pr87600.h and gcc.dg/pr89313.c test for __powerpc__ and > __POWERPC__ to choose ppc register names, but ppc-elf defines neither; > it defines __PPC__, so test for that as well. Is there a reason why powerpc-*-elf doesn't define __powerpc__ or __P

Re: [PATCH] [testsuite] [ppc] ipa-sra-19.c: pass -Wno-psabi on powerpc-*-elf as well

2025-04-14 Thread Peter Bergner
On 4/11/25 1:01 PM, Alexandre Oliva wrote: > Like other ppc targets, powerpc-*-elf needs -Wno-psabi to compile > gcc.dg/ipa/ipa-sra-19.c without an undesired warning about vector > argument passing. > > Regstrapped on powerpc64le-linux-gnu. Also tested with gcc-14 on > x86_64-linux-x-powerpc-elf.

Re: [PATCH] [testsuite] [ppc] compile [PR112822] with -mvsx

2025-04-14 Thread Peter Bergner
On 4/11/25 12:57 PM, Alexandre Oliva wrote: > diff --git a/gcc/testsuite/g++.dg/pr112822.C b/gcc/testsuite/g++.dg/pr112822.C > index a8557522467d7..9ec5707eb4c4d 100644 > --- a/gcc/testsuite/g++.dg/pr112822.C > +++ b/gcc/testsuite/g++.dg/pr112822.C > @@ -1,6 +1,8 @@ > /* PR tree-optimization/11282

Fix PR lto/119792

2025-04-14 Thread Eric Botcazou
The backport of the change made for PR c/113688 onto the 14 branch a couple of weeks ago has seriously broken the LTO compiler for the Ada language on the 14 branch, because it changes the GCC type system for the sake of C in a way that is not compatible with simple discriminated types in Ada.

Re: [PATCH] c++: Prune lambda captures from more places [PR119755]

2025-04-14 Thread Jason Merrill
On 4/13/25 6:32 AM, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? -- >8 -- Currently, pruned lambda captures are still leftover in the function's BLOCK and topmost BIND_EXPR; this doesn't cause any issues for normal compilation, but does break modules s

Re: [RFC] [C]New syntax for the argument of counted_by attribute for C language

2025-04-14 Thread Qing Zhao
Hi, Bill, Thanks for your new proposal. If I understand correctly, this new proposal basically is back to one of our previous proposal: Adding a new structure scoping for counted_by attribute into C; With this approach, there is one new structure scoping added to C, and this new scope will

RE: [PATCH] libgcobol, v2: Handle long double as an alternate IEEE754 128b

2025-04-14 Thread Robert Dubner
I applied this patch. It works on my local systems, and it passes the cobolworx CI/CD pipelines. It is okay for trunk. > -Original Message- > From: Jakub Jelinek > Sent: Thursday, April 10, 2025 12:37 > To: Rainer Orth > Cc: Iain Sandoe ; gcc-patches@gcc.gnu.org; > i...@sandoe.co.uk; j

Re: [r15-9427 Regression] FAIL: gcc.dg/ipa/pr119530.c execution test on Linux/x86_64

2025-04-14 Thread Sam James
"haochen.jiang" writes: > On Linux/x86_64, > > de1c734a8ae034c92f485e7f58b7fcb1c921ecd2 is the first bad commit > commit de1c734a8ae034c92f485e7f58b7fcb1c921ecd2 > Author: Martin Jambor > Date: Mon Apr 14 14:21:15 2025 +0200 > > ipa-cp: Make propagation of bits in IPA-CP aware of type conv

[r15-9431 Regression] FAIL: gcc.target/i386/apx-interrupt-1.c scan-assembler-times .cfi_restore 15 on Linux/x86_64

2025-04-14 Thread haochen.jiang
On Linux/x86_64, 0a074b8c7e79f9d9359d044f1499b0a9ce9d2801 is the first bad commit commit 0a074b8c7e79f9d9359d044f1499b0a9ce9d2801 Author: H.J. Lu Date: Sun Apr 13 12:20:42 2025 -0700 APX: Don't use red-zone with 32 GPRs and no caller-saved registers caused FAIL: gcc.target/i386/apx-inter

[COMMITTED 18/19] gccrs: attributes: Handle external tool annotations like rustfmt::

2025-04-14 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * util/rust-attribute-values.h: Add RUSTFMT value. * util/rust-attributes.cc: Define the attribute. * util/rust-attributes.h (enum CompilerPass): Add EXTERNAL variant. * expand/rust-macro-builtins.cc: Fix formatting. --- gcc

[PATCH] c: Fully fold each parameter for call to .ACCESS_WITH_SIZE [PR119717]

2025-04-14 Thread Qing Zhao
C_MAYBE_CONST_EXPR is a C FE operator that will be removed by c_fully_fold. In c_fully_fold, it assumes that operands of function calls have already been folded. However, when we build call to .ACCESS_WITH_SIZE, all its operands are not fully folded. therefore the C FE specific operator is passed t

Re: [PATCH] Add std::deque shrink_to_fit test

2025-04-14 Thread François Dumont
On 14/04/2025 08:29, Tomasz Kaminski wrote: On Sun, Apr 13, 2025 at 12:13 PM François Dumont wrote: On 11/04/2025 08:36, Tomasz Kaminski wrote: On Thu, Apr 10, 2025 at 10:47 PM Jonathan Wakely wrote: On 10/04/25 22:36 +0200, François Dumont wrote: >After r

[PUSHED/14 5/6] match: Reject non-ssa name/min invariants in gimple_extract [PR116412]

2025-04-14 Thread Andrew Pinski
After the conversion for phiopt's conditional operand to use maybe_push_res_to_seq, it was found that gimple_extract will extract out from REALPART_EXPR/IMAGPART_EXPR/VCE and BIT_FIELD_REF, a memory load. But that extraction was not needed as memory loads are not simplified in match and simplify. S

[PATCH] libatomic: Fix up libat_{,un}lock_n for mingw [PR119796]

2025-04-14 Thread Jakub Jelinek
Hi! Here is just a port of the previously posted patch to mingw which clearly has the same problems. Untested though, I don't have Windows anywhere around. 2025-04-14 Jakub Jelinek PR libstdc++/119796 * config/mingw/lock.c (libat_lock_n, libat_unlock_n): Start with co

[COMMITTED 17/19] gccrs: nr2.0: Only insert derive macros if they exist

2025-04-14 Thread arthur . cohen
From: Arthur Cohen This causes an assertion failure when compiling core with nr2.0, but should probably be improved. I'm not sure how this code enables built-in derive macros to be resolved so this is a temporary fix. gcc/rust/ChangeLog: * resolve/rust-early-name-resolver-2.0.cc (Early:

[PATCH] ltmain.in: don't suppress output for PIC compilations

2025-04-14 Thread Sam James
When working on xz, I set `-Werror=suggest-attribute=returns_nonnull`, and the build failed (as I expected it to), but with no visible error from the compiler. There's a mysterious '>/dev/null 2>&1' on the second line where liblzma_la-common.o is built without PIC. With -fPIC, IPA doesn't end up d

[PUSHED/14 4/6] vec-lowering: Fix ABSU lowering [PR111285]

2025-04-14 Thread Andrew Pinski
ABSU_EXPR lowering incorrectly used the resulting type for the new expression but in the case of ABSU the resulting type is an unsigned type and with ABSU is folded away. The fix is to use a signed type for the expression instead. Bootstrapped and tested on x86_64-linux-gnu. PR middle-end

[COMMITTED 13/19] gccrs: Fix const checking of enum discriminants

2025-04-14 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * checks/errors/rust-const-checker.cc (ConstChecker::visit): Visit the enum items of enums. * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Resolve enum discriminants during nr1.0. gcc/testsuite/ChangeLog: *

[PATCH] pretty-print, expand: Print [must tail call] for CALL_EXPRs and fix up maybe_complain_about_tail_call [PR119718]

2025-04-14 Thread Jakub Jelinek
Hi! Andrew P. mentioned earlier he'd like to see in the dump files a note whether it was a failed must tail call or not. We already print that on the tailc/musttail pass side, because print_gimple_stmt prints [must tail call] after the musttail calls. The first hunk below does it for GENERIC CALL_

[PUSHED/14 3/6] backprop: Fix deleting of a phi node [PR116922]

2025-04-14 Thread Andrew Pinski
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 possibility of using simple_dce_from_worklist instead but that is for an

[COMMITTED 08/19] gccrs: ast: Add get_locus() to DelimTokenTree

2025-04-14 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * ast/rust-ast.h (DelimTokenTree::get_locus): New function. --- gcc/rust/ast/rust-ast.h | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h index 09e0fce4f19..91611ec6a62 100644 --- a/gcc/rust/ast/r

[PUSHED/14 0/6] Back port a few patches to 14

2025-04-14 Thread Andrew Pinski
Backport a few of my patches from the trunk to GCC 14 release branch. These all have been sitting on the trunk for some time now so it was time to backport them before a release. Andrew Pinski (6): phiopt: Fix VCE moving by rewriting it into cast [PR116098] aarch64: Fix early ra for -fno-delet

[PUSHED/14 1/6] phiopt: Fix VCE moving by rewriting it into cast [PR116098]

2025-04-14 Thread Andrew Pinski
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 to move_stmt for the VCE case. This is enough to fix the issue a

[PUSHED/14 2/6] aarch64: Fix early ra for -fno-delete-dead-exceptions [PR116927]

2025-04-14 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

[COMMITTED 04/19] rust: Add comment inside block [PR119342]

2025-04-14 Thread arthur . cohen
From: Andrew Pinski Inside a BLOCK node, all of the variables of the scope/block are chained together and that connects them to the block. This just adds a comment to that effect as reading the code it is not so obvious why they need to be chained together. gcc/rust/ChangeLog: PR rust/1

[PATCH] libatomic: Fix up libat_{,un}lock_n [PR119796]

2025-04-14 Thread Jakub Jelinek
Hi! As mentioned in the PR (and I think in PR101075 too), we can run into deadlock with libat_lock_n calls with larger n. As mentioned in PR66842, we use multiple locks (normally 64 mutexes for each 64 byte cache line in 4KiB page) and currently can lock more than one lock, in particular for n [0,

Re: [v2] Polish 'dg-output-file' test logs (was: [PATCH] testsuite: Add support for dg-output-file directive)

2025-04-14 Thread Jakub Jelinek
On Mon, Apr 14, 2025 at 07:47:21PM +0200, Thomas Schwinge wrote: > gcc/testsuite/ > * lib/gcc-dg.exp (${tool}_load): Polish 'dg-output-file' test > logs. > --- > gcc/testsuite/lib/gcc-dg.exp | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/gcc/testsuite

Re: [PATCH] AArch64: Fix operands order in vec_extract expander

2025-04-14 Thread Kyrylo Tkachov
Hi Tejas, > On 14 Apr 2025, at 16:04, Tejas Belagod wrote: > > The operand order to gen_vcond_mask call in the vec_extract pattern is wrong. > Fix the order where predicate is operand 3. > > Tested and bootstrapped on aarch64-linux-gnu. OK for trunk? > > gcc/ChangeLog > > * config/aarch64/aar

[v2] Polish 'dg-output-file' test logs (was: [PATCH] testsuite: Add support for dg-output-file directive)

2025-04-14 Thread Thomas Schwinge
Hi! On 2025-04-13T17:15:05+0200, I wrote: > On 2025-03-18T14:54:23+0100, Jakub Jelinek wrote: >> The following patch offers [...] dg-output-file >> directive where one can supply a text file with expected output > >> --- gcc/doc/sourcebuild.texi.jj 2025-03-11 09:18:21.750133577 +0100 >> +++

[committed] testsuite: Fix up ipa/pr119530.c testcase [PR119318]

2025-04-14 Thread Jakub Jelinek
Hi! On Sat, Apr 12, 2025 at 12:19:28AM +0200, Martin Jambor wrote: > 2025-04-11 Martin Jambor > > PR ipa/119318 > * gcc.dg/ipa/pr119318.c: New test. > * gcc.dg/ipa/pr119530.c: Likwise. I'm seeing +FAIL: gcc.dg/ipa/pr119530.c execution test on i686-linux. The problem is that

Re: [RFC] [C]New syntax for the argument of counted_by attribute for C language

2025-04-14 Thread Bill Wendling
SAfter being on a mini-vacation and thinking about this more, I'm a bit less satisfied with the current proposal. The main issue is that we have seemingly two lookup rules based on which attribute is used (counted_by vs. counted_by_expr). 1. counted_by: We expect an expression that's a l

[COMMITTED 19/19] gccrs: lang-items: Add ManuallyDrop

2025-04-14 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * util/rust-lang-item.h: Add new manually_drop lang item. * util/rust-lang-item.cc: Likewise. --- gcc/rust/util/rust-lang-item.cc | 1 + gcc/rust/util/rust-lang-item.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/gcc/rust/util/ru

Re: [PATCH] expmed: Always use QImode for init_expmed set_zero_cost [PR119785]

2025-04-14 Thread Richard Biener
> Am 14.04.2025 um 18:19 schrieb Jakub Jelinek : > > Hi! > > This is a regression on some targets introduced I believe by r6-2055 > which added mode argument to set_src_cost. > > The problem here is that in the first iteration, mode is always QImode > and we get as -Os zero cost set_src_cost

Re: [PATCH] cobol: Fix -fmax-errors option [PR119776]

2025-04-14 Thread Richard Biener
> Am 14.04.2025 um 18:13 schrieb Jakub Jelinek : > > Hi! > > There seems to be inconsistency in the -fmax-errors option > naming. It is a generic option in common.opt (so applies > to all languages) but with the = character in it. > The gcobol.1 man page in one spot documents the generic > o

[COMMITTED 16/19] gccrs: attributes: Add missing attributes used in `core`

2025-04-14 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * util/rust-attribute-values.h: Add missing attributes. * util/rust-attributes.cc: Likewise. * util/rust-attributes.h (enum CompilerPass): Mention adding something for const functions. --- gcc/rust/util/rust-attribute-value

[COMMITTED 12/19] gccrs: format_args: Allow extraneous commas, improve safety

2025-04-14 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * expand/rust-macro-builtins-format-args.cc (format_args_parse_arguments): Improve safety, allow extra commas after end of argument list. gcc/testsuite/ChangeLog: * rust/compile/format_args_extra_comma.rs: New test. --- .../expan

[COMMITTED 14/19] gccrs: install.texi: Mention Rust requirement for building gccrs

2025-04-14 Thread arthur . cohen
From: Arthur Cohen Addresses PR#117869 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117869 gcc/ChangeLog: * doc/install.texi: Add requirements for building gccrs. --- gcc/doc/install.texi | 6 ++ 1 file changed, 6 insertions(+) diff --git a/gcc/doc/install.texi b/gcc/doc/install.

Re: [PATCH v2] libstdc++: Fix std::string construction from volatile char* [PR119748]

2025-04-14 Thread Tomasz Kaminski
On Mon, Apr 14, 2025 at 6:08 PM Jonathan Wakely wrote: > On Mon, 14 Apr 2025 at 16:25, Tomasz Kaminski wrote: > > > > > > > > On Mon, Apr 14, 2025 at 5:06 PM Jonathan Wakely > wrote: > >> > >> My recent r15-9381-g648d5c26e25497 change assumes that a contiguous > >> iterator with the correct val

[COMMITTED 09/19] gccrs: session: Desugar question mark operator after expansion instead.

2025-04-14 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * rust-session-manager.cc (Session::compile_crate): Call the visitor later in the pipeline. --- gcc/rust/rust-session-manager.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-s

[COMMITTED 11/19] gccrs: expansion: Desugar doc comments into attributes before expansion

2025-04-14 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * expand/rust-macro-expand.cc (MacroExpander::expand_decl_macro): Call into TokenTreeDesugar. * expand/rust-token-tree-desugar.cc: New file. * expand/rust-token-tree-desugar.h: New file. * Make-lang.in: Compile them.

[COMMITTED 01/19] rust: Use FLOAT_TYPE_P instead of manual checking

2025-04-14 Thread arthur . cohen
From: Andrew Pinski This moves is_floating_point over to using FLOAT_TYPE_P instead of manually checking. Note before it would return true for all COMPLEX_TYPE but complex types' inner type could be integral. Also fixes up the comment to be in more of the GNU style. Bootstrapped and tested on x

[COMMITTED 10/19] gccrs: expansion: Only add fragments if the matcher succeeded

2025-04-14 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * expand/rust-macro-expand.cc (MacroExpander::match_n_matches): Do not insert fragments and substack fragments if the matcher failed. gcc/testsuite/ChangeLog: * rust/compile/macros/mbe/macro-issue3708.rs: New test. --- gcc/rust/ex

[COMMITTED 06/19] gccrs: nr2.0: Do not resolve modules this run if they are unloaded

2025-04-14 Thread arthur . cohen
From: Arthur Cohen Instead, mark the visitor as dirty and wait for the next round of the fixed point to take care of them. This avoids issues with module items being loaded while not being stripped yet. gcc/rust/ChangeLog: * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit)

[COMMITTED 02/19] rust: Use error_operand_p in rust-gcc.cc

2025-04-14 Thread arthur . cohen
From: Andrew Pinski Just a simple cleanupof the code to use error_operand_p instead of directly comparing against error_mark_node. This also moves some cdoe around when dealing with error_operand_p just to be faster and/or slightly tighten up the code slightly. gcc/rust/ChangeLog: * ru

[COMMITTED 03/19] rust: use range for inside rust-gcc.cc [PR119341]

2025-04-14 Thread arthur . cohen
From: Andrew Pinski There are some places inside rust-gcc.cc which are candidates to use range for instead of iterators directly. This changes the locations I saw and makes the code slightly more readable. gcc/rust/ChangeLog: PR rust/119341 * rust-gcc.cc (function_type): Use ran

[COMMITTED 07/19] gccrs: ast: Support outer attributes for AST::RangeExpr

2025-04-14 Thread arthur . cohen
From: Arthur Cohen gcc/rust/ChangeLog: * ast/rust-expr.h (class RangeExpr): Add empty outer attributes and allow getting them and setting them. --- gcc/rust/ast/rust-expr.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gcc/rust/ast/rust-expr.h

[PATCH] c++: improve constraint recursion diagnostic

2025-04-14 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk and perhaps 14? -- >8 -- Our constraint recursion diagnostics are not ideal because they usually show the atom with an uninstantiated parameter mapping, e.g concepts-recursive-sat5.C:6:41: error: satisfaction of atomi

[PATCH] expmed: Always use QImode for init_expmed set_zero_cost [PR119785]

2025-04-14 Thread Jakub Jelinek
Hi! This is a regression on some targets introduced I believe by r6-2055 which added mode argument to set_src_cost. The problem here is that in the first iteration, mode is always QImode and we get as -Os zero cost set_src_cost (const0_rtx, QImode, false). But then we use the mode variable for it

Re: [PATCH] cobol: Drop -fsyntax-only from COBOL lang.opt [PR119777]

2025-04-14 Thread Richard Biener
> Am 14.04.2025 um 17:56 schrieb Jakub Jelinek : > > Hi! > > The comment is incorrect, fsyntax-only is not documented in c.opt, > but in common.opt: > fsyntax-only > Common Var(flag_syntax_only) > Check for syntax errors, then stop. > and as such it applies to all languages, so adding CL_Cobo

Re: [PATCH v2] libstdc++: Fix std::string construction from volatile char* [PR119748]

2025-04-14 Thread Jonathan Wakely
On Mon, 14 Apr 2025 at 16:25, Tomasz Kaminski wrote: > > > > On Mon, Apr 14, 2025 at 5:06 PM Jonathan Wakely wrote: >> >> My recent r15-9381-g648d5c26e25497 change assumes that a contiguous >> iterator with the correct value_type can be converted to a const charT* >> but that's not true for volat

[PATCH] cobol: Fix -fmax-errors option [PR119776]

2025-04-14 Thread Jakub Jelinek
Hi! There seems to be inconsistency in the -fmax-errors option naming. It is a generic option in common.opt (so applies to all languages) but with the = character in it. The gcobol.1 man page in one spot documents the generic option (in the syntax, -fmax-errors=nerror) but in another spot without

[PUSHED] testcase: Add testcase for already fixed PR [PR118476]

2025-04-14 Thread Andrew Pinski
This testcase was fixed by r15-3052-gc7b76a076cb2c6ded but is a testcase that failed in a different fashion and a much older failure than the one added with r15-3052. Pushed as obvious after a quick test. PR tree-optimization/118476 gcc/testsuite/ChangeLog: * gcc.dg/torture/pr11

Re: [PATCH] pretty-print, expand: Print [must tail call] for CALL_EXPRs and fix up maybe_complain_about_tail_call [PR119718]

2025-04-14 Thread Richard Biener
> Am 14.04.2025 um 17:47 schrieb Jakub Jelinek : > > Hi! > > Andrew P. mentioned earlier he'd like to see in the dump files a note > whether it was a failed must tail call or not. > We already print that on the tailc/musttail pass side, because > print_gimple_stmt prints [must tail call] afte

Re: [PATCH] cobol: Fix up COBOL -include [PR119777]

2025-04-14 Thread Richard Biener
> Am 14.04.2025 um 17:59 schrieb Jakub Jelinek : > > Hi! > > I was looking through options.cc diff between GCC 14 and 15, looking for > entries with added CL_Cobol where at least one other language is present > and was present before too. Besides the -fsyntax-only changes this is > the only

[PATCH] cobol: Fix up COBOL -include [PR119777]

2025-04-14 Thread Jakub Jelinek
Hi! I was looking through options.cc diff between GCC 14 and 15, looking for entries with added CL_Cobol where at least one other language is present and was present before too. Besides the -fsyntax-only changes this is the only other one I found, COBOL adds Var(cobol_include) to something which

[PATCH] cobol: Drop -fsyntax-only from COBOL lang.opt [PR119777]

2025-04-14 Thread Jakub Jelinek
Hi! The comment is incorrect, fsyntax-only is not documented in c.opt, but in common.opt: fsyntax-only Common Var(flag_syntax_only) Check for syntax errors, then stop. and as such it applies to all languages, so adding CL_Cobol to the CL_COMMON is both unnecessary and because of RejectNegative whi

Re: Asan/Tsan Unit/Regression testing (was [asan] Emit GIMPLE direclty, small cleanups)

2025-04-14 Thread Jakub Jelinek
On Mon, Apr 14, 2025 at 03:33:10PM +0200, Thomas Schwinge wrote: > Hi! > > I've got a question regarding the 'gcc/testsuite/lib/asan-dg.exp' > overriding of '${tool}_load', which was introduced here, > Subversion r193511 (Git commit 8335a6439ddb66aa9ebc67ee47aa2e6e317e3ef9): > > On 2012-11-14T12:

[PATCH] tree-optimization/119757 - reject mixed mask/non-mask ldst SLP

2025-04-14 Thread Richard Biener
The following makes sure to not mix masked/non-masked stmts when forming a SLP node. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. PR tree-optimization/119757 * tree-vect-slp.cc (vect_build_slp_tree_1): Record and compare whether a stmt uses a maks.

  1   2   >