Re: [PATCH] libquadmath: add quad support for trig-pi functions

2025-07-03 Thread Jakub Jelinek
On Thu, Jul 03, 2025 at 02:43:43PM +0200, Michael Matz wrote: > Hello, > > On Thu, 3 Jul 2025, Yuao Ma wrote: > > > This patch adds the required function for Fortran trigonometric functions to > > work with glibc versions prior to 2.26. It's based on glibc source commit > > 632d895f3e5d98162f77b9

[PATCH v2 0/1] contrib: add bpf-vmtest-tool to test BPF programs

2025-07-03 Thread Piyush Raj
This patch adds initial version of bpf-vmtest-tool script to test BPF programs on live kernel For now, the tool is standalone, but it is intended to be integrated with the DejaGnu testsuite to run BPF testcases in future patches. Current Limitations: - Only x86_64 is supported. Support for addit

[PATCH v2 1/1] contrib: add bpf-vmtest-tool to test BPF programs

2025-07-03 Thread Piyush Raj
This patch adds the bpf-vmtest-tool subdirectory under contrib which tests BPF programs under a live kernel using a QEMU VM. It automatically builds the specified kernel version with eBPF support enabled and stores it under "~/.bpf-vmtest-tool", which is reused for future invocations. It can also

Re: [PATCH] c++: -fno-delete-null-pointer-checks constexpr addr comparison [PR71962]

2025-07-03 Thread Jason Merrill
On 7/2/25 7:58 PM, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- Here the flag -fno-delete-null-pointer-checks causes the trivial address comparison in inline int a, b; static_assert(&a != &b); to be rejected as non-constan

Re: [PATCH] libquadmath: add quad support for trig-pi functions

2025-07-03 Thread Joseph Myers
On Thu, 3 Jul 2025, Jakub Jelinek wrote: > > Isn't the whole raison d'etre for the trig-pi functions that the internal > > argument reduction against multiples of pi becomes trivial and hence (a) > > performant, and (b) doesn't introduce rounding artifacts? Expressing the > > trig-pi functions

Re: [PATCH] libquadmath: add quad support for trig-pi functions

2025-07-03 Thread Yuao Ma
Hi all, On 7/3/2025 9:21 PM, Jakub Jelinek wrote: On Thu, Jul 03, 2025 at 02:43:43PM +0200, Michael Matz wrote: Hello, On Thu, 3 Jul 2025, Yuao Ma wrote: This patch adds the required function for Fortran trigonometric functions to work with glibc versions prior to 2.26. It's based on glibc s

Re: [PATCH] x86-64: Add --enable-x86-64-mfentry

2025-07-03 Thread Uros Bizjak
On Thu, Jul 3, 2025 at 12:01 PM H.J. Lu wrote: > > When profiling is enabled with shrink wrapping, the mcount call may not > be placed at the function entry after > > pushq %rbp > movq %rsp,%rbp > > As the result, the profile data may be skewed which makes PGO less > effective. > > Add --enable-x8

[PATCH] i386: Fix vect-pragma-target-[12].c testcase for -march=XYZ [PR120643]

2025-07-03 Thread Andrew Pinski
These 2 testcases were originally designed for the default -march= of x86_64 so if you pass -march=native (on a target with AVX512 enabled), they will fail. It fix this, we add `-mno-sse3 -mprefer-vector-width=512` to the options to force a specific arch to the testcase. Tested on a skylake-avx512

Re: [PATCH] Update alignment for argument on stack

2025-07-03 Thread Richard Sandiford
"H.J. Lu" writes: > Since a backend may ignore user type alignment for arguments passed on > stack, update alignment for arguments passed on stack when copying MEM's > memory attributes. > > gcc/ > > PR target/120839 > * emit-rtl.cc (set_mem_attrs): Update alignment for argument on > stack. > > gc

[PATCH] Add myself as an aarch64 port reviewer

2025-07-03 Thread Andrew Pinski
As mentioned in https://inbox.sourceware.org/gcc/ea828262-8f8f-4362-9ca8-312f7c20e...@nvidia.com/T/#m6e7e8e11656189598c759157d5d49cbd0ac9ba7c. Adding myself as an aarch64 port reviewer. ChangeLog: * MAINTAINERS: Add myself as an aarch64 port reviewer. Signed-off-by: Andrew Pinski ---

Re: [PATCH] libstdc++: Members missing in std::numeric_limits

2025-07-03 Thread Mateusz Zych
Hello! I've prepared a patch, which adds all members missing from std::numeric_limits<> specializations for integer-class types. Jonathan, please let me know whether you like these changes and do not see any bugs or issues with them. From my side, I just want to say that: - Since all std::num

Re: [PATCH] asf: Fix calling of emit_move_insn on registers of different modes [PR119884]

2025-07-03 Thread Konstantinos Eleftheriou
On Wed, May 7, 2025 at 11:29 AM Richard Sandiford wrote: > But I thought the code was allowing multiple stores to be forwarded to > a single (wider) load. E.g. 4 individual byte stores at address X, X+1, > X+2 and X+3 could be forwarded to a 4-byte load at address X. And the code > I mentioned i

Re: [PATCH] testsuite: Restore dg-do run on pr116906 and pr78185 tests

2025-07-03 Thread Christophe Lyon
ping^2 ? On Wed, 18 Jun 2025 at 12:11, Christophe Lyon wrote: > > ping? > > On Mon, 26 May 2025 at 17:26, Christophe Lyon > wrote: > > > > On Mon, 26 May 2025 at 17:14, Christophe Lyon > > wrote: > > > > > > Commit r15-7152-g57b706d141b87c removed > > > /* { dg-do run { target*-*-linux* *-*-gnu

Re: [PATCH] testsuite: Skip check-function-bodies sometimes

2025-07-03 Thread Jakub Jelinek
On Thu, Jul 03, 2025 at 02:55:37PM +0200, Stefan Schulze Frielinghaus wrote: > Ok for mainline? ChangeLog is missing. And I think I'd appreciate another pair of eyes, Rainer/Mike, what do you think about this? > If a check-function-bodies test is compiled using -fstack-protector*, > -fhardened, -

[PUSHED] OpenMP: Add omp_get_initial_device/omp_get_num_devices builtins: Fix test cases

2025-07-03 Thread Thomas Schwinge
With this fix-up for commit 387209938d2c476a67966c6ddbdbf817626f24a2 "OpenMP: Add omp_get_initial_device/omp_get_num_devices builtins", we progress: PASS: c-c++-common/gomp/omp_get_num_devices_initial_device.c (test for excess errors) PASS: c-c++-common/gomp/omp_get_num_devices_initial_

[PATCH] c-family: Tweak ptr +- (expr +- cst) FE optimization [PR120837]

2025-07-03 Thread Jakub Jelinek
Hi! The following testcase is miscompiled with -fsanitize=undefined but we introduce UB into the IL even without that flag. The optimization ptr +- (expr +- cst) when expr/cst have undefined overflow into (ptr +- cst) +- expr is sometimes simply not valid, without careful analysis on what ptr poi

Re: [PATCH] s390: More vec-perm-const cases.

2025-07-03 Thread Juergen Christ
> On 6/27/25 8:09 PM, Juergen Christ wrote: > > s390 missed constant vector permutation cases based on the vector pack > > instruction or changing the size of the vector elements during vector > > merge. This enables some more patterns that do not need to load a > > constant vector for permutation

Re: [PATCH] c++: -fno-delete-null-pointer-checks constexpr addr comparison [PR71962]

2025-07-03 Thread Patrick Palka
On Thu, 3 Jul 2025, Jason Merrill wrote: > On 7/2/25 7:58 PM, Patrick Palka wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK > > for trunk? > > > > -- >8 -- > > > > Here the flag -fno-delete-null-pointer-checks causes the trivial address > > comparison in > > > >

[PATCH v1 1/2] Add TARGET_ARG_EXTENDED_ON_STACK

2025-07-03 Thread Palmer Dabbelt
We currently handle arguments that are split between the stack and registers by storing the registers to the stack and then treating the argument as if it was entirely passed on the stack. Allow targets to override this behavior and instead treat the argument as if it was passed entirely in regist

[PATCH v1 0/2] Allow targets to avoid materializing split parameters via stack extension [PR/82106]

2025-07-03 Thread Palmer Dabbelt
This is really Jim's code, but it's been sitting around in Bugzilla for a while so I've picked it up. All I really did here is add a target hook and mangle some comments, but I think I understand enough about what's going on to try and get things moving forward. So I'm writing up a pretty big cov

[PATCH v1 2/2] RISC-V: Implement TARGET_ARG_EXTENDED_ON_STACK.

2025-07-03 Thread Palmer Dabbelt
When we split an argument between the stack and a registers we might end up with a misaligned access, so use this newly implemented hook to instead bias the codegen towards the registers rather than the stack. PR/82106 gcc/ChangeLog: * config/riscv/riscv.cc (struct riscv_arg_info

[COMMITTED 10/42] ada: Correct documentation of policy_identifiers for Assertion_Policy

2025-07-03 Thread Marc Poulhiès
From: Bob Duff Follow-on to gnat-945. Change Ignore to Disable; Ignore is defined by the language, Disable is the implementation-defined one. Also minor code cleanup. gcc/ada/ChangeLog: * doc/gnat_rm/implementation_defined_characteristics.rst: Change Ignore to Disable.

[COMMITTED 04/42] ada: Fix wrong conversion of controlled array with representation change

2025-07-03 Thread Marc Poulhiès
From: Eric Botcazou The problem is that a temporary is created for the conversion because of the representation change, and it is finalized without having been initialized. gcc/ada/ChangeLog: * exp_ch4.adb (Handle_Changed_Representation): Alphabetize local variables. Set the No

[COMMITTED 02/42] ada: Fix ALI elaboration flags for ghost compilation units (cont.)

2025-07-03 Thread Marc Poulhiès
From: Piotr Trojanek When GNAT was compiling a ghost unit, the ALI file wrongly suggested that this unit required elaboration counters, which caused linking errors to non-existing objects. gcc/ada/ChangeLog: * sem_ch10.adb (Analyze_Compilation_Unit): Ignored ghost unit need no e

[COMMITTED 07/42] ada: Fix SPARK context discovery from within subunits

2025-07-03 Thread Marc Poulhiès
From: Piotr Trojanek When navigating the AST to find the enclosing subprogram we must traverse from subunits to the corresponding stub. gcc/ada/ChangeLog: * lib-xref-spark_specific.adb (Enclosing_Subprogram_Or_Library_Package): Traverse subunits and body stubs. Tested o

[COMMITTED 21/42] ada: Refine subtypes in task-counting code

2025-07-03 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ChangeLog: * exp_ch3.adb (Count_Default_Sized_Task_Stacks): Refine subtypes of parameters; same for callsites. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch3.adb | 14 +++---

[COMMITTED 11/42] ada: Remove unnecessary "return;" statements

2025-07-03 Thread Marc Poulhiès
From: Bob Duff A "return;" at the end of a procedure is unnecessary and misleading. This patch removes them. gcc/ada/ChangeLog: * checks.adb: Remove unnecessary "return;" statements. * eval_fat.adb: Likewise. * exp_aggr.adb: Likewise. * exp_attr.adb: Likewise.

[COMMITTED 05/42] ada: Fix index bounds check in Super_Delete functions and procedures

2025-07-03 Thread Marc Poulhiès
From: Aleksandra Pasek gcc/ada/ChangeLog: * libgnat/a-strsup.adb (Super_Delete): Fix index check. * libgnat/a-stwisu.adb (Super_Delete): Likewise. * libgnat/a-stzsup.adb (Super_Delete): Likewise. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/a

[COMMITTED 12/42] ada: Fix assertion failure on finalizable aggregate

2025-07-03 Thread Marc Poulhiès
From: Ronan Desplanques The Finalizable aspect makes it possible that Insert_Actions_In_Scope_Around is entered with an empty list of after actions. This patch fixes a condition that was not quite right in this case. gcc/ada/ChangeLog: * exp_ch7.adb (Insert_Actions_In_Scope_Around): Fix

[COMMITTED 08/42] ada: Call Semantics when analyzing a renamed package

2025-07-03 Thread Marc Poulhiès
From: Viljar Indus Calling Semantics here will additionally update the reference to Current_Sem_Unit the renamed unit so that we will not receive bogus visibility errors when checking for self-referential with-s. gcc/ada/ChangeLog: * sem_ch10.adb(Analyze_With_Clause): Call Semantics ins

[COMMITTED 25/42] ada: Fix minor fallout of latest change

2025-07-03 Thread Marc Poulhiès
From: Eric Botcazou This adjusts the header of the renamed files and adds missing blank lines. gcc/ada/ChangeLog: * errid.ads: Adjust header to renaming and fix copyright line. * errid.adb: Adjust header to renaming and add blank line. * erroutc-pretty_emitter.ads: Adjus

[COMMITTED 09/42] ada: Remove Empty_Or_Error

2025-07-03 Thread Marc Poulhiès
From: Bob Duff Minor stylistic improvement: Remove Empty_Or_Error, and replace comparisons with Empty_Or_Error with "[not] in Empty | Error". (Found while working on VAST.) gcc/ada/ChangeLog: * types.ads (Empty_Or_Error): Remove. * atree.adb: Remove reference to Empty_Or_Error.

[COMMITTED 17/42] ada: Enforce visibility of unit used as a parent instance of a child instance

2025-07-03 Thread Marc Poulhiès
From: Gary Dismukes In cases involving instantiation of a generic child unit, the visibility of the parent unit was mishandled, allowing the parent to be referenced in another compilation unit that has visibility of the child instance but no with_clause for the parent of the instance. gcc/ada/Ch

[COMMITTED 16/42] ada: Fix comment

2025-07-03 Thread Marc Poulhiès
From: Ronan Desplanques This patch fixes a misnaming of Make_Predefined_Primitive_Specs in a comment. gcc/ada/ChangeLog: * exp_ch3.adb (Predefined_Primitive_Bodies): Fix comment. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch3.adb | 2 +- 1 file changed, 1 ins

[COMMITTED 22/42] ada: Fix crash with Finalizable in corner case

2025-07-03 Thread Marc Poulhiès
From: Ronan Desplanques The Finalizable aspect introduced controlled types for which not all the finalization primitives exist. This patch makes Make_Deep_Record_Body handle this case correctly. gcc/ada/ChangeLog: * exp_ch7.adb (Make_Deep_Record_Body): Fix case of absent Initialize

[COMMITTED 13/42] ada: Fix comment

2025-07-03 Thread Marc Poulhiès
From: Ronan Desplanques This patch fixes a comment that wrongly stated that no dispatch entry for deep finalize was created for limited tagged types. gcc/ada/ChangeLog: * exp_ch3.adb (Make_Predefined_Primitive_Specs): Fix comment. Tested on x86_64-pc-linux-gnu, committed on master. --

[COMMITTED 31/42] ada: Improve retrieval of nominal unconstrained type in extended return

2025-07-03 Thread Marc Poulhiès
From: Piotr Trojanek To reliably retrieve the nominal unconstrained type of object declared in extended return statement we need to rely on the Original_Node. gcc/ada/ChangeLog: * sem_ch3.adb (Check_Return_Subtype_Indication): Use Original_Node. Tested on x86_64-pc-linux-gnu, committed

[COMMITTED 19/42] ada: Fix crash with Finalizable in corner case

2025-07-03 Thread Marc Poulhiès
From: Ronan Desplanques Since the introduction of the Finalizable aspect, there can be types for which Is_Controlled returns True but that don't have all three finalization primitives. The Generate_Finalization_Actions raised an exception in that case before this patch, which fixes the problem.

[COMMITTED 14/42] ada: Fix spurious Constraint_Error raised by 'Value of fixed-point types

2025-07-03 Thread Marc Poulhiès
From: Eric Botcazou This happens for very large Smalls with regard to the size of the mantissa, because the prerequisites of the implementation used in this case are not met, although they are documented in the head comment of Integer_To_Fixed. This change documents them at the beginning of the

[COMMITTED 15/42] ada: Cleanup in type support subprograms code

2025-07-03 Thread Marc Poulhiès
From: Piotr Trojanek Code cleanup; semantics is unaffected. gcc/ada/ChangeLog: * exp_tss.adb (TSS): Refactor IF condition to make code smaller. * lib.adb (Increment_Serial_Number, Synchronize_Serial_Number): Use type of renamed object when creating renaming. * li

[COMMITTED 37/42] ada: Fix check for elaboration order on subprogram body stubs

2025-07-03 Thread Marc Poulhiès
From: Piotr Trojanek Fix an assertion failure occurring when elaboration checks were applied to subprogram with a separate body. gcc/ada/ChangeLog: * sem_elab.adb (Check_Overriding_Primitive): Find early call region of the subprogram body declaration, not of the subprogram body

[COMMITTED 18/42] ada: Fix typo in comment

2025-07-03 Thread Marc Poulhiès
From: Ronan Desplanques gcc/ada/ChangeLog: * exp_ch7.adb (Build_Record_Deep_Procs): Fix typo in comment. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_ch7.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch

[COMMITTED 35/42] ada: Refine sanity check in Insert_Actions

2025-07-03 Thread Marc Poulhiès
From: Ronan Desplanques Insert_Actions performs a sanity check when it goes through an expression with actions while going up the three. That check was not perfectly right before this patch and spuriously failed when inserting range checks in some situation. This patch makes the check more robust

[COMMITTED 20/42] ada: Remove a couple of redundant calls to Set_Etype

2025-07-03 Thread Marc Poulhiès
From: Eric Botcazou The OK_Convert_To function already sets the Etype of its result. gcc/ada/ChangeLog: * exp_imgv.adb (Expand_Value_Attribute): Do not call Set_Etype on N after rewriting it by means of OK_Convert_To. Tested on x86_64-pc-linux-gnu, committed on master. --- gc

[COMMITTED 41/42] ada: Enforce alignment constraint for large Object_Size clauses

2025-07-03 Thread Marc Poulhiès
From: Eric Botcazou The constraint is that the Object_Size must be a multiple of the alignment in bits. But it's enforced only when the value of the clause is lower than the Value_Size rounded up to the alignment in bits, not for larger values. gcc/ada/ChangeLog: * gcc-interface/decl.c

[COMMITTED 24/42] ada: Turn diagnostic object from variable to constant

2025-07-03 Thread Marc Poulhiès
From: Piotr Trojanek Diagnostic entries are not supposed to be modified while compiling the code. Code cleanup; behavior is unaffected. gcc/ada/ChangeLog: * errid.ads (Diagnostic_Entries): Now a constant. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/errid.ads | 2 +

[PATCH] x86: Emit label only for __mcount_loc section

2025-07-03 Thread H.J. Lu
commit ecc81e33123d7ac9c11742161e128858d844b99d (HEAD) Author: Andi Kleen Date: Fri Sep 26 04:06:40 2014 + Add direct support for Linux kernel __fentry__ patching emitted a label, 1, for __mcount_loc section: 1: call mcount .section __mcount_loc, "a",@progbits .quad 1b .previous If _

Re: [PATCH v8 0/9] AArch64: CMPBR support

2025-07-03 Thread Karl Meakin
On 02/07/2025 18:45, Karl Meakin wrote: This patch series adds support for the CMPBR extension. It includes the new `+cmpbr` option and rules to generate the new instructions when lowering conditional branches. Changelog: * v8: - Support far branches for the `CBB` and `CBH` instructions, an

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

2025-07-03 Thread Luc Grosheintz
Thank you for the nice review! I've locally implemented everything and I'll send a v3 later today or tomorrow; after squashing the commits correctly; and retesting everything. Meanwhile a couple of comments below. On 7/1/25 16:42, Tomasz Kaminski wrote: On Fri, Jun 27, 2025 at 11:37 AM Luc Gros

[PATCH v4 1/2] tree-simplify: unify simple_comparison ops in vec_cond for bit and/or/xor [PR119196]

2025-07-03 Thread Icen Zeyada
Merge simple_comparison patterns under a single vec_cond_expr for bit_and, bit_ior, and bit_xor in the simplify pass. Ensure that when both operands of a bit_and, bit_or, or bit_xor are simple_comparison results, they reside within the same vec_cond_expr rather than separate ones. This prepares t

[PATCH v4 0/2] tree-optimization: extend scalar comparison folding to vectors [PR119196]

2025-07-03 Thread Icen Zeyada
New in V4: Check whether the vector is of boolean type in specific comparisons. If it is, determine whether the operation can be expanded using the selected expression. If so, proceed with the optimization; otherwise, skip the optimization. --

[PATCH v4 2/2] gimple-fold: extend vector simplification to match scalar bitwise optimizations [PR119196]

2025-07-03 Thread Icen Zeyada
Generalize existing scalar gimple_fold rules to apply the same bitwise comparison simplifications to vector types. Previously, an expression like (x < y) && (x > y) would fold to `false` if x and y are scalars, but equivalent vector comparisons were left untouched. T

Re: [PATCH] Add string_slice class.

2025-07-03 Thread Richard Sandiford
Alfie Richards writes: > +/* string_slice inherits from array_slice, specifically to refer to a > substring > + of a character array. > + It includes some string like helpers. */ > +class string_slice : public array_slice > +{ > +public: > + string_slice () : array_slice () {} > + string_s

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,PR1

2025-07-03 Thread Qing Zhao
Another update on this: > On Jun 30, 2025, at 11:51, Qing Zhao wrote: >> >>> For each single predecessor block, locate the conditional statement >>> in the end of the block. determine whether the STMT is on the taken >>> path of the condition. Add these two information to each event of >>>

Re: [PATCH] libquadmath: add quad support for trig-pi functions

2025-07-03 Thread Steve Kargl
On Thu, Jul 03, 2025 at 02:43:43PM +0200, Michael Matz wrote: > Hello, > > On Thu, 3 Jul 2025, Yuao Ma wrote: > > > This patch adds the required function for Fortran trigonometric functions to > > work with glibc versions prior to 2.26. It's based on glibc source commit > > 632d895f3e5d98162f77b9

[PATCH] fortran: Add the preliminary code of MOVE_ALLOC arguments

2025-07-03 Thread Mikael Morin
From: Mikael Morin Regression-tested on aarch64-unknown-linux-gnu. OK for master? -- >8 -- Add the preliminary code produced for the evaluation of the FROM and TO arguments of the MOVE_ALLOC intrinsic before using their values. Before this change, the preliminary code was ignored and dropped, l

Re: [PATCH] fortran: Add the preliminary code of MOVE_ALLOC arguments

2025-07-03 Thread Steve Kargl
On Thu, Jul 03, 2025 at 10:12:52PM +0200, Mikael Morin wrote: > From: Mikael Morin > > Regression-tested on aarch64-unknown-linux-gnu. > OK for master? > Yes. Almost looks obvious once someone finds and fixes the issue. Thanks for the patch. -- Steve

[committed] c++: Fix a pasto in the PR120471 fix [PR120940]

2025-07-03 Thread Jakub Jelinek
Hi! No idea how this slipped in, I'm terribly sorry. Strangely nothing in the testsuite has caught this, so I've added a new test for that. Bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk and for 15.2, 14.4, 13.4 and 12.5. 2025-07-03 Jakub Jelinek PR c++/120

Re: [PATCH] middle-end: Fix complex lowering of cabs with no LHS [PR120369]

2025-07-03 Thread Andrew Pinski
On Tue, May 20, 2025 at 6:44 PM Andrew Pinski wrote: > > This was introduced by r15-1797-gd8fe4f05ef448e . I had missed that > the LHS of the cabs call could be NULL. This seems to only happen at -O0, > I tried to produce one that happens at -O1 but needed many different > options to prevent the r

Re: [PATCH] libquadmath: add quad support for trig-pi functions

2025-07-03 Thread Michael Matz
Hello, On Thu, 3 Jul 2025, Joseph Myers wrote: > > > Isn't the whole raison d'etre for the trig-pi functions that the internal > > > argument reduction against multiples of pi becomes trivial and hence (a) > > > performant, and (b) doesn't introduce rounding artifacts? Expressing the > > > tr

Re: [PATCH] libquadmath: add quad support for trig-pi functions

2025-07-03 Thread Joseph Myers
On Thu, 3 Jul 2025, Michael Matz wrote: > Yes. And then the above is multiplied by PI, passed to cos/sin and that > one then tries to figure out the multiple of PI (i.e. the 'x' above) again > via range reduction (not a _terribly_ slow one anymore in a good > implementation, because of the lim

Re: [PATCH] libquadmath: add quad support for trig-pi functions

2025-07-03 Thread Andreas Schwab
On Jul 03 2025, Michael Matz wrote: > Yes. And then the above is multiplied by PI, passed to cos/sin and that > one then tries to figure out the multiple of PI (i.e. the 'x' above) again > via range reduction (not a _terribly_ slow one anymore in a good > implementation, because of the limited

[Ada] Remove left-overs of front-end exception mechanism

2025-07-03 Thread Eric Botcazou
Tested on x86-64/Linux, applied on the mainline. 2025-07-03 Eric Botcazou * gcc-interface/Makefile.in (gnatlib-sjlj): Delete. (gnatlib-zcx): Do not modify Frontend_Exceptions constant. * libgnat/system-linux-loongarch.ads (Frontend_Exceptions): Delete. -- Eric Botcaz

Re: [PATCH] c-family: Tweak ptr +- (expr +- cst) FE optimization [PR120837]

2025-07-03 Thread Richard Biener
> Am 03.07.2025 um 16:11 schrieb Jakub Jelinek : > > Hi! > > The following testcase is miscompiled with -fsanitize=undefined but we > introduce UB into the IL even without that flag. > > The optimization ptr +- (expr +- cst) when expr/cst have undefined > overflow into (ptr +- cst) +- expr i

Re: [PATCH] c-family: Tweak ptr +- (expr +- cst) FE optimization [PR120837]

2025-07-03 Thread Jakub Jelinek
On Thu, Jul 03, 2025 at 08:12:22PM +0200, Richard Biener wrote: > > So, instead at least for now, the following patch keeps doing the > > optimization, just doesn't perform it in pointer arithmetics. > > pointer_int_sum itself actually adds the multiplication by size_exp, > > so ptr + expr is turne

Re: [PATCH] tree-optimization/120927 - 510.parest_r segfault with masked epilog

2025-07-03 Thread Richard Sandiford
Richard Biener writes: > The following fixes bad alignment computaton for epilog vectorization > when as in this case for 510.parest_r and masked epilog vectorization > with AVX512 we end up choosing AVX to vectorize the main loop and > masked AVX512 (sic!) to vectorize the epilog. In that case a

Re: [PATCH v4 1/6] c-family: add btf_type_tag and btf_decl_tag attributes

2025-07-03 Thread David Faust
On 7/2/25 00:42, Richard Biener wrote: > On Tue, Jun 10, 2025 at 11:40 PM David Faust wrote: >> >> Add two new c-family attributes, "btf_type_tag" and "btf_decl_tag" >> along with a simple shared handler for them. >> >> gcc/c-family/ >> * c-attribs.cc (c_common_attribute_table): Add btf

[to-be-committed][RISC-V] Add basic instrumentation to fusion detection

2025-07-03 Thread Jeff Law
This is primarily Shreya's work from a few months back. I just fixed the formatting, cobbled together the cover letter/ChangeLog. We were looking to evaluate some changes from Artemiy that improve GCC's ability to discover fusible instruction pairs. There was no good way to get any static d

Re: [PATCH] libquadmath: add quad support for trig-pi functions

2025-07-03 Thread Michael Matz
Hello, On Thu, 3 Jul 2025, Yuao Ma wrote: > This patch adds the required function for Fortran trigonometric functions to > work with glibc versions prior to 2.26. It's based on glibc source commit > 632d895f3e5d98162f77b9c3c1da4ec19968b671. > > I've built it successfully on my end. Documentation

Re: [PATCH] x86-64: Add RDI clobber to tls_local_dynamic_64 patterns

2025-07-03 Thread H.J. Lu
On Thu, Jul 3, 2025 at 2:39 PM Uros Bizjak wrote: > > On Thu, Jul 3, 2025 at 6:32 AM H.J. Lu wrote: > > > > *tls_local_dynamic_64_ uses RDI as the __tls_get_addr argument. > > Add RDI clobber to tls_local_dynamic_64 patterns to show it. > > > > PR target/120908 > > * config/i386/i386.cc (legitimi

Re: [PATCH v3] tree-optimization/120780: Support object size for containing objects

2025-07-03 Thread Jakub Jelinek
On Thu, Jul 03, 2025 at 08:33:45AM +0200, Richard Biener wrote: > On Wed, Jul 2, 2025 at 11:32 PM Siddhesh Poyarekar > wrote: > > > > MEM_REF cast of a subobject to its containing object has negative > > offsets, which objsz sees as an invalid access. Support this use case > > by peeking into th

[COMMITTED 01/42] ada: Use consistent truncation of 'Value for decimal fixed-point types

2025-07-03 Thread Marc Poulhiès
From: Eric Botcazou This uses truncation for all bases instead of for base 10 only. gcc/ada/ChangeLog: * libgnat/s-valued.adb (Integer_to_Decimal): Use truncation for the scaled divide operation performed for bases other than 10. Tested on x86_64-pc-linux-gnu, committed on mast

[COMMITTED 06/42] ada: Document restriction on array length

2025-07-03 Thread Marc Poulhiès
From: Tonu Naks gcc/ada/ChangeLog: * libgnat/i-cstrin.ads (Value): add documentation Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/libgnat/i-cstrin.ads | 11 +++ 1 file changed, 11 insertions(+) diff --git a/gcc/ada/libgnat/i-cstrin.ads b/gcc/ada/libgnat/i-c

Re: [PATCH] s390: More vec-perm-const cases.

2025-07-03 Thread Andreas Krebbel
On 6/27/25 8:09 PM, Juergen Christ wrote: s390 missed constant vector permutation cases based on the vector pack instruction or changing the size of the vector elements during vector merge. This enables some more patterns that do not need to load a constant vector for permutation. Bootstrapped

[COMMITTED] testsuite: Fix gcc.dg/ipa/pr120295.c on Solaris

2025-07-03 Thread Rainer Orth
gcc.dg/ipa/pr120295.c FAILs on Solaris: FAIL: gcc.dg/ipa/pr120295.c (test for excess errors) Excess errors: ld: warning: symbol 'glob' has differing types: (file /var/tmp//ccsDR59c.o type=OBJT; file /lib/libc.so type=FUNC); /var/tmp//ccsDR59c.o definition taken Fixed by renaming

[PATCH] testsuite: Skip check-function-bodies sometimes

2025-07-03 Thread Stefan Schulze Frielinghaus
From: Stefan Schulze Frielinghaus My understand is that during check_compile compiler_flags contains all the options passed to gcc and current_compiler_flags contains options passed via dg-options and dg-additional-options. I did a couple of experiments and printf-style debugging which endorsed

Re: [PATCH v3] tree-optimization/120780: Support object size for containing objects

2025-07-03 Thread Siddhesh Poyarekar
On 2025-07-03 03:13, Jakub Jelinek wrote: On Thu, Jul 03, 2025 at 08:33:45AM +0200, Richard Biener wrote: On Wed, Jul 2, 2025 at 11:32 PM Siddhesh Poyarekar wrote: MEM_REF cast of a subobject to its containing object has negative offsets, which objsz sees as an invalid access. Support this u

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

2025-07-03 Thread Luc Grosheintz
On 7/3/25 12:45, Jonathan Wakely wrote: On Thu, 3 Jul 2025 at 11:12, Tomasz Kaminski wrote: On Thu, Jul 3, 2025 at 12:08 PM Luc Grosheintz wrote: The reasoning for this approach was: 1. The mapping::operator() and mdspan::operator[] have the same precondition; and mdspan::operator[

Re: [PATCH v9 0/9] AArch64: CMPBR support

2025-07-03 Thread Richard Sandiford
Karl Meakin writes: > This patch series adds support for the CMPBR extension. It includes the > new `+cmpbr` option and rules to generate the new instructions when > lowering conditional branches. Thanks for the update, LGTM. I've pushed the series to trunk. Richard > Changelog: > * v9: > -

[COMMITTED 36/42] ada: More Tbuild cleanup

2025-07-03 Thread Marc Poulhiès
From: Bob Duff Remove "Nmake_Assert => ..." on N_Unchecked_Type_Conversion at gen_il-gen-gen_nodes.adb:473 (was disabled). This was left over from commit 82a794419a00ea98b68d69b64363ae6746710de9 "Tbuild cleanup". In addition, the checks for "Is_Composite_Type" in Tbuild.Unchecked_Convert_To are

[COMMITTED 27/42] ada: Fix strange holes for type with variant part reported by -gnatRh

2025-07-03 Thread Marc Poulhiès
From: Eric Botcazou The problem is that the sorting algorithm mixes components of variants. gcc/ada/ChangeLog: * repinfo.adb (First_Comp_Or_Discr.Is_Placed_Before): Return True only if the components are in the same component list. Tested on x86_64-pc-linux-gnu, committed on ma

[COMMITTED 42/42] ada: Fix poor code generated for return of Out parameter with access type

2025-07-03 Thread Marc Poulhiès
From: Eric Botcazou The record type of the return object is unnecessarily given BLKmode. gcc/ada/ChangeLog: * gcc-interface/decl.cc (type_contains_only_integral_data): Do not return false only because the type contains pointer data. Tested on x86_64-pc-linux-gnu, committed on m

[COMMITTED 29/42] ada: Adjust message about statically compatible result subtype

2025-07-03 Thread Marc Poulhiès
From: Piotr Trojanek Ada RM 6.5(5.3/5) is about "result SUBTYPE of the function", while the error message was saying "result TYPE of the function". Now use the exact RM wording in the error message for this rule. gcc/ada/ChangeLog: * sem_ch3.adb (Check_Return_Subtype_Indication): Adjust

[COMMITTED 38/42] ada: Fix missing error on too large Component_Size not multiple of storage unit

2025-07-03 Thread Marc Poulhiès
From: Eric Botcazou This is a small regression introduced a few years ago. gcc/ada/ChangeLog: * gcc-interface/decl.cc (gnat_to_gnu_component_type): Validate the Component_Size like the size of a type only if the component type is actually packed. Tested on x86_64-pc-lin

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

2025-07-03 Thread Marc Poulhiès
From: Eric Botcazou This implements the Is_Constr_Array_Subt_With_Bounds flag for allocators. gcc/ada/ChangeLog: * gcc-interface/trans.cc (gnat_to_gnu) : Allocate the bounds alongside the data if the Is_Constr_Array_Subt_With_Bounds flag is set on the designated type.

[PATCH] x86-64: Remove redundant TLS calls

2025-07-03 Thread H.J. Lu
For TLS calls: 1. UNSPEC_TLS_GD: (parallel [ (set (reg:DI 0 ax) (call:DI (mem:QI (symbol_ref:DI ("__tls_get_addr"))) (const_int 0 [0]))) (unspec:DI [(symbol_ref:DI ("e") [flags 0x50]) (reg/f:DI 7 sp)] UNSPEC_TLS_GD) (clobber (reg:DI 5 di))]

Re: [PATCH] x86: Emit label only for __mcount_loc section

2025-07-03 Thread H.J. Lu
On Thu, Jul 3, 2025 at 6:07 PM Uros Bizjak wrote: > > On Thu, Jul 3, 2025 at 11:54 AM H.J. Lu wrote: > > > > commit ecc81e33123d7ac9c11742161e128858d844b99d (HEAD) > > Author: Andi Kleen > > Date: Fri Sep 26 04:06:40 2014 + > > > > Add direct support for Linux kernel __fentry__ patchin

[PATCH v1 2/3] libstdc++: Prepare test code for default_accessor for reuse.

2025-07-03 Thread Luc Grosheintz
All test code of default_accessor can be reused. This commit moves the reuseable code into a file generic.cc and prepares the tests for reuse with aligned_accessor. The AllocatorTrait creates a unified interface for creating both default_accessor and aligned_accessor typenames. libstdc++-v3/Chang

[PATCH v1 0/3] Implement aligned_accessor [P2897R7].

2025-07-03 Thread Luc Grosheintz
This patch series implements the aligned_accessor paper P2897R7 in three parts: - Implement `is_sufficiently_aligned` which is part of . - Prepare the accessor tests for reuse. - Implement aligned_accessor. A couple of remarks: - The paper P2897R7 and spec N5008 don't specify that the al

[PATCH v1 1/3] libstdc++: Implement is_sufficiently_aligned.

2025-07-03 Thread Luc Grosheintz
This commit implements and tests the function is_sufficiently_aligned from P2897R7. libstdc++-v3/ChangeLog: * include/bits/align.h (is_sufficiently_aligned): New function. * include/bits/version.def (is_sufficiently_aligned): Add. * include/bits/version.h: Regenerate.

[PATCH v1 3/3] libstdc++: Implement aligned_accessor from mdspan.

2025-07-03 Thread Luc Grosheintz
This commit completes the implementation of P2897R7 by implementing and testing the template class aligned_accessor. libstdc++-v3/ChangeLog: * include/bits/version.def (aligned_accessor): Add. * include/bits/version.h: Regenerate. * include/std/mdspan (aligned_accessor): N

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

2025-07-03 Thread Jonathan Wakely
On Thu, 3 Jul 2025 at 11:12, Tomasz Kaminski wrote: > > > > On Thu, Jul 3, 2025 at 12:08 PM Luc Grosheintz > wrote: >> >> >> >> On 7/1/25 22:56, Jonathan Wakely wrote: >> > On Tue, 1 Jul 2025 at 11:32, Tomasz Kaminski wrote: >> >> >> >> Hi, >> >> More of the review will be later, but I have not

Enable ipa-cp cloning for cold wrappers of hot functions

2025-07-03 Thread Jan Hubicka
Hi, ipa-cp cloning disables itself for all functions not passing opt_for_fn (node->decl, optimize_size) which disables it for cold wrappers of hot functions where we want to propagate. Since we later want to time saved to be considered hot, we do not need to make this early test. The patch also f

Fix overlfow in ipa-cp heuristics

2025-07-03 Thread Jan Hubicka
Hi, ipa-cp converts sreal times to int, while point of sreal is to accomodate very large values that can happen for loops with large number of iteraitons and also when profile is inconsistent. This happens with afdo in testsuite where loop preheader is estimated to have 0 excutions while loop body

Re: [PATCH] x86: Emit label only for __mcount_loc section

2025-07-03 Thread Uros Bizjak
On Thu, Jul 3, 2025 at 11:54 AM H.J. Lu wrote: > > commit ecc81e33123d7ac9c11742161e128858d844b99d (HEAD) > Author: Andi Kleen > Date: Fri Sep 26 04:06:40 2014 + > > Add direct support for Linux kernel __fentry__ patching > > emitted a label, 1, for __mcount_loc section: > > 1: call mco

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

2025-07-03 Thread Luc Grosheintz
On 7/1/25 22:56, Jonathan Wakely wrote: On Tue, 1 Jul 2025 at 11:32, Tomasz Kaminski wrote: 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 s

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

2025-07-03 Thread Tomasz Kaminski
On Thu, Jul 3, 2025 at 12:08 PM Luc Grosheintz wrote: > > > On 7/1/25 22:56, Jonathan Wakely wrote: > > On Tue, 1 Jul 2025 at 11:32, Tomasz Kaminski > wrote: > >> > >> Hi, > >> More of the review will be later, but I have noticed that you have > added preconditions checks > >> to the layouts, an

[PATCH v1 1/1] libiberty: add common methods for type-sensitive doubly linked lists

2025-07-03 Thread Matthieu Longo
Those methods's implementation is relying on duck-typing at compile time. The structure corresponding to the node of a doubly linked list needs to define attributes 'prev' and 'next' which are pointers on the type of a node. The structure wrapping the nodes and others metadata (first, last, size) n

[PATCH v1 0/1] libiberty: add common methods for type-sensitive doubly linked lists

2025-07-03 Thread Matthieu Longo
This patch was originally part of [1]. Merging it in GCC is a prerequisite of merging it inside binutils. Those methods's implementation is relying on duck-typing at compile time. The structure corresponding to the node of a doubly linked list needs to define attributes 'prev' and 'next' which

[COMMITTED 40/42] ada: Fix alignment violation for mix of aligned and misaligned composite types

2025-07-03 Thread Marc Poulhiès
From: Eric Botcazou This happens when the chain of initialization procedures is called on the subcomponents and causes the creation of temporaries along the way out of alignment considerations. Now these temporaries are not necessary in the context and were not created until recently, so this ge

  1   2   >