Re: [PATCH] x86: Add preserve_none and update no_caller_saved_registers attributes

2025-05-22 Thread H.J. Lu
On Wed, May 14, 2025 at 2:12 PM Hongtao Liu wrote: > > On Fri, Apr 18, 2025 at 7:10 PM H.J. Lu wrote: > > > > Add preserve_none attribute which is similar to no_callee_saved_registers > > attribute, except on x86-64, r12, r13, r14, r15, rdi and rsi registers are > Could you split preserve_none in

[PATCH v1 3/3] RISC-V: Add test for vec_duplicate + vor.vv combine case 1 with GR2VR cost 0, 1 and 2

2025-05-22 Thread pan2 . li
From: Pan Li Add asm dump check test for vec_duplicate + vor.vv combine to vor.vx, with the GR2VR cost is 0, 1 and 2. The below test suites are passed for this patch. * The rv64gcv fully regression test. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/vx_vf/vx-4-i16.c: Add asm

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

2025-05-22 Thread pan2 . li
From: Pan Li This patch would like to combine the vec_duplicate + vor.vv to the vor.vx. From example as below code. The related pattern will depend on the cost of vec_duplicate from GR2VR. Then the late-combine will take action if the cost of GR2VR is zero, and reject the combination if the GR

[PATCH v1 2/3] RISC-V: Add test for vec_duplicate + vor.vv combine case 0 with GR2VR cost 0, 2 and 15

2025-05-22 Thread pan2 . li
From: Pan Li Add asm dump check test for vec_duplicate + vor.vv combine to vor.vx, with the GR2VR cost is 0, 2 and 15. The below test suites are passed for this patch. * The rv64gcv fully regression test. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/autovec/vx_vf/vx-1-i16.c: Add tes

[PATCH v1 0/3] RISC-V: Combine vec_duplicate + vor.vv to vor.vx on GR2VR cost

2025-05-22 Thread pan2 . li
From: Pan Li This patch would like to introduce the combine of vec_dup + vor.vv into vor.vx on the cost value of GR2VR. The late-combine will take place if the cost of GR2VR is zero, or reject the combine if non-zero like 1, 15 in test. There will be two cases for the combine: Case 0: | ...

[PATCH v2] x86: Add preserve_none and update no_caller_saved_registers attributes

2025-05-22 Thread H.J. Lu
Add preserve_none attribute which is similar to no_callee_saved_registers attribute, except on x86-64, r12, r13, r14, r15, rdi and rsi registers are used for integer parameter passing. This can be used in an interpreter to avoid saving/restoring the registers in functions which processing byte cod

[PATCH][GCC16][GCC15] aarch64: Add support for FUJITSU-MONAKA (-mcpu=fujitsu-monaka) CPU

2025-05-22 Thread Yuta Mukai (Fujitsu)
Hello, We would like to enable features for FUJITSU-MONAKA that were implemented in GCC after we added support for FUJITSU-MONAKA. As the features were implemented in GCC15, we also want to backport it to GCC15. Thanks to Andre Vieira for notifying us. Bootstrapped/regtested on aarch64-unknown-

[PATCH] [MAINTAINERS] Add myself to write after approval and DCO.

2025-05-22 Thread dhruvc
From: Dhruv Chawla Committed as 3213828f74f2f27a2dd91792cef27117ba1a522e. ChangeLog: * MAINTAINERS: Add myself to write after approval and DCO. --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 8993d176c22..f40d6350462 100644 --- a/MA

Re: RISC-V TLS Descriptors in GCC

2025-05-22 Thread Xi Ruoyao
On Thu, 2025-05-22 at 23:55 +0800, Dongsheng Song wrote: > Hi Kito, > > You mentioned that GCC 14 added TLSDESC support for RISC-V and that it > requires glibc 2.40 [1]. > However, when I looked for relevant information, I found that > LoongArch and RISC-V both published TLSDESC patches for revie

Re: [PATCH 0/3] Redirect to specific target based on TARGET_VERSION_COMPATIBLE

2025-05-22 Thread Yangyu Chen
> On 23 May 2025, at 04:02, Jeff Law wrote: > > > On 5/22/25 9:05 AM, Alfie Richards wrote: >> Hi Jeff, >> I sent this patch with my implementation a while ago: >> https://gcc.gnu.org/pipermail/gcc-patches/2025-April/681043.html >> There hasn't been any feedback on that patch yet. >> These pa

Re: [PATCH 3/6] RISC-V: frm/mode-switch: remove dubious frm edge insertion before call_insn

2025-05-22 Thread Jeff Law
On 5/22/25 6:12 AM, Robin Dapp wrote: AFAICT the main difference to standard mode switching is that we (ab)use it to set the rounding mode to the value it had initially, either at function entry or after a call.  That's different to regular mode switching which assumes "static" rounding mode

Re: [PATCH RFC] diagnostics: use -Wformat-diag more consistently

2025-05-22 Thread David Malcolm
On Thu, 2025-05-22 at 17:01 -0400, Jason Merrill wrote: > Tested x86_64-pc-linux-gnu, any objection? LGTM Thanks Dave > > -- 8< -- > > r10-1211 added various -Wformat-diag warnings about quoting in GCC > diagnostic strings, but didn't change these two quoting warnings to > use that > flag as w

[committed] c: Document C23 implementation-defined behavior

2025-05-22 Thread Joseph Myers
Add references to C23 subclauses to the documentation of implementation-defined behavior, and new entries for implementation-defined behavior new in C23; change some references in the text to e.g. "C99 and C11" to encompass C23 as well. Tested with "make info html pdf". * doc/implement-c.

[PATCH RFC] diagnostics: use -Wformat-diag more consistently

2025-05-22 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, any objection? -- 8< -- r10-1211 added various -Wformat-diag warnings about quoting in GCC diagnostic strings, but didn't change these two quoting warnings to use that flag as well. gcc/c-family/ChangeLog: * c-format.cc (flag_chars_t::validate): Control quoti

Re: [PATCH v3 8/9] libstdc++: Implement layout_stride from mdspan.

2025-05-22 Thread Luc Grosheintz
On 5/22/25 14:37, Tomasz Kaminski wrote: On Wed, May 21, 2025 at 12:04 PM Luc Grosheintz wrote: Implements the remaining parts of layout_left and layout_right; and all of layout_stride. libstdc++-v3/ChangeLog: * include/std/mdspan(layout_stride): New class. Signed-off-by: Luc Gr

[testsuite] Remove obsolete ada/acats/overflow.lst file

2025-05-22 Thread Eric Botcazou
It is used to specify which files are compiled with -gnato, but the switch has been the default for at least a decade. Tested on x86-64/Linux, applied on the mainline. 2025-05-22 Eric Botcazou * ada/acats/overflow.lst: Delete. * ada/acats/run_all.sh: Do not process overflow.

[pushed] c++: constexpr always_inline [PR120935]

2025-05-22 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- In cp_fold we do speculative constant evaluation of constexpr calls when inlining is enabled. Let's also do it for always_inline functions. PR c++/120935 gcc/cp/ChangeLog: * cp-gimplify.cc (cp_fold): Check always_inline.

Re: [PATCH 0/3] Redirect to specific target based on TARGET_VERSION_COMPATIBLE

2025-05-22 Thread Jeff Law
On 5/22/25 9:05 AM, Alfie Richards wrote: Hi Jeff, I sent this patch with my implementation a while ago: https://gcc.gnu.org/pipermail/gcc-patches/2025-April/681043.html There hasn't been any feedback on that patch yet. These patches are still useful and I would like to go ahead with them.

Re: [PATCH v4] libstdc++: Implement C++26 features (P2546R5)

2025-05-22 Thread Jonathan Wakely
On Mon, 5 May 2025 at 10:16, Uros Bizjak wrote: > > On Thu, May 1, 2025 at 12:59 PM Jonathan Wakely wrote: > > > > This includes the P2810R4 (is_debugger_present is_replaceable) changes, > > allowing std::is_debugger_present to be replaced by the program. > > > > It would be good to provide a mac

[FYI] [vxworks] build partial libatomic

2025-05-22 Thread Alexandre Oliva
Since vxworks' libc contains much of libatomic, in not-very-granular modules, building all of libatomic doesn't work very well. However, some expected entry points are not present in libc, so arrange for libatomic to build only those missing bits. I'm putting this in as "build machinery"; pleas

Re: [PATCH v3 8/9] libstdc++: Implement layout_stride from mdspan.

2025-05-22 Thread Tomasz Kaminski
On Thu, May 22, 2025 at 2:37 PM Tomasz Kaminski wrote: > > > On Wed, May 21, 2025 at 12:04 PM Luc Grosheintz > wrote: > >> Implements the remaining parts of layout_left and layout_right; and all >> of layout_stride. >> >> libstdc++-v3/ChangeLog: >> >> * include/std/mdspan(layout_stride):

Re: [PATCH][RFC] Allow the target to request a masked vector epilogue

2025-05-22 Thread Richard Sandiford
Richard Biener writes: > On Mon, 19 May 2025, Richard Sandiford wrote: > >> Richard Biener writes: >>> On Fri, 16 May 2025, Richard Sandiford wrote: > The simple prototype below uses a separate flag from the epilogue > mode, but I wonder how we want to more generally want to handle >

Re: [PATCH 2/2] libstdc++: Implement LWG 2439 for std::unique_copy [PR120386]

2025-05-22 Thread Jonathan Wakely
On Thu, 22 May 2025 at 16:48, Jonathan Wakely wrote: > > On Thu, 22 May 2025 at 16:44, Jonathan Wakely wrote: > > > > On Thu, 22 May 2025 at 16:25, Tomasz Kaminski wrote: > > > > > > > > > > > > On Thu, May 22, 2025 at 5:15 PM Tomasz Kaminski > > > wrote: > > >> > > >> > > >> > > >> On Thu, Ma

RISC-V TLS Descriptors in GCC

2025-05-22 Thread Dongsheng Song
Hi Kito, You mentioned that GCC 14 added TLSDESC support for RISC-V and that it requires glibc 2.40 [1]. However, when I looked for relevant information, I found that LoongArch and RISC-V both published TLSDESC patches for review at the last year [2], but only the LoongArch patch was merged into

Re: [PATCH 2/2] libstdc++: Implement LWG 2439 for std::unique_copy [PR120386]

2025-05-22 Thread Jonathan Wakely
On Thu, 22 May 2025 at 16:44, Jonathan Wakely wrote: > > On Thu, 22 May 2025 at 16:25, Tomasz Kaminski wrote: > > > > > > > > On Thu, May 22, 2025 at 5:15 PM Tomasz Kaminski wrote: > >> > >> > >> > >> On Thu, May 22, 2025 at 5:04 PM Jonathan Wakely wrote: > >>> > >>> On Thu, 22 May 2025 at 15:5

Re: [PATCH 2/2] libstdc++: Implement LWG 2439 for std::unique_copy [PR120386]

2025-05-22 Thread Jonathan Wakely
On Thu, 22 May 2025 at 16:25, Tomasz Kaminski wrote: > > > > On Thu, May 22, 2025 at 5:15 PM Tomasz Kaminski wrote: >> >> >> >> On Thu, May 22, 2025 at 5:04 PM Jonathan Wakely wrote: >>> >>> On Thu, 22 May 2025 at 15:50, Tomasz Kaminski wrote: >>> > >>> > >>> > >>> > On Thu, May 22, 2025 at 1:4

Re: [PATCH 2/2] libstdc++: Implement LWG 2439 for std::unique_copy [PR120386]

2025-05-22 Thread Tomasz Kaminski
On Thu, May 22, 2025 at 1:42 PM Jonathan Wakely wrote: > The current overload set for __unique_copy handles three cases: > > - The input range uses forward iterators, the output range does not. > This is the simplest case, and can just compare adjacent elements of > the input range. > > - Nei

Re: [PATCH 2/2] libstdc++: Implement LWG 2439 for std::unique_copy [PR120386]

2025-05-22 Thread Tomasz Kaminski
On Thu, May 22, 2025 at 5:15 PM Tomasz Kaminski wrote: > > > On Thu, May 22, 2025 at 5:04 PM Jonathan Wakely > wrote: > >> On Thu, 22 May 2025 at 15:50, Tomasz Kaminski >> wrote: >> > >> > >> > >> > On Thu, May 22, 2025 at 1:42 PM Jonathan Wakely >> wrote: >> >> >> >> The current overload set

Re: [PATCH 2/2] libstdc++: Implement LWG 2439 for std::unique_copy [PR120386]

2025-05-22 Thread Tomasz Kaminski
On Thu, May 22, 2025 at 5:04 PM Jonathan Wakely wrote: > On Thu, 22 May 2025 at 15:50, Tomasz Kaminski wrote: > > > > > > > > On Thu, May 22, 2025 at 1:42 PM Jonathan Wakely > wrote: > >> > >> The current overload set for __unique_copy handles three cases: > >> > >> - The input range uses forwa

Re: [PATCH 0/3] Redirect to specific target based on TARGET_VERSION_COMPATIBLE

2025-05-22 Thread Alfie Richards
Hi Jeff, I sent this patch with my implementation a while ago: https://gcc.gnu.org/pipermail/gcc-patches/2025-April/681043.html There hasn't been any feedback on that patch yet. These patches are still useful and I would like to go ahead with them. I am in favour of using my implementation as

Re: [PATCH 2/2] libstdc++: Implement LWG 2439 for std::unique_copy [PR120386]

2025-05-22 Thread Jonathan Wakely
On Thu, 22 May 2025 at 15:50, Tomasz Kaminski wrote: > > > > On Thu, May 22, 2025 at 1:42 PM Jonathan Wakely wrote: >> >> The current overload set for __unique_copy handles three cases: >> >> - The input range uses forward iterators, the output range does not. >> This is the simplest case, and

Re: [PATCH][RISC-V][PR target/70557] Improve storing 0 to memory on rv32

2025-05-22 Thread Jeff Law
On 5/21/25 11:41 PM, Shreya Munnangi wrote: Patch is originally from Siarhei Volkau >. RISC-V has a zero register (x0) which we can use to store zero into memory without loading the constant into a distinct register. Adjust the constraints of the 32-bit movdi_32bit

Re: [PATCH v4 2/2] aarch64: Fold lsl+lsr+orr to rev for half-width shifts

2025-05-22 Thread Dhruv Chawla
On 22/05/25 16:06, Richard Sandiford wrote: External email: Use caution opening links or attachments writes: [...] +;; The RTL combiners are able to combine "ior (ashift, ashiftrt)" to a "bswap". +;; Match that as well. +(define_insn_and_split "*v_revvnx8hi" + [(parallel +[(set (match_op

Re: [PATCH] RISC-V: Add minimal support of double trap extension 1.0

2025-05-22 Thread Jeff Law
On 5/22/25 12:21 AM, Jerry Zhang Jian wrote: Add support of double trap extension [1], enabling GCC to recognize the following extensions at compile time. New extensions: - ssdbltrp - smdbltrp [1] https://github.com/riscv/riscv-double-trap/releases/download/v1.0/riscv-double-trap.

Re: [PATCH 1/2] libstdc++: Fix concept checks for std::unique_copy [PR120384]

2025-05-22 Thread Tomasz Kaminski
On Thu, May 22, 2025 at 1:42 PM Jonathan Wakely wrote: > This looks to have been wrong since r0-125454-gea89b2482f97aa which > introduced the predefined_ops.h. Since that change, the binary predicate > passed to std::__unique_copy is _Iter_comp_iter, which takes arguments > of the iterator type,

Re: [PATCH v3 0/9] Implement layouts from mdspan.

2025-05-22 Thread Tomasz Kaminski
Thanks for working on the patches, they look solid, comments. Could you prepare a separate patch to fix initialization default-initialization of extents, that you have noticed, standard requires them to be value-initialized, and add corresponding test? Similarly, we have test for default construc

Re: [PATCH v3 9/9] libstdc++: Add tests for layout_stride.

2025-05-22 Thread Tomasz Kaminski
On Wed, May 21, 2025 at 11:56 AM Luc Grosheintz wrote: > Implements the tests for layout_stride and for the features of the other > two layouts that depend on layout_stride. > > libstdc++-v3/ChangeLog: > > * testsuite/23_containers/mdspan/layouts/class_mandate_neg.cc: Add > tests

Re: [PATCH] c++: Take downgraded errors into account in seen_error [PR118388]

2025-05-22 Thread Simon Martin
Hi, On Fri May 9, 2025 at 5:37 PM CEST, Simon Martin wrote: > Several gcc_assert through the C++ front-end involve seen_error (), that > does not take into account errors that were turned into warnings due to > -fpermissive or -Wtemplate-body. > > Running the full C++ testsuite when forcing the us

Re: [PATCH v2] [aarch64] [vxworks] mark x18 as fixed, adjust tests

2025-05-22 Thread Olivier Hainque
Thanks Alex & Richard! On Thu, 22 May 2025 at 12:41, Richard Sandiford wrote: > Alexandre Oliva writes: > > On May 21, 2025, Richard Sandiford wrote: > > > >> I think this one shows a deeper issue, though. > -fsanitize=shadow-call-stack > >> is currently hardcoded to use x18: > > > > Oh, indee

[PATCH v2] libstdc++: Implement C++26 std::indirect [PR119152]

2025-05-22 Thread Tomasz Kamiński
From: Jonathan Wakely This papers implements C++26 std::indirect as specified in P3019 with amendment to move assignment from LWG 4251. PR libstdc++/119152 libstdc++-v3/ChangeLog: * include/Makefile.am: Add new header. * include/Makefile.in: Regenerate. * includ

Re: [AUTOFDO] Enable ipa-split for auto-profile

2025-05-22 Thread Jan Hubicka
> > On 9 May 2025, at 11:55 am, Kugan Vivekanandarajah > > wrote: > > > > ipa-split is not now run for auto-profile. IMO this was an oversight. > > This patch enables it similar to PGO runs. > > > > gcc/ChangeLog: > > > >* ipa-split.cc pass_feedback_split_functions::clone (): New. > >

Re: [PATCH v3 8/9] libstdc++: Implement layout_stride from mdspan.

2025-05-22 Thread Tomasz Kaminski
On Thu, May 22, 2025 at 2:37 PM Tomasz Kaminski wrote: > > > On Wed, May 21, 2025 at 12:04 PM Luc Grosheintz > wrote: > >> Implements the remaining parts of layout_left and layout_right; and all >> of layout_stride. >> >> libstdc++-v3/ChangeLog: >> >> * include/std/mdspan(layout_stride):

Re: [PATCH v3 4/9] libstdc++: Implement layout_left from mdspan.

2025-05-22 Thread Tomasz Kaminski
On Wed, May 21, 2025 at 11:53 AM Luc Grosheintz wrote: > Implements the parts of layout_left that don't depend on any of the > other layouts. > > libstdc++-v3/ChangeLog: > > * include/std/mdspan (layout_left): New class. > > Signed-off-by: Luc Grosheintz > --- > libstdc++-v3/include/std

Re: [PATCH] libgcc: PR target/116363 Fix SFtype to UDWtype conversion

2025-05-22 Thread Jeff Law
On 5/22/25 1:01 AM, Jan Dubiec wrote: On 23.02.2025 04:59, Jeff Law wrote: [...] Thanks!  Just a note we're in stage4 of our development cycle (regression bugfixes) as we prepare for gcc-15.  This doesn't look like something we would typically make an exception for, it'll have to wait for t

Re: [PATCH v3 8/9] libstdc++: Implement layout_stride from mdspan.

2025-05-22 Thread Tomasz Kaminski
On Wed, May 21, 2025 at 12:04 PM Luc Grosheintz wrote: > Implements the remaining parts of layout_left and layout_right; and all > of layout_stride. > > libstdc++-v3/ChangeLog: > > * include/std/mdspan(layout_stride): New class. > > Signed-off-by: Luc Grosheintz > --- > libstdc++-v3/inc

Re: [PATCH v3 4/9] libstdc++: Implement layout_left from mdspan.

2025-05-22 Thread Tomasz Kaminski
On Wed, May 21, 2025 at 11:53 AM Luc Grosheintz wrote: > Implements the parts of layout_left that don't depend on any of the > other layouts. > > libstdc++-v3/ChangeLog: > > * include/std/mdspan (layout_left): New class. > > Signed-off-by: Luc Grosheintz > --- > libstdc++-v3/include/std

Re: [PATCH v3 4/9] libstdc++: Implement layout_left from mdspan.

2025-05-22 Thread Tomasz Kaminski
On Thu, May 22, 2025 at 1:29 PM Luc Grosheintz wrote: > I think part of this didn't get incorporated because I was too hasty > sending v3. The other I just didn't deem useful (I inline the function > for v4). > > There's a default initialization bug I need to fix: _M_exts and > _M_strides must be

Re: [PATCH 2/2] libstdc++: Implement C++26 std::indirect [PR119152]

2025-05-22 Thread Jonathan Wakely
On Thu, 22 May 2025 at 13:23, Daniel Krügler wrote: > > Am Do., 22. Mai 2025 um 11:48 Uhr schrieb Tomasz Kamiński > : >> >> From: Jonathan Wakely >> >> This papers implements C++27 std::indirect as specified >> in P3019 with ammendment to move assgiment from LWG 4251. >> >> PR libstdc++/

Re: [PATCH 2/2] libstdc++: Implement C++26 std::indirect [PR119152]

2025-05-22 Thread Daniel Krügler
Am Do., 22. Mai 2025 um 11:48 Uhr schrieb Tomasz Kamiński < tkami...@redhat.com>: > From: Jonathan Wakely > > This papers implements C++27 std::indirect as specified > in P3019 with ammendment to move assgiment from LWG 4251. > > PR libstdc++/119152 > > libstdc++-v3/ChangeLog: > >

[PATCH] c++/modules: Fix merge of TLS import functions [PR120363]

2025-05-22 Thread Nathaniel Shead
Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk/15? (Also is renaming the old test OK/appropriate? Or should I keep it before and just name the new tests as tls1/2, with a comment referring to pr113292?) -- >8 -- The PR notes that we missed setting DECL_CONTEXT on the TLS init fu

Re: [PATCH v3 0/9] Implement layouts from mdspan.

2025-05-22 Thread Tomasz Kaminski
On Wed, May 21, 2025 at 4:21 PM Luc Grosheintz wrote: > It's missing the "registration" of the three new classes in > std.cc.in. > Please remember to add it in next revisions. > > On 5/21/25 11:40, Luc Grosheintz wrote: > > Follows up on: > > https://gcc.gnu.org/pipermail/libstdc++/2025-May/0615

Re: [PATCH v3 7/9] libstdc++: Add tests for layout_right.

2025-05-22 Thread Tomasz Kaminski
On Wed, May 21, 2025 at 11:52 AM Luc Grosheintz wrote: > Adds tests for layout_right and for the parts of layout_left that depend > on layout_right. > > libstdc++-v3/ChangeLog: > > * testsuite/23_containers/mdspan/layouts/class_mandate_neg.cc: Add > tests for layout_stride. >

Re: [PATCH 3/6] RISC-V: frm/mode-switch: remove dubious frm edge insertion before call_insn

2025-05-22 Thread Robin Dapp
AFAICT the main difference to standard mode switching is that we (ab)use it to set the rounding mode to the value it had initially, either at function entry or after a call.  That's different to regular mode switching which assumes "static" rounding modes for different instructions. Standard c

Re: [PATCH v3 6/9] libstdc++: Implement layout_right from mdspan.

2025-05-22 Thread Tomasz Kaminski
On Wed, May 21, 2025 at 11:53 AM Luc Grosheintz wrote: > Implement the parts of layout_left that depend on layout_right; and the > parts of layout_right that don't depend on layout_stride. > > libstdc++-v3/ChangeLog: > > * include/std/mdspan (layout_right): New class. > > Signed-off-by: L

Re: [PATCH v3 4/9] libstdc++: Implement layout_left from mdspan.

2025-05-22 Thread Tomasz Kaminski
I am still reviewing. Should be able to get throu all of them today. On Thu, May 22, 2025 at 1:29 PM Luc Grosheintz wrote: > I think part of this didn't get incorporated because I was too hasty > sending v3. The other I just didn't deem useful (I inline the function > for v4). > > There's a defa

[no subject]

2025-05-22 Thread Tomasz Kamiński
This patch series implements C++26 std::indirect, the majority of the implementation was provied by Jonathan Wakely, with tests and minor fixes added by me, that can be found here: https://forge.sourceware.org/tkaminsk/gcc/commit/d461c4826c61138f69bb533defbc22c6f6305e1a

Re: [PATCH 2/2] aarch64: Improve rtx_cost for constants in COMPARE [PR120372]

2025-05-22 Thread Richard Sandiford
Andrew Pinski writes: > The middle-end uses rtx_cost on constants with the outer of being COMPARE > to find out the cost of a constant formation for a comparison instruction. > So for aarch64 backend, we would just return the cost of constant formation > in general. We can improve this by seeing i

[PATCH 2/2] libstdc++: Implement LWG 2439 for std::unique_copy [PR120386]

2025-05-22 Thread Jonathan Wakely
The current overload set for __unique_copy handles three cases: - The input range uses forward iterators, the output range does not. This is the simplest case, and can just compare adjacent elements of the input range. - Neither the input range nor output range use forward iterators. This r

[PATCH 1/2] libstdc++: Fix concept checks for std::unique_copy [PR120384]

2025-05-22 Thread Jonathan Wakely
This looks to have been wrong since r0-125454-gea89b2482f97aa which introduced the predefined_ops.h. Since that change, the binary predicate passed to std::__unique_copy is _Iter_comp_iter, which takes arguments of the iterator type, not the iterator's value type. This removes the checks from the

Re: [PATCH 2/2] libstdc++: Implement C++26 std::indirect [PR119152]

2025-05-22 Thread Tomasz Kaminski
On Thu, May 22, 2025 at 11:59 AM Jakub Jelinek wrote: > On Thu, May 22, 2025 at 11:19:25AM +0200, Tomasz Kamiński wrote: > > From: Jonathan Wakely > > > > This papers implements C++27 std::indirect as specified > > s/27/26/ > > > in P3019 with ammendment to move assgiment from LWG 4251. > > s/as

Re: [PATCH v3 4/9] libstdc++: Implement layout_left from mdspan.

2025-05-22 Thread Luc Grosheintz
I think part of this didn't get incorporated because I was too hasty sending v3. The other I just didn't deem useful (I inline the function for v4). There's a default initialization bug I need to fix: _M_exts and _M_strides must be value initialized. Then also the registration in std.cc.in & I'l

Re: [PATCH 2/2] libstdc++: Implement C++26 std::indirect [PR119152]

2025-05-22 Thread Jonathan Wakely
On 22/05/25 11:19 +0200, Tomasz Kamiński wrote: From: Jonathan Wakely This papers implements C++27 std::indirect as specified in P3019 with ammendment to move assgiment from LWG 4251. PR libstdc++/119152 libstdc++-v3/ChangeLog: * include/Makefile.am: Add new header. *

Re: [PATCH] RISC-V: Add pattern for vector-scalar multiply-add/sub [PR119100]

2025-05-22 Thread Robin Dapp
Hi Paul-Antoine, Please find attached a revised version of the patch. Compared to the previous iteration, I have: * Rebased on top of Pan's work; * Updated the cost model; * Added a second pattern to handle the case where PLUS_MINUS operands are swapped; * Added compile and run tests. I boot

[committed] libstdc++: Fix PSTL test iterators

2025-05-22 Thread Jonathan Wakely
These were fixed upstream by: https://github.com/uxlfoundation/oneDPL/pull/534 https://github.com/uxlfoundation/oneDPL/pull/546 libstdc++-v3/ChangeLog: * testsuite/util/pstl/test_utils.h (ForwardIterator::operator++): Fix return type. (BidirectionalIterator::operator++): L

Re: [PATCH 1/2] libstdc++: Define _Scoped_allocation RAII helper

2025-05-22 Thread Jonathan Wakely
On Thu, 22 May 2025 at 10:38, Tomasz Kamiński wrote: > > From: Jonathan Wakely > > libstdc++-v3/ChangeLog: > > * include/bits/allocated_ptr.h (_Scoped_allocation): New class > template. > > Co-Authored-By: Tomasz Kamiński > Signed-off-by: Tomasz Kamiński > --- > Tested on x86_64

Re: [AUTOFDO][AARCH64] Add support for profilebootstrap

2025-05-22 Thread Richard Sandiford
Kugan Vivekanandarajah writes: > Add support for autoprofiledbootstrap in aarch64. > This is similar to what is done for i386. Added > gcc/config/aarch64/gcc-auto-profile for aarch64 profile > creation. > > How to run: > configure --with-build-config=bootstrap-lto > make autoprofiledbootstrap > >

Re: [PATCH 2/2] aarch64: Fold lsl+lsr+orr to rev for half-width shifts

2025-05-22 Thread Richard Sandiford
Dhruv Chawla writes: > On 20/05/25 16:35, Richard Sandiford wrote: >> Dhruv Chawla writes: >>> [...] >>> Would it be a good idea to add tests for the bad codegen as well? I have >>> added tests for lsl/usra in the next round of patches. >> >> Nah, I don't think it's worth testing for something

Re: [PATCH v3 4/9] libstdc++: Implement layout_left from mdspan.

2025-05-22 Thread Tomasz Kaminski
On Wed, May 21, 2025 at 11:53 AM Luc Grosheintz wrote: > Implements the parts of layout_left that don't depend on any of the > other layouts. > > libstdc++-v3/ChangeLog: > > * include/std/mdspan (layout_left): New class. > > Signed-off-by: Luc Grosheintz > --- > libstdc++-v3/include/std

Re: [PATCH v3 5/9] libstdc++: Add tests for layout_left.

2025-05-22 Thread Tomasz Kaminski
On Wed, May 21, 2025 at 12:00 PM Luc Grosheintz wrote: > Implements a suite of tests for the currently implemented parts of > layout_left. The individual tests are templated over the layout type, to > allow reuse as more layouts are added. > > libstdc++-v3/ChangeLog: > > * testsuite/23_co

Re: [PATCH v2] [aarch64] [vxworks] mark x18 as fixed, adjust tests

2025-05-22 Thread Richard Sandiford
Alexandre Oliva writes: > On May 21, 2025, Richard Sandiford wrote: > >> I think this one shows a deeper issue, though. -fsanitize=shadow-call-stack >> is currently hardcoded to use x18: > > Oh, indeed! > >> and I assume this usage will be incompatible with the TCB usage. > >> So I think instead

Re: [PATCH 1/2] libstdc++: Define _Scoped_allocation RAII helper

2025-05-22 Thread Daniel Krügler
Am Do., 22. Mai 2025 um 11:41 Uhr schrieb Tomasz Kamiński < tkami...@redhat.com>: > From: Jonathan Wakely > > libstdc++-v3/ChangeLog: > > * include/bits/allocated_ptr.h (_Scoped_allocation): New class > template. > > Co-Authored-By: Tomasz Kamiński > Signed-off-by: Tomasz Kamińsk

Re: [PATCH v4 2/2] aarch64: Fold lsl+lsr+orr to rev for half-width shifts

2025-05-22 Thread Richard Sandiford
writes: > [...] > +;; The RTL combiners are able to combine "ior (ashift, ashiftrt)" to a > "bswap". > +;; Match that as well. > +(define_insn_and_split "*v_revvnx8hi" > + [(parallel > +[(set (match_operand:VNx8HI 0 "register_operand") > + (bswap:VNx8HI (match_operand 1 "register_opera

Re: [PATCH 1/2] libstdc++: Define _Scoped_allocation RAII helper

2025-05-22 Thread Daniel Krügler
Am Do., 22. Mai 2025 um 12:25 Uhr schrieb Tomasz Kaminski < tkami...@redhat.com>: > > > On Thu, May 22, 2025 at 12:21 PM Daniel Krügler > wrote: > >> >> >> Am Do., 22. Mai 2025 um 11:41 Uhr schrieb Tomasz Kamiński < >> tkami...@redhat.com>: >> >>> From: Jonathan Wakely >>> >>> libstdc++-v3/Chang

Re: [PATCH v4 1/2] aarch64: Match unpredicated shift patterns for ADR, SRA and ADDHNB instructions

2025-05-22 Thread Richard Sandiford
writes: > From: Dhruv Chawla > > This patch modifies the shift expander to immediately lower constant > shifts without unspec. It also modifies the ADR, SRA and ADDHNB patterns > to match the lowered forms of the shifts, as the predicate register is > not required for these instructions. > > Boot

Re: [PATCH 1/2] libstdc++: Define _Scoped_allocation RAII helper

2025-05-22 Thread Tomasz Kaminski
On Thu, May 22, 2025 at 12:21 PM Daniel Krügler wrote: > > > Am Do., 22. Mai 2025 um 11:41 Uhr schrieb Tomasz Kamiński < > tkami...@redhat.com>: > >> From: Jonathan Wakely >> >> libstdc++-v3/ChangeLog: >> >> * include/bits/allocated_ptr.h (_Scoped_allocation): New class >> templa

[PATCH v2] [aarch64] [vxworks] mark x18 as fixed, adjust tests

2025-05-22 Thread Alexandre Oliva
On May 21, 2025, Richard Sandiford wrote: > I think this one shows a deeper issue, though. -fsanitize=shadow-call-stack > is currently hardcoded to use x18: Oh, indeed! > and I assume this usage will be incompatible with the TCB usage. > So I think instead we should emit a sorry() if -fsaniti

[PATCH] rtl-ssa: Reject non-address uses of autoinc regs [PR120347]

2025-05-22 Thread Richard Sandiford
As the rtl.texi documentation of RTX_AUTOINC expressions says: If a register used as the operand of these expressions is used in another address in an insn, the original value of the register is used. Uses of the register outside of an address are not permitted within the same insn as a u

Re: [PATCH] RISC-V: Add pattern for vector-scalar multiply-add/sub [PR119100]

2025-05-22 Thread Paul-Antoine Arras
On 07/05/2025 12:29, Robin Dapp wrote: Yes, we need it in order to be able to test both paths, i.e. combining and not combining.  Also make sure to test with multiple types and situations as in Pan's patch. Please find attached a revised version of the patch. Compared to the previous iteratio

Re: [PATCH 2/2] libstdc++: Implement C++26 std::indirect [PR119152]

2025-05-22 Thread Jakub Jelinek
On Thu, May 22, 2025 at 11:19:25AM +0200, Tomasz Kamiński wrote: > From: Jonathan Wakely > > This papers implements C++27 std::indirect as specified s/27/26/ > in P3019 with ammendment to move assgiment from LWG 4251. s/assgiment/assignment/ Jakub

Re: [PATCH v3 3/9] libstdc++: Cleanup formatting in mdspan.

2025-05-22 Thread Tomasz Kaminski
On Wed, May 21, 2025 at 11:48 AM Luc Grosheintz wrote: > libstdc++-v3/ChangeLog: > > * include/std/mdspan: Fix two instances of > whitespace errors: `for(` -> `for (`. > > Signed-off-by: Luc Grosheintz > I would suggest merging these 3 patches into one. > --- > libstdc++-v3/inc

[PATCH 1/2] libstdc++: Define _Scoped_allocation RAII helper

2025-05-22 Thread Tomasz Kamiński
From: Jonathan Wakely libstdc++-v3/ChangeLog: * include/bits/allocated_ptr.h (_Scoped_allocation): New class template. Co-Authored-By: Tomasz Kamiński Signed-off-by: Tomasz Kamiński --- Tested on x86_64-linux. OK for trunk? libstdc++-v3/include/bits/allocated_ptr.h | 96

[PATCH 2/2] libstdc++: Implement C++26 std::indirect [PR119152]

2025-05-22 Thread Tomasz Kamiński
From: Jonathan Wakely This papers implements C++27 std::indirect as specified in P3019 with ammendment to move assgiment from LWG 4251. PR libstdc++/119152 libstdc++-v3/ChangeLog: * include/Makefile.am: Add new header. * include/Makefile.in: Regenerate. * includ

Re: [PATCH 00/13] arm: Remove iWMMXT code generation

2025-05-22 Thread Ramana Radhakrishnan
On Thu, May 22, 2025 at 11:09 AM Ramana Radhakrishnan wrote: > > On Wed, May 7, 2025 at 6:18 PM Richard Earnshaw wrote: > > > > > > The header file for the Arm implementation of mmintrin.h was changed in > > GCC-15 > > to disable access to the intrinsics. This patch removes the internal code >

Re: [committed v2 01/14] arm: clarify the logic of SECONDARY_(INPUT/OUTPUT)_RELOAD_CLASS

2025-05-22 Thread Ramana Radhakrishnan
On Mon, May 12, 2025 at 11:50 AM Richard Earnshaw wrote: > > The flattened logic of these functions and the complexity of the > numerous clauses makes it very difficult to understand what's written > in these macros. Additionally, SECONDARY_INPUT_RELOAD_CLASS was not > laid out with the correct f

Re: [PATCH 00/13] arm: Remove iWMMXT code generation

2025-05-22 Thread Ramana Radhakrishnan
On Wed, May 7, 2025 at 6:18 PM Richard Earnshaw wrote: > > > The header file for the Arm implementation of mmintrin.h was changed in GCC-15 > to disable access to the intrinsics. This patch removes the internal code > as well. > > We still allow -mcpu/-march options for the wmmx cpus, but they ar

Re: [PATCH 01/13] arm: clarify the logic of SECONDARY_(INPUT/OUTPUT)_RELOAD_CLASS

2025-05-22 Thread Ramana Radhakrishnan
On Wed, May 7, 2025 at 6:18 PM Richard Earnshaw wrote: > > The flattened logic of these functions and the complexity of the > numerous clauses makes it very difficult to understand what's written > in these macros. Additionally, SECONDARY_INPUT_RELOAD_CLASS was not > laid out with the correct for

Re: [PATCH] bitintlower: Ensure extension of the most significant limb on info->extended targets

2025-05-22 Thread Richard Biener
> Am 22.05.2025 um 09:31 schrieb Jakub Jelinek : > > On Wed, May 21, 2025 at 12:48:21PM +0200, Jakub Jelinek wrote: >> 2025-05-21 Jakub Jelinek >> >>* gimple-lower-bitint.cc (bitint_extended): New variable. >>(bitint_large_huge::lower_shift_stmt): For LSHIFT_EXPR with >>bitint_

[PING][PATCH v3] match.pd: Fold (x + y) >> 1 into IFN_AVG_FLOOR (x, y) for vectors

2025-05-22 Thread Pengfei Li
Hi, Just a gentle ping for below patch v3. I’ve made minor changes from v2 to v3, as listed below: - Added check if IFN_AVG_FLOOR is supported. - Wrapped new code in match.pd with macro "#ifdef GIMPLE". > This patch folds vector expressions of the form (x + y) >> 1 into > IFN_AVG_FLOOR (x, y), r

Re: Fix PR 118541 (V3), do not generate unordered fp cmoves for IEEE compares

2025-05-22 Thread Surya Kumari Jangala
Hi Mike, The source code changes are missing. Regards, Surya On 22/05/25 10:46 am, Michael Meissner wrote: > Fix PR 118541, do not generate unordered fp cmoves for IEEE compares. > > This is version 3 of patch. I re-implemented the patch to just focus on the > generation of the XSCMP{EQ,GT,GE}{

Re: [PATCH] libstdc++: Make debug iterator pointer sequence const [PR116369]

2025-05-22 Thread Jonathan Wakely
On Thu, 15 May 2025, 06:26 François Dumont, wrote: > Got > > On 14/05/2025 18:46, Jonathan Wakely wrote: > > On Wed, 14 May 2025 at 17:31, François Dumont > wrote: > >> On 12/05/2025 23:03, Jonathan Wakely wrote: > >>> On 31/03/25 22:20 +0200, François Dumont wrote: > Hi > > Follo

Re: [PATCH] libstdc++: Make debug iterator pointer sequence const [PR116369]

2025-05-22 Thread Jonathan Wakely
On Thu, 22 May 2025, 08:26 Jonathan Wakely, wrote: > > > On Thu, 15 May 2025, 06:26 François Dumont, wrote: > >> Got >> >> On 14/05/2025 18:46, Jonathan Wakely wrote: >> > On Wed, 14 May 2025 at 17:31, François Dumont >> wrote: >> >> On 12/05/2025 23:03, Jonathan Wakely wrote: >> >>> On 31/03/2

Re: [PATCH] bitintlower: Ensure extension of the most significant limb on info->extended targets

2025-05-22 Thread Jakub Jelinek
On Wed, May 21, 2025 at 12:48:21PM +0200, Jakub Jelinek wrote: > 2025-05-21 Jakub Jelinek > > * gimple-lower-bitint.cc (bitint_extended): New variable. > (bitint_large_huge::lower_shift_stmt): For LSHIFT_EXPR with > bitint_extended if lhs has most significant partial limb exte

Re: [PATCH] libstdc++: Fix vector(from_range_t, R&&) for exceptions [PR120367]

2025-05-22 Thread Jonathan Wakely
On Thu, 22 May 2025, 07:21 Tomasz Kaminski, wrote: > > > On Wed, May 21, 2025 at 5:41 PM Jonathan Wakely > wrote: > >> Because this constructor delegates to vector(a) the object has been >> fully constructed and the destructor will run if an exception happens. >> That means we need to set _M_fin

Re: [PATCH] libgcc: PR target/116363 Fix SFtype to UDWtype conversion

2025-05-22 Thread Jan Dubiec
On 23.02.2025 04:59, Jeff Law wrote: [...] Thanks!  Just a note we're in stage4 of our development cycle (regression bugfixes) as we prepare for gcc-15.  This doesn't look like something we would typically make an exception for, it'll have to wait for the next development window.  Meaning it pr