[PATCH] libstdc++: Fix mingw build by using _M_span [PR119970]

2025-04-28 Thread Tomasz Kamiński
The r16-142-g01e5ef3e8b9128 chagned return type of _Str_sink::view() to basic_string_view<_CharT>. The mutable access is provided by _M_span function, that is now used for mingw path. libstdc++-v3/ChangeLog: * include/std/ostream (vprint_unicode) [_WIN32 && !__CYGWIN__]: Call _Str

[PATCH] Allow a PCH to be mapped to a different address

2025-04-28 Thread LIU Hao
This is a response to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=14940#c57 The patch was submitted to MSYS2 for testing in 2022-5. No issue reports have been received so far: * https://github.com/msys2/MINGW-packages/blob/455762a45250642b90e9ff34020d001c1be09015/mingw-w64-gcc/0021-PR14940-Al

New Swedish PO file for 'gcc' (version 15.1.0)

2025-04-28 Thread Translation Project Robot
Hello, gentle maintainer. This is a message from the Translation Project robot. A revised PO file for textual domain 'gcc' has been submitted by the Swedish team of translators. The file is available at: https://translationproject.org/latest/gcc/sv.po (This file, 'gcc-15.1.0.sv.po', has ju

Patch ping (Re: [PATCH] combine: Special case set_noop_p in two spots)

2025-04-28 Thread Jakub Jelinek
On Fri, Mar 28, 2025 at 12:20:18PM +0100, Jakub Jelinek wrote: > Here is the incremental patch I was talking about. > For noop sets, we don't need to test much, they can go to i2 > unless that would violate i3 JUMP condition. > > With this the try_combine on the pr119291.c testcase doesn't fail, >

Re: [PATCH v2] tailcall: Support ERF_RETURNS_ARG for tailcall [PR67797]

2025-04-28 Thread Jakub Jelinek
On Fri, Apr 25, 2025 at 09:12:45PM -0700, Andrew Pinski wrote: > --- a/gcc/tree-tailcall.cc > +++ b/gcc/tree-tailcall.cc > @@ -1083,57 +1083,74 @@ find_tail_calls (basic_block bb, struct tailcall > **ret, bool only_musttail, > { >bool ok = false; >value_range val; > - tre

Re: [PATCH v2 1/3] RISC-V: Combine vec_duplicate + vadd.vv to vadd.vx on GR2VR cost

2025-04-28 Thread Robin Dapp
Make sense to me, it looks like the combine will always take place if GR2VR is 0, 1 or 2 for now. I am try to customize the cost here to make it fail to combine but get failed with below change. + if (rcode == VEC_DUPLICATE && SCALAR_INT_MODE_P (GET_MODE (XEXP (x, 0 { +cost_val = 1; +

[PATCH] debug/78685 - reword -Og documentation

2025-04-28 Thread Richard Biener
The following rewords the documentation for -Og which over-promises the ability to debug the generated code. While -Og enables var-tracking and thus improves debugging in some areas the experience is usually worse than -O0 for standard C code. Any other comments/clarifications? OK? Thanks, Rich

[PATCH v2][committed][14 backport]middle-end: fix masking for partial vectors and early break [PR119351]

2025-04-28 Thread Tamar Christina
Hi All, The following testcase shows an incorrect masked codegen: #define N 512 #define START 1 #define END 505 int x[N] __attribute__((aligned(32))); int __attribute__((noipa)) foo (void) { int z = 0; for (unsigned int i = START; i < END; ++i) { z++; if (x[i] > 0)

[PATCH][committed][14 backport]AArch64: force operand to fresh register to avoid subreg issues [PR118892]

2025-04-28 Thread Tamar Christina
Hi All, When the input is already a subreg and we try to make a paradoxical subreg out of it for copysign this can fail if it violates the subreg relationship. Use force_lowpart_subreg instead of lowpart_subreg to then force the results to a register instead of ICEing. Bootstrapped Regtested on

Re: [PING^2] [PATCH v2] rs6000: Adding missed ISA 3.0 atomic memory operation instructions.

2025-04-28 Thread Surya Kumari Jangala
Hi Jeevitha, Looks like Peter's review comments have not been incorporated. Please update the patch and, as Peter suggested, send the next version of the patch as it's own email thread. Regards, Surya On 03/04/25 8:17 pm, jeevitha wrote: > > Ping! > > please review. > > Thanks & Regards > Jee

[COMMITTED 24/42] gccrs: nr2.0: Fix derive-debug1.rs

2025-04-28 Thread arthur . cohen
From: Owen Avery gcc/testsuite/ChangeLog: * rust/compile/derive-debug1.rs: Adjust a path. * rust/compile/nr2/exclude: Remove derive-debug1.rs. Signed-off-by: Owen Avery --- gcc/testsuite/rust/compile/derive-debug1.rs | 2 +- gcc/testsuite/rust/compile/nr2/exclude | 1 - 2

[COMMITTED 18/42] gccrs: nr2.0: Remove unnecessary copy of Node

2025-04-28 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * resolve/rust-forever-stack.hxx (ForeverStack::resolve_path): Pass instance of Node to lambda by reference instead of by value. Signed-off-by: Owen Avery --- gcc/rust/resolve/rust-forever-stack.hxx | 2 +- 1 file changed, 1 inserti

[COMMITTED 38/42] gccrs: Use specialized param visit function for params

2025-04-28 Thread arthur . cohen
From: Pierre-Emmanuel Patry This commit introduce a new public function to visit function parameters in the default visitor. It allows visitors derived from DefaultVisitor to override only a small part of the default visitor. gcc/rust/ChangeLog: * ast/rust-ast-visitor.cc (DefaultASTVisi

Re: [PATCH] libstdc++: Fix availability of std::erase_if(std::flat_foo) [PR119427]

2025-04-28 Thread Jonathan Wakely
On Mon, 28 Apr 2025 at 16:22, Patrick Palka wrote: > > On Mon, 28 Apr 2025, Jonathan Wakely wrote: > > > On Mon, 28 Apr 2025 at 14:59, Patrick Palka wrote: > > > > > > Tested on x86_64-pc-linux-gnu, does this look OK for trunk/15? > > > > > > -- >8 -- > > > > > > These std::erase_if overloads wer

[COMMITTED 42/42] gccrs: Fix narrowing conversion warnings

2025-04-28 Thread arthur . cohen
From: Owen Avery Fixes PR#119641 gcc/rust/ChangeLog: * checks/errors/borrowck/rust-bir-place.h (IndexVec::size_type): Add. (IndexVec::MAX_INDEX): Add. (IndexVec::size): Change the return type to the type of the internal value used by the index type.

[COMMITTED 31/42] gccrs: Add fn_once and Sized lang items to the test

2025-04-28 Thread arthur . cohen
From: Pierre-Emmanuel Patry gcc/testsuite/ChangeLog: * rust/compile/multiple_bindings1.rs: Add missing lang items. Signed-off-by: Pierre-Emmanuel Patry --- .../rust/compile/multiple_bindings1.rs| 29 --- 1 file changed, 19 insertions(+), 10 deletions(-) diff -

[COMMITTED 33/42] gccrs: Add hash function for Identifiers

2025-04-28 Thread arthur . cohen
From: Pierre-Emmanuel Patry gcc/rust/ChangeLog: * ast/rust-ast.h: Add hash function. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/ast/rust-ast.h | 13 + 1 file changed, 13 insertions(+) diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h index 94585dc1344.

Re: [COMMITTED 09/42] gccrs: Add llvmInlineAsm node

2025-04-28 Thread Andrew Pinski
On Mon, Apr 28, 2025 at 9:05 AM Andrew Pinski wrote: > > On Mon, Apr 28, 2025 at 8:48 AM wrote: > > > > From: Pierre-Emmanuel Patry > > > > InlineAsm node does not support memory clobbers. > > A few review on this. > I think this should just be called extended rather than referencing LLVM here.

[COMMITTED 35/42] gccrs: Add pattern bindings

2025-04-28 Thread arthur . cohen
From: Pierre-Emmanuel Patry gcc/rust/ChangeLog: * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Add binding creation in visitor. * resolve/rust-late-name-resolver-2.0.h: Add function prototypes. * resolve/rust-name-resolution-context.h: Add binding context

Re: [PATCH] ipa, cgraph: Enable constant propagation to OpenMP kernels

2025-04-28 Thread Josef Melcr
Dne 28. 04. 25 v 10:58 Jakub Jelinek napsal(a): On Sun, Apr 27, 2025 at 11:56:21AM +0200, Josef Melcr wrote: * builtin-attrs.def (0): New int list. This is just weird. Write * builtin-attrs.def: Add DEF_LIST_INT_INT (0,2). ? +DEF_CALLBACK_ATTRIBUTE(GOMP, 1, 0) +DEF_CALLBACK_

[COMMITTED 20/42] gccrs: Fix ICE when handling case of unknown field in HIR::FieldAccess

2025-04-28 Thread arthur . cohen
From: Philip Herron We were wrongly adding the assertion that this must not be an enum but this is a pointless assertion we only care that there are variant in the ADT and if the field exists in the first variant. Fixes Rust-GCC#3581 gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-

[COMMITTED 13/42] gccrs: Add gimple test for black box intrinsic

2025-04-28 Thread arthur . cohen
From: Pierre-Emmanuel Patry gcc/testsuite/ChangeLog: * rust/compile/black_box.rs: New test. Signed-off-by: Pierre-Emmanuel Patry --- gcc/testsuite/rust/compile/black_box.rs | 28 + 1 file changed, 28 insertions(+) create mode 100644 gcc/testsuite/rust/compile/

[COMMITTED 19/42] gccrs: Add test case to show ice is fixed

2025-04-28 Thread arthur . cohen
From: Philip Herron Fixes Rust-GCC#3652 gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: nr2 does not error on the T it should require Self::T * rust/compile/issue-3652.rs: New test. Signed-off-by: Philip Herron --- gcc/testsuite/rust/compile/issue-3652.rs | 7 +++ g

[COMMITTED 08/42] gccrs: Emit error with old asm syntax in new asm blocks

2025-04-28 Thread arthur . cohen
From: Pierre-Emmanuel Patry gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_asm_arg): Emit error message. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/expand/rust-macro-builtins-asm.cc | 8 1 file changed, 8 insertions(+) diff --git a/gcc/rust/exp

[COMMITTED 17/42] gccrs: Fix ICE in struct expressions

2025-04-28 Thread arthur . cohen
From: Philip Herron The error handling here was done long ago when we didnt know how to do any error handling very well. This removed bad fatal_errors and adds in some nice rich_location error diagnostics instead. Fixes Rust-GCC#3628 gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-

[COMMITTED 39/42] gccrs: Completely duplicate path node

2025-04-28 Thread arthur . cohen
From: Pierre-Emmanuel Patry Both nodes had the same id, this led to a resolution conflict. gcc/rust/ChangeLog: * expand/rust-derive-clone.cc (DeriveClone::clone_enum_struct): Clone path to avoid using the same nodeid. gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude

[COMMITTED 41/42] gccrs: Visit visibility in UseDeclaration

2025-04-28 Thread arthur . cohen
From: Pierre-Emmanuel Patry Default visitor should visit all it's children. gcc/rust/ChangeLog: * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Visit visibility. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/ast/rust-ast-visitor.cc | 1 + 1 file changed, 1 insertion(+) dif

[COMMITTED 37/42] gccrs: Remove passing test from exclusion list

2025-04-28 Thread arthur . cohen
From: Pierre-Emmanuel Patry gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Remove passing test from exclusion list. Signed-off-by: Pierre-Emmanuel Patry --- gcc/testsuite/rust/compile/nr2/exclude | 2 -- 1 file changed, 2 deletions(-) diff --git a/gcc/testsuite/rust/compile/nr2

[COMMITTED 28/42] gccrs: Prevent forward declaration in type parameters

2025-04-28 Thread arthur . cohen
From: Pierre-Emmanuel Patry gcc/rust/ChangeLog: * resolve/rust-default-resolver.cc (DefaultResolver::visit): Add visit function for TypeParam. * resolve/rust-default-resolver.h: Add function prototype. * resolve/rust-forever-stack.h: Add function to check for forw

[COMMITTED 40/42] gccrs: Some assorted tweaks and bug fixes

2025-04-28 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Visit the loop labels of WhileLetLoopExpr instances before visiting their scrutinee expressions. * resolve/rust-early-name-resolver-2.0.cc (Early::resolve_gl

Re: [COMMITTED 09/42] gccrs: Add llvmInlineAsm node

2025-04-28 Thread Andrew Pinski
On Mon, Apr 28, 2025 at 8:48 AM wrote: > > From: Pierre-Emmanuel Patry > > InlineAsm node does not support memory clobbers. A few review on this. I think this should just be called extended rather than referencing LLVM here. > > gcc/rust/ChangeLog: > > * ast/rust-ast-collector.cc (Token

[COMMITTED 27/42] gccrs: Remove error state for GenericArg

2025-04-28 Thread arthur . cohen
From: Pierre-Emmanuel Patry gcc/rust/ChangeLog: * ast/rust-ast-collector.cc (TokenCollector::visit): Remove error kind and change function call. * ast/rust-ast-visitor.cc (DefaultASTVisitor::visit): Change call name. * ast/rust-path.cc (ConstGenericParam::as_strin

[PATCH v4] arm: Add FMA and FMAF intrinsics with corresponding tests

2025-04-28 Thread Ayan Shafqat
Rebased to GCC 15.1 This patch introduces inline definitions for the __fma and __fmaf functions in arm_acle.h for arm targets. These definitions rely on __builtin_fma and __builtin_fmaf to ensure proper inlining and to meet the ACLE requirements [1]. The patch has been tested locally using a cros

[PATCH][_GLIBCXX_INLINE_VERSION] Fix several test failures

2025-04-28 Thread François Dumont
Hi Pretty straightforward except for the aligned_storage one for which I just avoid the check when gnu-versioned-namespace mode is being used.     libstdc++: [_GLIBCXX_INLINE_VERSION] Fix several tests failures     Several tests are failing when libstdc++ is configured with:     --enable-symv

Re: [PATCH 1/2] gimplefe: Simplify handling of identifier based binary operations

2025-04-28 Thread Andrew Pinski
On Mon, Apr 28, 2025 at 1:13 AM Richard Biener wrote: > > On Sun, Apr 27, 2025 at 12:51 AM Andrew Pinski > wrote: > > > > While looking into adding __ROTATE_LEFT and __ROTATE_RIGHT, I noticed > > this code is just a bunch of if statments repeated. Instead we could just > > use a simple lookup ar

Re: [COMMITTED 09/42] gccrs: Add llvmInlineAsm node

2025-04-28 Thread Arthur Cohen
Hi Andrew, On 4/28/25 6:05 PM, Andrew Pinski wrote: On Mon, Apr 28, 2025 at 8:48 AM wrote: From: Pierre-Emmanuel Patry InlineAsm node does not support memory clobbers. A few review on this. I think this should just be called extended rather than referencing LLVM here. This node exists s

Re: [COMMITTED 09/42] gccrs: Add llvmInlineAsm node

2025-04-28 Thread Arthur Cohen
Hi, On 4/28/25 6:09 PM, Andrew Pinski wrote: On Mon, Apr 28, 2025 at 9:05 AM Andrew Pinski wrote: On Mon, Apr 28, 2025 at 8:48 AM wrote: From: Pierre-Emmanuel Patry InlineAsm node does not support memory clobbers. A few review on this. I think this should just be called extended rather

[COMMITTED 01/42] gccrs: Fix segv in unsafe chcker

2025-04-28 Thread arthur . cohen
From: Philip Herron Trait constants were missing type resolution step, this adds that as if it was a normal constant. The unsafe checker was missing a null check. Fixes Rust-GCC#3612 gcc/rust/ChangeLog: * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): add null check

[COMMITTED 09/42] gccrs: Add llvmInlineAsm node

2025-04-28 Thread arthur . cohen
From: Pierre-Emmanuel Patry InlineAsm node does not support memory clobbers. gcc/rust/ChangeLog: * ast/rust-ast-collector.cc (TokenCollector::visit): Make visitor unreachable. * ast/rust-ast-collector.h: Add visit for LlvmInlineAsmNode. * ast/rust-ast-visitor.cc

[COMMITTED 02/42] gccrs: Implement typecheck for zero-variant enums

2025-04-28 Thread arthur . cohen
From: Zhi Heng gcc/rust/ChangeLog: * typecheck/rust-tyty.h: Add new `ReprKind` enum to `ReprOptions`. * typecheck/rust-hir-type-check-base.cc: Handle setting of `repr_kind`. * typecheck/rust-hir-type-check-item.cc: New check for zero-variant enums.

[COMMITTED 06/42] gccrs: Fix ICE when checking shift's which are behind array refs

2025-04-28 Thread arthur . cohen
From: Philip Herron I copied a bad form of this check from the c front-end this updates it to ensure the rhs is an INTEGER_CST and the lhs needs checked in the first place. Fixes Rust-GCC#3664 gcc/rust/ChangeLog: * rust-gcc.cc (arithmetic_or_logical_expression): Ensure this is an inte

[COMMITTED 10/42] gccrs: Parse and lower llvm asm node

2025-04-28 Thread arthur . cohen
From: Pierre-Emmanuel Patry Add a new HIR LlvmInlineAsm HIR node as well as some structures to represent it's options and operands. Lower AST::LlvmInlineAsm node to it and then create a tree from that node. gcc/rust/ChangeLog: * ast/rust-ast-collector.cc (TokenCollector::visit): Remove

[COMMITTED 21/42] gccrs: Adjust segment start position errors

2025-04-28 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): Adjust error messages. * resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go): Likewise. * resolve/rust-forever-stack.hxx (check_leading_

[COMMITTED 32/42] gccrs: Add equality operator for identifiers

2025-04-28 Thread arthur . cohen
From: Pierre-Emmanuel Patry gcc/rust/ChangeLog: * ast/rust-ast.h: Add equality operator. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/ast/rust-ast.h | 5 + 1 file changed, 5 insertions(+) diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h index 55f178d782c..94585

[COMMITTED 25/42] gccrs: nr2.0: Improve error handling

2025-04-28 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * resolve/rust-early-name-resolver-2.0.cc (Early::build_import_mapping): Avoid outputting an "unresolved import" error if other errors are outputted during resolution. * resolve/rust-early-name-resolver-2.0.h (Early::re

Re: [PATCH] libstdc++: Fix availability of std::erase_if(std::flat_foo) [PR119427]

2025-04-28 Thread Patrick Palka
On Mon, 28 Apr 2025, Jonathan Wakely wrote: > On Mon, 28 Apr 2025 at 14:59, Patrick Palka wrote: > > > > Tested on x86_64-pc-linux-gnu, does this look OK for trunk/15? > > > > -- >8 -- > > > > These std::erase_if overloads were wrongly implemented as hidden > > friends, visible only via ADL, so e

Re: [PATCH 2/4] cfgloopmanip: Add infrastructure for scaling of multi-exit loops [PR117790]

2025-04-28 Thread Alex Coplan
On 15/04/2025 19:48, Jan Hubicka wrote: > Hi, > > gcc/ChangeLog: > > > > PR tree-optimization/117790 > > * tree-vect-loop.cc (scale_profile_for_vect_loop): Use > > scale_loop_profile_hold_exit_counts instead of scale_loop_profile. Drop > > the exit edge parameter, since the code n

[COMMITTED 16/42] gccrs: nr2.0: Handle StructPatternFieldIdent

2025-04-28 Thread arthur . cohen
From: Owen Avery gcc/rust/ChangeLog: * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Handle StructPatternFieldIdent. * resolve/rust-late-name-resolver-2.0.h (Late::visit): Likewise. gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Remove entr

[COMMITTED 11/42] gccrs: Add LlvmInlineAsm node dump

2025-04-28 Thread arthur . cohen
From: Pierre-Emmanuel Patry gcc/rust/ChangeLog: * ast/rust-ast-collector.cc (TokenCollector::visit): Dump llvm inline asm tokens. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/ast/rust-ast-collector.cc | 39 +- 1 file changed, 38 insertions(+),

[COMMITTED 05/42] gccrs: Fix crash in hir dump as labels are optional

2025-04-28 Thread arthur . cohen
From: Philip Herron gcc/rust/ChangeLog: * hir/rust-hir-dump.cc (Dump::visit): add guard for optional label Signed-off-by: Philip Herron --- gcc/rust/hir/rust-hir-dump.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/rust/hir/rust-hir-dump.cc b/gcc/rust/hir

[COMMITTED 03/42] gccrs: Implement integer representation for enums

2025-04-28 Thread arthur . cohen
From: Zhi Heng gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-base.cc: Set enum representing type properly if repr is an integer type. * typecheck/rust-hir-type-check-item.cc: Update comments. Signed-off-by: Yap Zhi Heng --- gcc/rust/typecheck/rust-hir-type-check-

[COMMITTED 12/42] gccrs: Add execute test for black_box intrinsic

2025-04-28 Thread arthur . cohen
From: Pierre-Emmanuel Patry gcc/testsuite/ChangeLog: * rust/execute/black_box.rs: New test. Signed-off-by: Pierre-Emmanuel Patry --- gcc/testsuite/rust/execute/black_box.rs | 30 + 1 file changed, 30 insertions(+) create mode 100644 gcc/testsuite/rust/execute/

[COMMITTED 15/42] gccrs: Add test case to show ICE is fixed

2025-04-28 Thread arthur . cohen
From: Philip Herron Fixes Rust-GCC#3662 gcc/testsuite/ChangeLog: * rust/compile/issue-3662.rs: New test. Signed-off-by: Philip Herron --- gcc/testsuite/rust/compile/issue-3662.rs | 8 1 file changed, 8 insertions(+) create mode 100644 gcc/testsuite/rust/compile/issue-3662.r

[COMMITTED 07/42] gccrs: Add check for placeholder (infer) type in return position

2025-04-28 Thread arthur . cohen
From: Philip Herron It is not allowed to have a declared inference variable in the return position of a function as this may never get infered you need good points of truth. Ideally if we get a student for GSoC 25 we will get the Default Hir Visitor so that we can grab the HIR::InferredType locu

[COMMITTED 14/42] gccrs: Add test case to show issue is fixed

2025-04-28 Thread arthur . cohen
From: Philip Herron This was already fixed in: bb01719f0e1 but we require fn_once lang item to be defined as we are working on libcore support still. Fixes Rust-GCC#3711 gcc/testsuite/ChangeLog: * rust/compile/issue-3711.rs: New test. Signed-off-by: Philip Herron --- gcc/testsuite/r

[COMMITTED 30/42] gccrs: Change expected error output to match nr2

2025-04-28 Thread arthur . cohen
From: Pierre-Emmanuel Patry Name resolution 2.0 message describes the context around the unresolved items and should therefore be kept. gcc/testsuite/ChangeLog: * rust/compile/nr2/exclude: Remove test from exclusion list. * rust/compile/use_1.rs: Change expected output and remov

[COMMITTED 36/42] gccrs: Use stacked context for nested bindings.

2025-04-28 Thread arthur . cohen
From: Pierre-Emmanuel Patry Binding context may be stacked when a new binding group is introduced within a const expression. gcc/rust/ChangeLog: * resolve/rust-name-resolution-context.h: Use BindingLayer instead. * resolve/rust-name-resolution-context.cc (BindingLayer::BindingLa

[COMMITTED 23/42] gccrs: prealloc the initilizer vector

2025-04-28 Thread arthur . cohen
From: Philip Herron There are two cases when initilizing an array, this is the const context which means we need to build the array ctor, which means using lots of memory, its super inefficient because we are using a big wrapper over the GCC internals here but preallocating the vectors here cause

Re: [PATCH] ipa, cgraph: Enable constant propagation to OpenMP kernels

2025-04-28 Thread Jakub Jelinek
On Sun, Apr 27, 2025 at 11:56:21AM +0200, Josef Melcr wrote: > * builtin-attrs.def (0): New int list. This is just weird. Write * builtin-attrs.def: Add DEF_LIST_INT_INT (0,2). ? > +DEF_CALLBACK_ATTRIBUTE(GOMP, 1, 0) > +DEF_CALLBACK_ATTRIBUTE(GOMP, 1, 2) > +DEF_CALLBACK_ATTRIBUTE(O

[PATCH v2] x86: Add a pass to remove redundant all 0s/1s vector load

2025-04-28 Thread H.J. Lu
On Mon, Apr 28, 2025 at 4:26 PM H.J. Lu wrote: > > > > This is what my patch does: > > But it iterates through vector_insns, using a def-ref chain to find > > those insns. I think we can just record those single_set with src as > > const_m1/zero, and replace src for them. > > Will fix it. Fixed

Re: [PATCH 1/3][stage1] Remove --param vect-force-slp

2025-04-28 Thread Richard Biener
On Thu, Apr 10, 2025 at 4:09 PM Richard Biener wrote: > > The following removes the ability to switch back to non SLP-only > operation of the vectorizer - a requirement to start cleaning out > non-SLP paths without risk of regressing that case. I have pushed this series now. Richard. >

Re: [RFC PATCH] Implement -fdiag-prefix-map

2025-04-28 Thread Rasmus Villemoes
On Thu, 3 Apr 2025 at 13:58, Rasmus Villemoes wrote: > > In many setups, especially when CI and/or some meta-build system like > Yocto or buildroot, is involved, gcc ends up being invoked using > absolute path names, which are often long and uninteresting. > > That amounts to a lot of noise both w

Re: [PATCH][stage1] middle-end/60779 - LTO vs. -fcx-fortran-rules and -fcx-limited-range

2025-04-28 Thread Richard Biener
On Tue, Feb 18, 2025 at 1:44 PM Richard Biener wrote: > > The following changes how flag_complex_method is managed towards > being able to record that in the optimization set so we can stream > and restore it per function. Currently -fcx-fortran-rules and > -fcx-limited-range are separate recorde

Re: [PATCH 1/2] middle-end/116083 - vectorizer slowness

2025-04-28 Thread Richard Biener
On Sat, Dec 14, 2024 at 9:22 PM Jeff Law wrote: > > > > On 12/3/24 10:07 AM, Richard Biener wrote: > > Turns out SLP discovery can end up doing a lot of vector type > > builds from scalar types. Those are all ultimatively cached but > > end up built and layouted first. The latter is particularly

Re: [PATCH] debug/78685 - reword -Og documentation

2025-04-28 Thread Richard Biener
On Mon, 28 Apr 2025, Alexander Monakov wrote: > > On Mon, 28 Apr 2025, Richard Biener wrote: > > > The following rewords the documentation for -Og which over-promises > > the ability to debug the generated code. While -Og enables > > var-tracking and thus improves debugging in some areas the ex

[PATCH v1 3/3] RISC-V: Add testcases for vector unsigned integer SAT_ADD form 7

2025-04-28 Thread pan2 . li
From: Pan Li This patch will add testcase for unsigned integer SAT_ADD form 7: #define DEF_VEC_SAT_U_ADD_FMT_9(WT, T) \ void __attribute__((noinline)) \ vec_sat_u_add_##WT##_##T##_fmt_9 (T *out, T *op_1, T *o

[PATCH v1 1/3] Match: Support form 7 for unsigned integer SAT_ADD

2025-04-28 Thread pan2 . li
From: Pan Li This patch would like to support the form 7 of the unsigned integer SAT_ADD, aka below example. #define DEF_SAT_U_ADD_FMT_7(WT, T) \ T __attribute__((noinline))\ sat_u_add_##WT##_##T##_fmt_7(T x, T y) \ { \ T max = -1;

Re: [PATCH] AArch64: Fold LD1/ST1 with ptrue to LDR/STR for 128-bit VLS

2025-04-28 Thread Richard Sandiford
Kyrylo Tkachov writes: >> On 25 Apr 2025, at 19:55, Richard Sandiford >> wrote: >> >> Jennifer Schmitz writes: >>> If -msve-vector-bits=128, SVE loads and stores (LD1 and ST1) with a >>> ptrue predicate can be replaced by neon instructions (LDR and STR), >>> thus avoiding the predicate altoget

[PATCH v1 0/3] Support form 7 of unsigned integer SAT_ADD

2025-04-28 Thread pan2 . li
From: Pan Li This patch serices would like to support form 7 of the unsigned integer SAT_ADD. Different to another forms of SAT_ADD, the form 7 will leverage a wider type to tell overflow or not, aka: #define DEF_SAT_U_ADD_FMT_7(WT, T) \ T __attribute__((noinline))\ sat_u_

[PATCH v1 2/3] RISC-V: Add testcases for scalar unsigned integer SAT_ADD form 7

2025-04-28 Thread pan2 . li
From: Pan Li This patch will add testcase for unsigned integer SAT_ADD form 7: #define DEF_SAT_U_ADD_FMT_7(WT, T) \ T __attribute__((noinline))\ sat_u_add_##WT##_##T##_fmt_7(T x, T y) \ { \ T max = -1; \

Re: [PATCH] simplify-rtx: Split out native_decode_int

2025-04-28 Thread Richard Biener
On Mon, Apr 28, 2025 at 2:38 PM Richard Sandiford wrote: > > native_decode_rtx handles integer modes by building up a wide_int > and then converting it to an rtx. This patch splits out the > wide_int part, so that callers who don't want an rtx can avoid > creating garbage rtl. > > Bootstrapped &

Re: [PATCH] AArch64: Fold LD1/ST1 with ptrue to LDR/STR for 128-bit VLS

2025-04-28 Thread Kyrylo Tkachov
> On 25 Apr 2025, at 19:55, Richard Sandiford wrote: > > Jennifer Schmitz writes: >> If -msve-vector-bits=128, SVE loads and stores (LD1 and ST1) with a >> ptrue predicate can be replaced by neon instructions (LDR and STR), >> thus avoiding the predicate altogether. This also enables formation

[PATCH] ipa/119973 - IPA PTA issue with global initializers

2025-04-28 Thread Richard Biener
For global initializers with IPA PTA we initialize them from the IPA reference data but that lacks references to the constant pool. The following conservatively considers the whole initializer. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. Richard. PR ipa/119973 *

[PATCH] Extend vect_recog_cond_expr_convert_pattern to handle floating point type.

2025-04-28 Thread liuhongt
For floating point, !flag_trapping_math is needed for the pattern which transforms 2 conversions to 1 conversion, and may lose 1 potential trap. There shouldn't be any accuracy issue. It also handles real_cst if it can be represented in different floating point types without loss of precision. Bo

Re: Help: Re: Questions on replacing a structure pointer reference to a call to .ACCESS_WITH_SIZE in C FE

2025-04-28 Thread Richard Biener
On Mon, Apr 28, 2025 at 2:56 PM Qing Zhao wrote: > > > > > On Apr 28, 2025, at 06:49, Richard Biener > > wrote: > > > > On Wed, Apr 23, 2025 at 6:09 PM Qing Zhao wrote: > >> > >> Richard, > >> > >> Thanks a lot for the hint. > >> > >>> On Apr 23, 2025, at 04:17, Richard Biener > >>> wrote: >

RE: [PATCH] aarch64: Optimize SVE extract last to Neon lane extract for 128-bit VLS.

2025-04-28 Thread Tamar Christina
> -Original Message- > From: Jennifer Schmitz > Sent: Monday, April 28, 2025 11:40 AM > To: gcc-patches@gcc.gnu.org > Cc: Richard Sandiford ; Tamar Christina > > Subject: Re: [PATCH] aarch64: Optimize SVE extract last to Neon lane extract > for > 128-bit VLS. > > > > > On 27 Apr 202

Re: Help: Re: Questions on replacing a structure pointer reference to a call to .ACCESS_WITH_SIZE in C FE

2025-04-28 Thread Qing Zhao
> On Apr 28, 2025, at 09:40, Richard Biener wrote: > > On Mon, Apr 28, 2025 at 2:56 PM Qing Zhao wrote: >> >> >> >>> On Apr 28, 2025, at 06:49, Richard Biener >>> wrote: >>> >>> On Wed, Apr 23, 2025 at 6:09 PM Qing Zhao wrote: Richard, Thanks a lot for the hint. >>

[PATCH] libstdc++: Fix availability of std::erase_if(std::flat_foo) [PR119427]

2025-04-28 Thread Patrick Palka
Tested on x86_64-pc-linux-gnu, does this look OK for trunk/15? -- >8 -- These std::erase_if overloads were wrongly implemented as hidden friends, visible only via ADL, so erase_if(x) would work but not std::erase_if(x). PR libstdc++/119427 libstdc++-v3/ChangeLog: * include/std/

[PATCH v2] [autofdo] Annotate empty bb with all debug_stmt with location of phi in the single_succ.

2025-04-28 Thread liuhongt
From: "hongtao.liu" > I think the comment is a bit off, it should be "For an empty BB ..." since > we should not change behavior on whether there are debug stmts or not. Changed. For an empty BB with all debug_stmt, it will be ignored by afdo_set_bb_count, but it can be set with count of single

Re: [PATCH] PR tree-optimization/95801 - infer non-zero for integral division RHS.

2025-04-28 Thread Andrew MacLeod
I have committed this patch to trunk after bootstrap/regression testing again on trunk. I'll get to gcc14/15 once I flush the current queue. Andrew On 1/23/25 04:39, Richard Biener wrote: On Wed, Jan 22, 2025 at 12:49 AM Andrew MacLeod wrote: This patch simply adds an op2_range to operator_

[COMMITTED] Do not overwrite relation in range_of_range_op.

2025-04-28 Thread Andrew MacLeod
When auditing the code, I noticed that gimple_range_fold::range_of_range_op was reusing a local variable when it shouldn't. It was picking up a relation between op1 and op2, and using that relation to assist in determining if there was a new relation being formed bet6ween LHS and op1/op2. I

[COMMITTED] Add lhs_op1 relation to pointer_plus.

2025-04-28 Thread Andrew MacLeod
When prange was split from irange, the functionality of lhs_op1_relation () did not get ported.   This means when we see:   ptr_2 = ptr_1 + 1 we do not get the relation ptr2 > ptr1 from the statement. This patch adds that functionality back, and is also good example of how to add new dispatch

[pushed: r16-266] analyzer: handle NRVO and DECL_BY_REFERENCE [PR111536]

2025-04-28 Thread David Malcolm
The analyzer was issuing false warnings about uninitialized variables in C++ in places where NRVO was marking DECL_RESULT with DECL_BY_REFERENCE. Fixed thusly. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r16-266-ga1922f0252b3b0. gcc/analyzer/ChangeLog:

[pushed: r16-263] analyzer, c++: add placeholder implementation of ana::translation_unit for C++

2025-04-28 Thread David Malcolm
Implement ana::translation_unit for the C++ frontend with a no-op placeholder implementation, for now. No functional change intended; a follow-up may implement things further. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r16-263-g13f4b12393fa98. gcc/cp/Change

[COMITTED] Add a Relation iterator to the relation oracle.

2025-04-28 Thread Andrew MacLeod
This patch adds a relation iterator to query the oracle to list either all the relations on exit to a block, or just ones involving a specified SSA_NAME. The oracle then uses this iterator internally for printing as proof of concept.  It is also of use in a follow on patch for finding "nearest

[COMMITTED ]Use the current Ranger cache when creating inferred ranges.

2025-04-28 Thread Andrew MacLeod
Last fall, infer range processing was adjusted to allow a query to be specified for something Jakub was working on.  During VRP folding there was an oversight, and ranger was not providing a query.   This results in contextual ranges being missed. This patch  corrects the oversight and passes

[COMMITTED] PR tree-optimization/119712 - Always reflect lower bits from mask in subranges.

2025-04-28 Thread Andrew MacLeod
I have committed this patch to trunk after bootstrap/regression testing again on trunk. I'll get to gcc14/15 once I flush the current queue. Andrew On 4/17/25 06:44, Richard Biener wrote: On Wed, Apr 16, 2025 at 10:55 PM Andrew MacLeod wrote: This was a fun one! An actual bug, and it too

[pushed: r16-253] c, c++: use unique_ptr in name_hint to reduce naked 'new'

2025-04-28 Thread David Malcolm
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r16-253-g9c4336cbf05228. gcc/c-family/ChangeLog: * name-hint.h (name_hint::name_hint): Use std::unique_ptr for param. gcc/c/ChangeLog: * c-decl.cc: Include "make-unique.h". (lookup_na

[pushed: r16-251] diagnostics: make diagnostic_context::m_abort_on_error private

2025-04-28 Thread David Malcolm
No functional change intended. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r16-251-g0c5b98be0806e2. gcc/ChangeLog: * diagnostic.h (diagnostic_context::set_abort_on_error): New. (diagnostic_context::m_abort_on_error): Make private. (dia

[pushed: r16-254] pass_manager: add m_ prefix to pass fields accessed via passes.def

2025-04-28 Thread David Malcolm
Make it clearer when we're accessing member data of pass_manager by adding an "m"_ prefix to the fields handled via passes.def macros. No functional change intended. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r16-254-g1dc8916bcbb14c. gcc/ChangeLog:

[pushed: r16-250] sarif output: introduce sarif_generation_options

2025-04-28 Thread David Malcolm
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r16-250-ga25818cd302a77. gcc/ChangeLog: * diagnostic-format-sarif.cc (sarif_builder::get_opts): New accessor. (sarif_builder::get_version): Update for... (sarif_builder::m_version): Re

[pushed: r16-257] analyzer: use analyzer/common.h as a common header

2025-04-28 Thread David Malcolm
Our headers are a major pain to work with: many require certain other headers to be included in a particular (undocumented) order in order to be includable. Simplify includes in the analyzer by renaming analyzer/analyzer.h to analyzer/common.h and have it include all the common headers needed thro

[pushed: r16-255] analyzer: add a call_details::dump (using text_art)

2025-04-28 Thread David Malcolm
Add a new function to help debugging -fanalyzer. No functional change intended. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r16-255-g0ef00f71969f20. gcc/analyzer/ChangeLog: * call-details.cc (call_details::dump): New overload. (call_details::

[pushed: r16-252] diagnostics: use diagnostic_option_id for m_opt_permissive

2025-04-28 Thread David Malcolm
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r16-252-gbc39b0072f5660. gcc/ChangeLog: * diagnostic.h (diagnostic_context::m_opt_permissive): Convert from int to diagnostic_option_id. Update comment. Signed-off-by: David Malcolm --- gcc/diagno

[pushed: r16-259] analyzer: convert gcall * to gcall & in many places

2025-04-28 Thread David Malcolm
No functional change intended. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r16-259-gc2f8c7ad2db225. gcc/analyzer/ChangeLog: * analyzer.cc: Convert gcall * to gcall & where we know the pointer must be non-null. * call-details.cc: Likewi

gcc-patches@gcc.gnu.org

2025-04-28 Thread David Malcolm
No functional change intended. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r16-260-g4e1f545df9da1d. gcc/analyzer/ChangeLog: * call-summary.cc (call_summary_replay::call_summary_replay): Convert "summary" from call_summary * to call_summary &.

[pushed: r16-261] analyzer: use unique_ptr for state_machine instances

2025-04-28 Thread David Malcolm
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r16-261-g6f9764571d2dd1. gcc/analyzer/ChangeLog: * engine.cc (class plugin_analyzer_init_impl): Convert "m_checkers" to use std::vector of std::unique_ptr. Convert "m_known_fn_mgr" to a refer

[pushed: r16-256] analyzer: fail if we see unexpected gimple stmt codes

2025-04-28 Thread David Malcolm
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r16-256-g5ecea59621c63a. gcc/analyzer/ChangeLog: * region-model.cc (region_model::on_stmt_pre): Use internal_error if we see an unexpected gimple stmt code. Signed-off-by: David Malcolm --- gcc/ana

[pushed: r16-258] analyzer: convert various enums to "enum class"

2025-04-28 Thread David Malcolm
Modernization; no functional change intended. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r16-258-g978e9dfc0a1331. gcc/analyzer/ChangeLog: * access-diagram.cc: Convert enum access_direction to "enum class". * bounds-checking.cc: Likewi

[pushed: r16-265] analyzer: fix null deref false negative on std::unique_ptr [PR109366]

2025-04-28 Thread David Malcolm
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r16-265-g2a63dc8c65d469. gcc/analyzer/ChangeLog: PR analyzer/109366 * region-model-manager.cc (region_model_manager::maybe_fold_sub_svalue): Sub-values of zero constants are zero. gcc

  1   2   >