Re: [PATCH] [RISC-V] Fix shift type for RVV interleaved stepped patterns [PR120356]

2025-07-01 Thread Robin Dapp
It corrects the shift type of interleaved stepped patterns for const vector expanding in LRA. The shift instruction was initially LSHIFTRT, and it seems still should be the same type for both LRA and other cases. This is OK, thanks. -- Regards Robin

[PATCH] aarch64: Enable selective LDAPUR generation for cores with RCPC2

2025-07-01 Thread Soumya AR
This patch adds the ability to fold the address computation into the addressing mode for LDAPR instructions using LDAPUR when RCPC2 is available. LDAPUR emission is controlled by the tune flag enable_ldapur, to enable it on a per-core basis. Earlier, the following code: uint64_t foo (std::atomic

Re: [PATCH v6 1/3][Middle-end] Provide more contexts for -Warray-bounds, -Wstringop-*warning messages due to code movements from compiler transformation (Part 1) [PR109071, PR85788, PR88771, PR106762,

2025-07-01 Thread Richard Biener
On Mon, Jun 30, 2025 at 10:37 PM Qing Zhao wrote: > > Hi, David, > > Thank you for the info. > > Yes, this does sound like a general issue in this area. > > Is there any mechanism in GCC currently that records such original source > code information for IRs > after the compiler transformation? >

[COMMITTED 01/42] ada: Fix detecting Compilation_Errors

2025-07-01 Thread Marc Poulhiès
From: Viljar Indus Subprogram Compilation_Errors is used to check whether any errors have been detected during the compilation process. It relies on Total_Errors_Detected and Warnings_Treated_As_Errors counts. Total_Erros_Detected are updated immidiatelly after the error objects have been created

[COMMITTED 02/42] ada: Minor fix in handling of inherited Pre/Post'Class aspect

2025-07-01 Thread Marc Poulhiès
From: Martin Clochard Mapping of calls to primitive functions in Pre/Post'Class aspects inherited by derived types was only testing against controlling formals of the parent subprogram. This lead to missing some calls, because formals could be rewritten to that of the derived subprogram before th

[COMMITTED 08/42] ada: Get rid of multiple roundings for 'Value of ordinary fixed-point types

2025-07-01 Thread Marc Poulhiès
From: Eric Botcazou They are used to minimize the error after every operation, but they can be eliminated by increasing the precision of the input value, which avoids the unwanted effects of multiple roundings. gcc/ada/ChangeLog: * libgnat/s-valuer.ads (System.Value_R): Remove Round par

[COMMITTED 17/42] ada: Fix wrong finalization of constrained subtype of unconstrained array type

2025-07-01 Thread Marc Poulhiès
From: Eric Botcazou Dynamically allocated objects of a constrained subtype of an unconstrained array type with a controlled component type have not been properly finalized since the first rewrite of the finalization machinery more than a decade ago. The reason is that the Finalize_Address routin

[COMMITTED 13/42] ada: Use common routine to handle warning counting

2025-07-01 Thread Marc Poulhiès
From: Viljar Indus gcc/ada/ChangeLog: * errout.adb (Delete_Warning_And_Continuations): Use Decrease_Error_Msg_Count to update the message counts. (Delete_Warning): Likewise. (To_Be_Removed): Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/

Re: [PATCH] tailc: Handle musttail in case of non-cleaned-up cleanups, especially ASan related [PR120608]

2025-07-01 Thread Richard Biener
On Mon, 30 Jun 2025, Jakub Jelinek wrote: > Hi! > > The following testcases FAIL at -O0 -fsanitize=address. The problem is > we end up with something like > _26 = foo (x_24(D)); [must tail call] > // predicted unlikely by early return (on trees) predictor. > finally_tmp.3_27 = 0; > goto

[COMMITTED 16/42] ada: Dispatching call with mutably tagged objects

2025-07-01 Thread Marc Poulhiès
From: Javier Miranda The compiler rejects performing a dispatching call using the prefix notation when the prefix of the call is a mutably tagged class-wide type object. gcc/ada/ChangeLog: * sem_ch4.adb (Try_Object_Operation): Handle mutably tagged class-wide type prefix. Teste

Re: [PATCH] tailc: Handle musttail in case of non-cleaned-up cleanups, especially ASan related [PR120608]

2025-07-01 Thread Jakub Jelinek
On Tue, Jul 01, 2025 at 10:43:09AM +0200, Richard Biener wrote: > > The following patch fixes that by > > 1) moving the musttail pass 2 passes earlier (this is mostly just > >for -O0/-Og, for normal optimization levels musttail calls are > >handled in the tailc pass), i.e. across the sanopt

[COMMITTED 28/42] ada: Disable -gnatR2 output in case of object renamings

2025-07-01 Thread Marc Poulhiès
From: Bob Duff Such output was unnecessary, and in some cases harmful. In particular, we generate renamings in the expanded code for protected types, with internally-generated names, which could be confusing to the user. In addition, in the JSON output (-gnatR2j), these generated renamings could

[COMMITTED 42/42] ada: Restore consistent rounding of 'Value for ordinary fixed-point types

2025-07-01 Thread Marc Poulhiès
From: Eric Botcazou This restores the rounding of the first scaled divide operation applied to the extra digits, which yields more consistent results for smalls that are reciprocal of integers. gcc/ada/ChangeLog: * libgnat/s-valuef.adb (Integer_to_Fixed): Restore rounding of the

[COMMITTED 20/42] ada: Remove useless subexpressions

2025-07-01 Thread Marc Poulhiès
From: Ronan Desplanques The subexpressions this patch removes were clearly useless given the test for "No (Scheme)" in a preceding condition. gcc/ada/ChangeLog: * exp_ch5.adb (Expand_N_Loop_Statement): Remove useless subexpressions. Tested on x86_64-pc-linux-gnu, committed on master.

[PATCH] testsuite: i386: Fix g++.target/i386/memset-pr101366-1.C etc. on Solaris/x86

2025-07-01 Thread Rainer Orth
Several new tests from commit d073bb6cfc219d4b6c283a0b527ee88b42e640e0 Author: H.J. Lu Date: Thu Mar 18 18:43:10 2021 -0700 x86: Update memcpy/memset inline strategies for -mtune=generic FAIL on Solaris/x86: FAIL: g++.target/i386/memset-pr101366-1.C check-function-bodies _Z4TestPc FAIL

[COMMITTED 32/42] ada: Compiler fails on unchecked deallocation for constrained protected subtype

2025-07-01 Thread Marc Poulhiès
From: Gary Dismukes The compiler fails with an error or Assert_Failure when calling an instantiation of Unchecked_Deallocation that has been instantiated with a constrained subtype of a discriminated protected type. gcc/ada/ChangeLog: * sem_ch3.adb (Constrain_Corresponding_Record): Inhe

[COMMITTED 22/42] ada: freeze.adb: do not emit error on non-aligned component in CodePeer_Mode

2025-07-01 Thread Marc Poulhiès
From: Ghjuvan Lacambre These errors hinder analysis of non-GNAT code and are not useful to the user as CodePeer does not care about alignment. gcc/ada/ChangeLog: * freeze.adb (Freeze_Record_Type): Check for CodePeer_Mode. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ad

Re: [PATCH] testsuite: i386: Fix g++.target/i386/memset-pr101366-1.C etc. on Solaris/x86

2025-07-01 Thread H.J. Lu
On Tue, Jul 1, 2025 at 4:57 PM Rainer Orth wrote: > > Several new tests from > > commit d073bb6cfc219d4b6c283a0b527ee88b42e640e0 > Author: H.J. Lu > Date: Thu Mar 18 18:43:10 2021 -0700 > > x86: Update memcpy/memset inline strategies for -mtune=generic > > FAIL on Solaris/x86: > > FAIL: g+

[COMMITTED 37/42] ada: Do minimal expansion of fixedpoint operations for GNATprove

2025-07-01 Thread Marc Poulhiès
From: Piotr Trojanek A minimal expansion of fixedpoint operations is needed for GNATprove, because the subsequent resolution of type conversion relies on this expansion being done. gcc/ada/ChangeLog: * exp_ch4.adb (Fixup_Universal_Fixed_Operation): Move to spec. * exp_ch4.ads (F

[COMMITTED 33/42] ada: Split the unit System.Case_Utilities into two parts.

2025-07-01 Thread Marc Poulhiès
From: Steve Baird The package System.Case_Utilities provides some subprograms that do not make use of the secondary stack and some that do. When compiling in a context where no secondary stack support is provided, this makes the entire package unusable (and similarly for any other package that wi

[COMMITTED 34/42] ada: Reduce the likelihood of overflow in Tanh

2025-07-01 Thread Marc Poulhiès
From: Tonu Naks gcc/ada/ChangeLog: * libgnat/a-ngelfu.adb: conditional computation of X^2 Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/a-ngelfu.adb | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gcc/ada/libgnat/a-ngelfu.adb

Re: [PATCH v7 2/3] Use the counted_by attribute of pointers in builtinin-object-size.

2025-07-01 Thread Richard Biener
On Tue, Jun 24, 2025 at 10:30 PM Qing Zhao wrote: > > gcc/ChangeLog: > > * tree-object-size.cc (access_with_size_object_size): Update comments > for pointers with .ACCESS_WITH_SIZE. > (collect_object_sizes_for): Propagate size info through GIMPLE_ASSIGN > for pointe

Re: [PATCH] libphobos: Fully enable Darwin/i386 support

2025-07-01 Thread Rainer Orth
Hi Iain, >> On 30 Jun 2025, at 12:58, Rainer Orth wrote: >> >> I recently noticed that libphobos isn't enable by default on 32-bit >> Darwin with the target triples determined by config.guess. E.g. on a >> Darwin 15 system the target triple is something like >> i386-apple-darwin15.6.0 while con

[COMMITTED 12/42] ada: Mark errors that are removed as deleted

2025-07-01 Thread Marc Poulhiès
From: Viljar Indus gcc/ada/ChangeLog: * errout.adb (Remove_Warning_Messages): Mark removed messages as deleted. * erroutc.adb (Purge_Messages): Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/errout.adb | 2 ++ gcc/ada/erroutc.adb | 2 ++ 2 f

[COMMITTED 09/42] ada: Fix wrong finalization of constrained array derived from unconstrained

2025-07-01 Thread Marc Poulhiès
From: Eric Botcazou The bug had been present for dynamically allocated objects since the first rewrite of the finalization machinery more than a decade ago, and was then propagated to statically declared objects by the recent rewrite. gcc/ada/ChangeLog: * exp_util.adb (Finalize_Address)

[COMMITTED 06/42] ada: Set ekind of loop parameters earlier

2025-07-01 Thread Marc Poulhiès
From: Ronan Desplanques gcc/ada/ChangeLog: * sem_ch5.adb (Analyze_Loop_Parameter_Specification): Set ekind earlier. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/sem_ch5.adb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gcc/ada/sem_ch5

[COMMITTED 04/42] ada: Fix wrong finalization of temporary constrained array of controlled type

2025-07-01 Thread Marc Poulhiès
From: Eric Botcazou This regression has been introduced by the rewrite of the finalization machinery, which now requires a specific handling of constrained array types with controlled component and an unconstrained first subtype. gcc/ada/ChangeLog: * exp_util.adb (Is_Expression_Of_Func_

[COMMITTED 21/42] ada: Move aspects when instantiating subprograms as compilation units

2025-07-01 Thread Marc Poulhiès
From: Piotr Trojanek When rewriting N_Subprogram_Instantiation into wrapper packages we must move the original aspect specifications to the wrapper packages, as otherwise they will be only accessible via Original_Node. This is similar to how we move aspect specifications for expression functions

Re: [PATCH v2 5/5] libstdc++: Make mdspan nothrow movable.

2025-07-01 Thread Tomasz Kaminski
Hi, I do not think that the change is necessary, as for the functions default on the first declaration (as in the case for the constructors/assigments for mdpsan) have noexcept specifier deduced from it body. In other words, I think the test should pass, without adding the complicated noexcept con

[COMMITTED 40/42] ada: Remove unused variables from the binder generation routine

2025-07-01 Thread Marc Poulhiès
From: Piotr Trojanek Remove leftovers from zero cost exception handling; semantics is unaffected. gcc/ada/ChangeLog: * ali.ads (Unit_Record): Fix grammar in comment. * bindgen.adb (Num_Elab_Calls, Num_Primary_Stacks): Remove counters that were only incremented and never

Re: [PATCH v2 4/5] libstdc++: Implement mdspan and tests.

2025-07-01 Thread Tomasz Kaminski
Few initial comments. I will do a full-review with checks against wording later today or tomorrow. On Fri, Jun 27, 2025 at 11:37 AM Luc Grosheintz wrote: > Implements the class mdspan as described in N4950, i.e. without P3029. > It also adds tests for mdspan. > > libstdc++-v3/ChangeLog: > >

Re: [PATCH v2 1/5] libstdc++: Check prerequisites of layout_*::operator().

2025-07-01 Thread Tomasz Kaminski
Hi, More of the review will be later, but I have noticed that you have added preconditions checks to the layouts, and then avoid checking them inside the operator[] of the mdspan. This is general sounds good. However, the precondition on mdspan::operator[] is now hardened: https://eel.is/c++draft/

Re: [Fortran, Patch, PR120847 (was: PR120846), v1] Fix ICE when a function is called more than once in a coarray expression.

2025-07-01 Thread Andre Vehreschild
Hi Harald, thanks for review. Committed as gcc-16-1891-gee31ab9b195. Sorry for the typo in the email title. I should have proof read that before sending. I will set me a reminder to backport in a week to gcc-15. Thanks again, Andre On Mon, 30 Jun 2025 21:44:03 +0200 Harald Anlauf wrot

[COMMITTED 24/42] ada: Replace references for GLADE with PolyORB

2025-07-01 Thread Marc Poulhiès
From: Tonu Naks gcc/ada/ChangeLog: * doc/gnat_rm/implementation_advice.rst: remove GLADE * doc/gnat_rm/implementation_defined_characteristics.rst: remove GLADE * doc/gnat_rm/specialized_needs_annexes.rst: remove GLADE * doc/gnat_rm/the_gnat_library.rst: remove GLA

Re: [PATCH v2 4/5] libstdc++: Implement mdspan and tests.

2025-07-01 Thread Luc Grosheintz
On 7/1/25 12:44, Tomasz Kaminski wrote: Few initial comments. I will do a full-review with checks against wording later today or tomorrow. On Fri, Jun 27, 2025 at 11:37 AM Luc Grosheintz wrote: Implements the class mdspan as described in N4950, i.e. without P3029. It also adds tests for md

Re: [PATCH 1/1] [RFC][AutoFDO] Propagate information to outline copies if not inlined

2025-07-01 Thread Dhruv Chawla
On 17/06/25 18:35, Jan Hubicka wrote: External email: Use caution opening links or attachments From: Dhruv Chawla This patch modifies afdo_set_bb_count to propagate profile information to outline copies of functions if they are not inlined. This information gets lost otherwise. Signed-off-b

Re: [PATCH] testsuite, powerpc: Fix vsx-vectorize-* after alignment peeling [PR118567]

2025-07-01 Thread Alex Coplan
On 27/02/2025 11:28, Alex Coplan wrote: > On 17/02/2025 14:28, Alex Coplan wrote: > > Hi, > > > > After the recent alignment peeling enhancements in the vectorizer we > > started vectorizing the "checking" loops (that check for the right > > result) in gcc.target/powerpc/vsx-vectorize-*.c, thus s

Re: [PATCH v2 3/5] libstdc++: Restructure mdspan tests to reuse IntLike.

2025-07-01 Thread Tomasz Kaminski
On Fri, Jun 27, 2025 at 11:16 AM Luc Grosheintz wrote: > The class IntLike is used for testing extents with user-defined classes > that convert to int. This commit places the class into a separate header > file. This allows it to be reused across different parts of the mdspan > related testsuite.

Re: [PATCH v2 2/5] libstdc++: Check prerequite of extents::extents.

2025-07-01 Thread Tomasz Kaminski
On Fri, Jun 27, 2025 at 11:29 AM Luc Grosheintz wrote: > Previously the prerequite of the extents ctors that > > static_extent(i) == dynamic_extent || extent(i) == other.extent(i). > > was not checked. This commit add the __glibcxx_assert and test it. > > libstdc++-v3/ChangeLog: > > *

Re: [PATCH v2 5/5] libstdc++: Make mdspan nothrow movable.

2025-07-01 Thread Tomasz Kaminski
Put them into main mdspan commit. No harm in having them. On Tue, Jul 1, 2025 at 3:21 PM Luc Grosheintz wrote: > You're right, I remember checking this; but it appears I conned > myself. I've reverted the change to , do you want to keep > the tests? > > On 7/1/25 12:35, Tomasz Kaminski wrote: >

Re: [PATCH RFC] libgcc: don't use a weak ref for __cxa_finalize

2025-07-01 Thread Jason Merrill
On 6/30/25 5:22 PM, Florian Weimer wrote: * Jason Merrill: On 6/28/25 3:17 PM, Florian Weimer wrote: * Jason Merrill: Since r10-6069[1] we control the call to __cxa_finalize with DEFAULT_USE_CXA_ATEXIT, so there's no need to also declare it as a weak reference; if the target has __cxa_atexit

[PATCH] Handle non default git configurations with mklog

2025-07-01 Thread Pierre-Emmanuel Patry
Mklog parses the diff content from prepare-commit-msg hook but fails when git has been configured with some options (eg. mnemonicPrefix). Forcing the default values for the prefixes and the algorithm would set a distinct diff configuration supported by mklog and prevent most failures. contrib/Chan

Re: [PATCH v2 4/5] libstdc++: Implement mdspan and tests.

2025-07-01 Thread Tomasz Kaminski
On Fri, Jun 27, 2025 at 11:37 AM Luc Grosheintz wrote: > Implements the class mdspan as described in N4950, i.e. without P3029. > It also adds tests for mdspan. > > libstdc++-v3/ChangeLog: > > * include/std/mdspan (mdspan): New class. > * src/c++23/std.cc.in: Add std::mdspan. >

Re: [PATCH v7 2/3] Use the counted_by attribute of pointers in builtinin-object-size.

2025-07-01 Thread Qing Zhao
Thanks a lot for the review. I will push the patch set. Qing > On Jul 1, 2025, at 02:34, Richard Biener wrote: > > On Tue, Jun 24, 2025 at 10:30 PM Qing Zhao wrote: >> >> gcc/ChangeLog: >> >>* tree-object-size.cc (access_with_size_object_size): Update comments >>for pointers

[RFC PATCH 1/1] microblaze: add atomic test and set support

2025-07-01 Thread Neal Frager
This patch adds atomic test and set support for the microblaze arch. Fixes: pr118280 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118280 Test case added to testsuite/gcc.dg/atomic/atomic-pr118280.c Signed-off-by: Aayush Misra Signed-off-by: Neal Frager --- gcc/ChangeLog

[COMMITTED 07/42] ada: Clarify numeric parsing code

2025-07-01 Thread Marc Poulhiès
From: Ronan Desplanques This patch rephrases some code in System.Value_R to make it easier to read. gcc/ada/ChangeLog: * libgnat/s-valuer.adb (Scan_Decimal_Digits, Scan_Integral_Digits): Minor rephrasing. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat

Re: [PATCH v7 4/9] AArch64: add constants for branch displacements

2025-07-01 Thread Richard Sandiford
Karl Meakin writes: > Extract the hardcoded values for the minimum PC-relative displacements > into named constants and document them. > > gcc/ChangeLog: > > * config/aarch64/aarch64.md (BRANCH_LEN_P_128MiB): New constant. > (BRANCH_LEN_N_128MiB): Likewise. > (BRANCH_LEN_P_1MiB):

[PATCH] s390: Add -fno-stack-protector to 3 tests

2025-07-01 Thread Jakub Jelinek
Hi! In Fedora/RHEL we usually test with make check RUNTESTFLAGS="--target_board=unix/'{,-fstack-protector-strong}'" because -fstack-protector-strong is used when building pretty much all the packages. In the past Marek Polacek has committed tweaks to various tests to make them PASS in such testin

Re: [PATCH] c++, v4: Fix up cp_build_array_ref COND_EXPR handling [PR120471]

2025-07-01 Thread Jason Merrill
On 7/1/25 3:10 AM, Jakub Jelinek wrote: On Mon, Jun 30, 2025 at 04:56:47PM -0400, Jason Merrill wrote: On 6/30/25 4:24 PM, Jakub Jelinek wrote: On Mon, Jun 30, 2025 at 03:55:46PM -0400, Jason Merrill wrote: Might go with my earlier !TREE_SIDE_EFFECTS && tree_invariant_p suggestion? If you me

Re: [PATCH v2] vect: Misalign checks for gather/scatter.

2025-07-01 Thread Richard Biener
On Fri, 27 Jun 2025, Robin Dapp wrote: > Hi, > > Changes from v1: > - Add gather_scatter argument to support_vector_misalignment. > - Don't rely on DR_BASE_ALIGNMENT. > - Add IFN helpers and use them. > - Add gather/scatter helper macros. > - Clarify is_packed handling in docs. > > This patch ad

<    1   2