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

2025-05-12 Thread Li, Pan2
Thanks Richard. > I think it's enough to put :c on one of the (plus > OK with that change. Oh, yes, will commit if no surprise from test for this change. Pan -Original Message- From: Richard Biener Sent: Monday, May 12, 2025 2:57 PM To: Li, Pan2 Cc: gcc-patches@gcc.gnu.org; juzhe.zh.

Re: [PATCH v20 0/4] c: Add _Countof and

2025-05-12 Thread Joseph Myers
On Sun, 11 May 2025, Alejandro Colomar wrote: > Hi, > > Here's the list of changes in v20: > > - Drop changes to support Cc tags in commit messages (but keep the >patch to add support for Link tags). That patch *does not belong in this series*. Keep the series to only those patches conce

Re: [PATCH] gimple-fold: Don't replace `tmp = FP0 CMP FP1; if (tmp != 0)` over and over again when comparison can throw

2025-05-12 Thread Richard Biener
On Sat, May 10, 2025 at 3:19 AM Andrew Pinski wrote: > > with -ftrapping-math -fnon-call-exceptions and: > ``` > tmp = FP0 CMP FP1; > > if (tmp != 0) ... > ``` > a call fold_stmt on the GIMPLE_COND will replace the above with > a new tmp each time and we even lose the eh informatin on the > previo

[PATCH 1/3] libstdc++: Avoid double indirection in move_only_function when possible [PR119125]

2025-05-12 Thread Tomasz Kamiński
Based on the provision in C++26 [func.wrap.general] p2 this patch adjust the generic move_only_function(_Fn&&) constructor, such that when _Fn refers to selected move_only_function instantiations, the ownership of the target object is direclty transfered to constructor object. This avoid cost of

Re: [PATCH] ext-dce: Only transform extend to subreg if TRULY_NOOP_TRUNCATION [PR 120050]

2025-05-12 Thread Richard Sandiford
Xi Ruoyao writes: > The tranform would be unsafe if !TRULY_NOOP_TRUNCATION because on these > machines the hardware may look at bits outside of the given mode. > > gcc/ChangeLog: > > PR rtl-optimization/120050 > * ext-dce.cc (ext_dce_try_optimize_insn): Only transform the > insn

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

2025-05-12 Thread Li, Pan2
> Right now it looks like plus/minus don't need to be different tests > (and mult won't need to be either I presume)? While I'm not against adding > individual tests for now I'd prefer us to consolidate them where possible in > the long term. Is that in your plans? I think we need the run tes

[PATCH v1 0/1]RISC-V :The following changes enable P8700 MIPS processor for RISC-V.

2025-05-12 Thread Umesh Kalappa
--- gcc/config/riscv/mips-p8700.md | 139 +++ gcc/config/riscv/riscv-cores.def | 5 ++ gcc/config/riscv/riscv-opts.h| 3 +- gcc/config/riscv/riscv.cc| 22 + gcc/config/riscv/riscv.md| 3 +- 5 files changed, 170 insertions(+), 2 deletions

Re: [PATCH] gimple-fold: Canonicalize _Bool == 0 and _Bool != 1

2025-05-12 Thread Richard Biener
On Sat, May 10, 2025 at 3:13 AM Andrew Pinski wrote: > > This move this canonicalization from forwprop > (forward_propagate_into_gimple_cond) > to gimple-fold. > This is a step in removing forward_propagate_into_gimple_cond from forwprop. I don't think fold_stmt should mess with the CFG, so NACK

Re: [Patch] Fortran: Use mpfr_sinu etc. with mpfr 4.2.0+ for degree trigonometric functions [PR120225]

2025-05-12 Thread Richard Biener
On Mon, May 12, 2025 at 11:42 AM Tobias Burnus wrote: > > C23 added the sinpi, cospi, etc. functions. Therefore, MPFR in 4.2.0 > added the mpfr_ counter parts. I assume that those internally use the > mpfr_sinu, mpfr_cosu, ... functions, which are also user accessible. > > In any case, MPFR makes

Re: [PATCH v20 3/4] c: Add

2025-05-12 Thread Joseph Myers
On Sun, 11 May 2025, Alejandro Colomar wrote: > gcc/ChangeLog: > > * Makefile.in (USER_H): Add . > * ginclude/stdcountof.h: Add countof macro. This is missing tests for the header. -- Joseph S. Myers josmy...@redhat.com

[PATCH] sync LTO streaming and hashing for accelerators and vector type mode

2025-05-12 Thread Richard Biener
The following syncs up LTO tree hashing and streaming of TYPE_MODE and DECL_MODE which long had a discrepancy for vector types and recently got special-casing of streaming for offloading. Failure to handle this results in less possible type merging to occur. Note the compare step will still use TY

Re: [PATCH] testsuite: arm: Fix unsigned-extend-2.c [PR116445]

2025-05-12 Thread Richard Earnshaw (lists)
On 11/04/2025 17:36, Christophe Lyon wrote: > The test was designed to pass with thumb2, but code generation changed > with the introduction of Low Overhead Loops, so the test can fail if > one overrides the flags when running the testsuite. > > In addition, useless subtract / extension instructio

Re: [PATCH] gimple: Canonical order for invariants [PR118902]

2025-05-12 Thread Richard Biener
On Fri, May 9, 2025 at 10:12 PM Andrew Pinski wrote: > > On Mon, Apr 21, 2025 at 1:42 AM Richard Biener > wrote: > > > > On Thu, Apr 17, 2025 at 7:37 PM Andrew Pinski > > wrote: > > > > > > So unlike constants, address invariants are currently put first if > > > used with a SSA NAME. > > > It w

[PATCH] libgcobol: Allow for lack of LOG_PERROR

2025-05-12 Thread Rainer Orth
The libgcobol build is broken again on Solaris: /vol/gcc/src/hg/master/local/libgcobol/libgcobol.cc: In function ‘void default_exception_handler(ec_type_t)’: /vol/gcc/src/hg/master/local/libgcobol/libgcobol.cc:11196:44: error: ‘LOG_PERROR’ was not declared in this scope; did you mean ‘LOG_ERR’?

Re: [PATCH v2] RISC-V: Support for zilsd and zclsd extensions.

2025-05-12 Thread Kito Cheng
This patch is somewhat corrupt...but anyway, fixed and pushed to trunk On Thu, May 8, 2025 at 12:43 PM Dongyan Chen wrote: > > This patch support zilsd and zclsd[1] extensions. > To enable GCC to recognize and process zilsd and zclsd extension > correctly at compile time. > > [1] https://github.

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

2025-05-12 Thread Kito Cheng
pushed to trunk, thanks :) On Mon, May 12, 2025 at 5:20 PM Dongyan Chen wrote: > > This patch support ssnpm, smnpm, smmpm, sspm and supm extensions[1]. > To enable GCC to recognize and process ssnpm, smnpm, smmpm, sspm and > supm extensions correctly at compile time. > > [1]https://github.com/ris

Re: [PATCH v2] RISC-V: Support for zilsd and zclsd extensions.

2025-05-12 Thread Dongyan Chen
Okay, thanks! 在 2025/5/12 21:32, Kito Cheng 写道: This patch is somewhat corrupt...but anyway, fixed and pushed to trunk

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

2025-05-12 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] ext-dce: Only transform extend to subreg if TRULY_NOOP_TRUNCATION [PR 120050]

2025-05-12 Thread Xi Ruoyao
On Mon, 2025-05-12 at 12:59 +0100, Richard Sandiford wrote: > Xi Ruoyao writes: > > The tranform would be unsafe if !TRULY_NOOP_TRUNCATION because on these > > machines the hardware may look at bits outside of the given mode. > > > > gcc/ChangeLog: > > > > PR rtl-optimization/120050 > >

[PATCH] Cleanup internal vectorizer costing API

2025-05-12 Thread Richard Biener
This tries to cleanup the API available to vectorizable_* to record stmt costs. There are several overloads of record_stmt_cost for this and the patch adds one only specifying SLP node and makes the one only having a stmt_vec_info suitable for scalar stmt processing only. There are awkward spots

Re: [PATCH] libstdc++: Fix constraint recursion in std::expected's operator== [PR119714]

2025-05-12 Thread Patrick Palka
On Tue, 6 May 2025, Tomasz Kaminski wrote: > > > On Mon, May 5, 2025 at 8:50 PM Patrick Palka wrote: > Tested on x86_64-pc-linux-gnu, does this look OK for trunk/15? > > This LGTM. > Out of curiosity, would declaring them as members also fix the issue? Ah yes it does fix it, and in fact

RE: [EXTERNAL]RE: [PATCH ]RISCV :Added MIPS P8700 Subtarget

2025-05-12 Thread Umesh Kalappa
Sure @Palmer Dabbelt ,sent in a different thread email with updated patch. Thank you ~U -Original Message- From: Palmer Dabbelt Sent: 08 May 2025 23:38 To: Umesh Kalappa Cc: jeffreya...@gmail.com; gcc-patches@gcc.gnu.org; kito.ch...@sifive.com; jesse.hu...@sifive.com; Andrew Water

Re: [PATCH] c++: Add attribute handles_virtual_move_assign

2025-05-12 Thread Jason Merrill
On 5/11/25 7:11 PM, Owen Avery wrote: Yeah, that looks way simpler. Should I add you as co-author on the patch? Sounds good, thanks. On 4/28/25 22:13, Jason Merrill wrote: On 4/28/25 5:07 PM, Owen Avery wrote: As far as I can tell, that would need to be applied to every class which virtuall

Re: [PATCH] c++/modules: Revert "Remove unnecessary lazy_load_pendings"

2025-05-12 Thread Jason Merrill
On 5/9/25 11:33 AM, Nathaniel Shead wrote: On Fri, May 09, 2025 at 08:18:58AM -0400, Jason Merrill wrote: On 4/21/25 6:22 AM, Nathaniel Shead wrote: This call is not necessary, as we don't access the bodies of any classes that we instantiate here. This turns out to break 20_util/function_obj

[PATCH] fortran: map atand(y, x) to atan2d(y, x) [PR113413]

2025-05-12 Thread Yuao Ma
Hi Tobias, Following up on your review comments, I have updated the patch. Specifically, I have: * Added the PR number to the subject line. * Used the -b and -p options when running git gcc-commit-mklog. * Updated the intrinsic documentation as requested. Could you please take another look when yo

[PATCH v1] contrib/: Add support for Link: tags

2025-05-12 Thread Alejandro Colomar
contrib/ChangeLog: * gcc-changelog/git_commit.py (GitCommit): Add support for 'Link:' tags. Cc: Jason Merrill Signed-off-by: Alejandro Colomar --- Hi, This patch is needed by my patches that add _Countof. Have a lovely day! Alex contrib/gcc-changelog/git_commit.py | 3 +++

RE: [PATCH] Cleanup internal vectorizer costing API

2025-05-12 Thread Tamar Christina
> -Original Message- > From: Richard Biener > Sent: Monday, May 12, 2025 1:46 PM > To: gcc-patches@gcc.gnu.org > Cc: Tamar Christina ; RISC-V CI c...@rivosinc.com> > Subject: [PATCH] Cleanup internal vectorizer costing API > > This tries to cleanup the API available to vectorizable_* to

Re: [PATCH v5 05/10] libstdc++: Implement layout_left from mdspan.

2025-05-12 Thread Luc Grosheintz
On 5/9/25 8:16 AM, Tomasz Kaminski wrote: The test I would perform would be : std::layout_left::mapping> l0; std::layout_right:mapping> r0; // stride bool all_unique() { return l0.is_unique(); return r0.is_unique(); } And we should have only one is_unique symbol. but with a lot more d

[PATCH] optabs: Remove cmov optab [PR120230]

2025-05-12 Thread Andrew Pinski
cmov optab was added back in r0-24110-g1c0290eaac4094 (https://gcc.gnu.org/pipermail/gcc-patches/1999-September/018596.html) but it was never used. movcc is used instead and since r0-93453-gf90b7a5a7913cc (cond-optab), movcc becomes what cmov_optab was going to be; in having a combined compare and

[PATCH v21 1/3] c: Add _Countof operator

2025-05-12 Thread Alejandro Colomar
This operator is similar to sizeof but can only be applied to an array, and returns its number of elements. FUTURE DIRECTIONS: - We should make it work with array parameters to functions, and somehow magically return the number of elements of the array, regardless of it being really a poin

Re: [PATCH v5 05/10] libstdc++: Implement layout_left from mdspan.

2025-05-12 Thread Tomasz Kaminski
Thank you for all the work that you have done by doing the two implementations and extensive test cases. I wanted to respond to a few points that I think we may want to consider to be bugs in specification, and report them as bugs in standard. (Would you be interested in doing so?) I do not unders

[PATCH v21 0/3] c: Add _Countof and

2025-05-12 Thread Alejandro Colomar
Hi! Here's the list of changes in v21: - Drop patch 1 (I've sent it separately, as Joseph requested). - Keep Link tags. This means the other patch is an implicit dependency of this patch set. - Fix test compiler flags. [Joseph] - Add tests for . [Joseph] - Add tests for pedantic diagno

[PATCH v21 2/3] c: Add

2025-05-12 Thread Alejandro Colomar
gcc/ChangeLog: * Makefile.in (USER_H): Add . * ginclude/stdcountof.h: Add countof macro. gcc/testsuite/ChangeLog: * gcc.dg/countof-stdcountof.c: Add tests for . Signed-off-by: Alejandro Colomar --- gcc/Makefile.in | 1 + gcc/ginclude/stdcount

[PATCH v21 3/3] c: Add -Wpedantic diagnostic for _Countof

2025-05-12 Thread Alejandro Colomar
It has been standardized in C2y. gcc/c/ChangeLog: * c-parser.cc (c_parser_sizeof_or_countof_expression): Add -Wpedantic diagnostic for _Countof in <= C23 mode. gcc/testsuite/ChangeLog: * gcc.dg/countof-compat.c * gcc.dg/countof-no-compat.c * gcc.dg/counto

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

2025-05-12 Thread Pengfei Li
This patch folds vector expressions of the form (x + y) >> 1 into IFN_AVG_FLOOR (x, y), reducing instruction count on platforms that support averaging operations. For example, it can help improve the codegen on AArch64 from: add v0.4s, v0.4s, v31.4s ushrv0.4s, v0.4s, 1 to:

Re: [PATCH 2/2] Move vector lowering to before vectorization

2025-05-12 Thread Richard Sandiford
Richard Biener writes: > The following moves vector lowering to before vectorization - in fact > to before DCE/forwprop and CSE. This gets us the chance to re-vectorize > the lowered form eventually. Note that when the vectorizer learns to > handle vector code vector lowering should be likely in

[PING][PATCH][GCC15] Alpha: Fix base block alignment calculation regression

2025-05-12 Thread Maciej W. Rozycki
On Thu, 1 May 2025, Maciej W. Rozycki wrote: > > > OK. Clearly this one slipped through the cracks. > > > > Good timing, I've applied it now just as I'm about to head away for some > > holiday time. I'll take care of the other outstanding stuff in this area > > once GCC 16 has opened and wor

Re: i386: Fix some problems in stv cost model

2025-05-12 Thread Jan Hubicka
> > Instructions with latency info are those really different. > > So the uncoverted code has sum of latencies 4 and real latency 3. > > Converted code has sum of latencies 4 and real latency 3 > > (vmod+vpmaxsd+vmov). > > So I do not quite see it should be a win. > > Note this was historically d

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

2025-05-12 Thread Richard Earnshaw
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 formatting. Add some parenthesis and re-indent to make the logic cle

[committed v2 08/14] arm: Remove iwmmxt support from arm.cc

2025-05-12 Thread Richard Earnshaw
TARGET_IWMMXT, TARGET_IWMMXT2 and their _REALLY_ equivalents are never true now, so the code using them can be simplified. gcc/ChangeLog: * config/arm/arm.cc (arm_option_check_internal): Remove IWMMXT check. (arm_options_perform_arch_sanity_checks): Likewise. (use_

[committed v2 05/14] arm: Remove iwmmxt patterns.

2025-05-12 Thread Richard Earnshaw
This patch deletes the patterns relating to iwmmxt and iwmmxt2 and updates the relevant dependencies. gcc/ChangeLog: * config/arm/arm.md: Don't include iwmmxt.md. * config/arm/t-arm (MD_INCLUDES): Remove iwmmxt*.md. * config/arm/iwmmxt.md: Removed. * config/arm/iwm

[committed v2 03/14] arm: treat -mcpu/arch=iwmmxt{,2} like XScale

2025-05-12 Thread Richard Earnshaw
Treat options that select iwmmxt variants as we would for xscale. We leave the feature bits in for now, since they are still needed elsewhere, but they are never enabled. Also remove the remaining testsuite framework support for iwmmxt, since this will never trigger now. gcc/ * config/a

[committed v2 00/14] arm: Remove iWMMXT code generation

2025-05-12 Thread Richard Earnshaw
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 are now treated in exactly the same way as XScale - generating code for

[committed v2 07/14] arm: remove support for the iwmmxt ABI variant.

2025-05-12 Thread Richard Earnshaw
The iwmmxt ABI is a variant of the ABI that supported passing certain parameters and results in iwmmxt registers. But since we no-longer support the instructions that can read and write these registers, the ABI variant can no-longer be used. gcc/ChangeLog: * config.gcc (arm, --with-abi):

[committed v2 11/14] arm: remove dead predefines when using WMMX

2025-05-12 Thread Richard Earnshaw
Since we no-longer enable iWMMXT, these predefines are no-longer enabled when preprocessing C. Remove them. gcc/ChangeLog: * config/arm/arm-c.cc (arm_cpu_builtins): Remove predefines for __IWWMXT__, __IWMMXT2__ and __ARM_WMMX. --- gcc/config/arm/arm-c.cc | 7 --- 1 file cha

[committed v2 02/14] arm: testsuite: remove iwmmxt tests

2025-05-12 Thread Richard Earnshaw
These two tests were specific to iWMMXT, but we're about to remove that code, so the tests are now redundant. gcc/testsuite/ChangeLog: * gcc.target/arm/mmx-1.c: Removed. * gcc.target/arm/mmx-2.c: Removed. * gcc.target/arm/pr64208.c: Removed. * gcc.target/arm/pr7914

[committed v2 10/14] arm: cleanup iterators.md after removing iwmmxt

2025-05-12 Thread Richard Earnshaw
Mostly this is just removing references to iWMMXT in comments, but also remove some now unused iterators and attributes. gcc/ChangeLog: * config/arm/iterators.md (VMMX, VMMX2): Remove mode iterators. (MMX_char): Remove mode iterator attribute. --- gcc/config/arm/iterators.md | 20

[PATCH] libstdc++: Remove #warning from for C++17 [PR120187]

2025-05-12 Thread Jonathan Wakely
Although was removed from C++20, it was not formally deprecated in C++17. In contrast, , , etc. were formally deprecated in C++17 before being removed in C++20. Due to the widespread convention of including to detect implementation-specific macros (such as _GLIBCXX_RELEASE) it causes quite a lot

[committed v2 06/14] arm: remove IWMMXT checks from MD files.

2025-05-12 Thread Richard Earnshaw
Remove the various checks for TARGET_IWMMXT{,2} and TARGET_REALLY_IWMMXT{,2} from the remaining machine description files. These flags can never be true now. gcc/ChangeLog: * config/arm/arm.md(attr arch): Remove iwmmxt and iwmmxt2. Remove checks based on TARGET_REALLY_IWMMXT2 from

[committed v2 04/14] arm: remove iWMMX builtins support.

2025-05-12 Thread Richard Earnshaw
This is the first step of removing the various builtins for iwmmxt, removing the builtins expansion code. It leaves a lot of code elsewhere, but we'll clean that up in subsequent patches. I'm not sure why safe_vector_operand would unconditionally try to expand to an iwmmxt instruction if passed (

[PATCH] libstdc++: Restore std::scoped_lock for non-gthreads targets [PR120198]

2025-05-12 Thread Jonathan Wakely
This was a regression introduced with using version.def to define feature test macros. std::scoped_lock can be defined unconditionally (including for freestanding). libstdc++-v3/ChangeLog: PR libstdc++/120198 * include/bits/version.def (scoped_lock): Do not depend on gthre

[committed v2 12/14] arm: remove most remaining iwmmxt code.

2025-05-12 Thread Richard Earnshaw
Remove most of the remaining code for iWMMXT support, except for the register allocation table entries. gcc/ChangeLog: * config/arm/arm-cpus.in (feature iwmmxt, feature iwmmxt2): Delete. * config/arm/arm-protos.h (arm_output_iwmmxt_shift_immediate): Delete. (arm_output_iw

[committed v2 09/14] arm: remove iwmmxt-related attributes from machine description

2025-05-12 Thread Richard Earnshaw
Since we no-longer have any iwmxxt instructions, the iwmmxt-related attributes can never be set. Consequently, the marvel-f-iwmmxt scheduler is redundant as none of the pipes are ever used now. gcc/ChangeLog: * config/arm/arm.md (core_cycles): Remove iwmmxt attributes. * config/a

Re: [PATCH v1] contrib/: Add support for Link: tags

2025-05-12 Thread Jonathan Wakely
On Mon, 12 May 2025 at 16:46, Alejandro Colomar wrote: > > contrib/ChangeLog: > > * gcc-changelog/git_commit.py (GitCommit): > Add support for 'Link:' tags. > > Cc: Jason Merrill I don't think we want a Cc: trailer in the actual commit message. do we? What is a Link: tag? I assu

Re: [PATCH v1] contrib/: Add support for Link: tags

2025-05-12 Thread Jonathan Wakely
On Mon, 12 May 2025 at 17:34, Jonathan Wakely wrote: > > On Mon, 12 May 2025 at 16:46, Alejandro Colomar wrote: > > > > contrib/ChangeLog: > > > > * gcc-changelog/git_commit.py (GitCommit): > > Add support for 'Link:' tags. > > > > Cc: Jason Merrill > > I don't think we want a Cc

Re: [PATCH v21 2/3] c: Add

2025-05-12 Thread Joseph Myers
On Mon, 12 May 2025, Alejandro Colomar wrote: > + if (strcmp (xstr(countof), "_Alignas") != 0) countof should definitely not expand to _Alignas! I don't recommend posting untested patches. -- Joseph S. Myers josmy...@redhat.com

Re: [PATCH] vxworks: libgcc: include string.h for memset

2025-05-12 Thread Olivier Hainque
On Fri, 9 May 2025 at 04:26, Alexandre Oliva wrote: > > gthr-vxworks-thread.c calls memset in __ghtread_cond_signal, but it > fails ot include , where this function is declared, and GCC > 14 rejects calls of undeclared functions. Include the required > header. > > Ok to install? > Sure, thanks

[PATCH] libfortran: Fix up _gfortran_s{max,min}loc1_{4,8,16}_s{1,4} [PR120191]

2025-05-12 Thread Jakub Jelinek
Hi! There is a bug in _gfortran_s{max,min}loc1_{4,8,16}_s{1,4} which the following testcase shows. The functions return but then crash in the caller. Seems that is because buffer overflows, I believe those functions for if (mask == NULL || *mask) condition being false are supposed to fill in the r

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

2025-05-12 Thread Robin Dapp
This patch would like to introduce the combine of vec_dup + vsub.vv into vsub.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: The changes to add are very

libstdc++: Rewrite atomic builtin checks: Fix up 'GLIBCXX_ENABLE_BACKTRACE' check with 'size_t' [PR119667] (was: [PATCH] libstdc++: Rewrite atomic builtin checks [PR70560])

2025-05-12 Thread Thomas Schwinge
Hi! On 2025-04-29T21:09:17+0100, Jonathan Wakely wrote: > The GLIBCXX_ENABLE_BACKTRACE macro currently uses the > glibcxx_ac_atomic_int macro defined by the checks that this commit > removes from GLIBCXX_ENABLE_ATOMIC_BUILTINS. That wasn't a good check > anyway, because libbacktrace actually depe

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

2025-05-12 Thread Dongyan Chen
This patch support ssnpm, smnpm, smmpm, sspm and supm extensions[1]. To enable GCC to recognize and process ssnpm, smnpm, smmpm, sspm and supm extensions correctly at compile time. [1]https://github.com/riscv/riscv-j-extension/blob/master/zjpm/instructions.adoc Changes for v4: - Fix the code bas

Re: libstdc++: Rewrite atomic builtin checks: Fix up 'GLIBCXX_ENABLE_BACKTRACE' check with 'size_t' [PR119667] (was: [PATCH] libstdc++: Rewrite atomic builtin checks [PR70560])

2025-05-12 Thread Jonathan Wakely
On Mon, 12 May 2025 at 09:52, Thomas Schwinge wrote: > > Hi! > > On 2025-04-29T21:09:17+0100, Jonathan Wakely wrote: > > The GLIBCXX_ENABLE_BACKTRACE macro currently uses the > > glibcxx_ac_atomic_int macro defined by the checks that this commit > > removes from GLIBCXX_ENABLE_ATOMIC_BUILTINS. Th

Re: [PATCH v1] libstdc++: More efficient weekday from year_month_day.

2025-05-12 Thread Jonathan Wakely
On Sun, 11 May 2025 at 12:34, Cassio Neri wrote: > > Hi all, > > After reflecting on my previous message and Andrew's, I now believe this > patch is not the best solution to optimise the day of the week. Instead, the > optimisation for n % 7 should be done by the compiler depending on the > pla

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

2025-05-12 Thread Dongyan Chen
This patch support ssnpm, smnpm, smmpm, sspm and supm extensions[1]. To enable GCC to recognize and process ssnpm, smnpm, smmpm, sspm and supm extensions correctly at compile time. [1]https://github.com/riscv/riscv-j-extension/blob/master/zjpm/instructions.adoc Changes for v5: - Fix the testsuit

[PATCH] libfortran: Fix up _gfortran_s{max,min}loc2_{4,8,16}_s{1,4} [PR120191]

2025-05-12 Thread Jakub Jelinek
Hi! I've tried to write a testcase for the BT_CHARACTER maxloc/minloc with named or unnamed arguments and indeed the just posted patch fixed the arguments in there in multiple cases to match what the library expects. But the testcase still fails, due to library problems. One dealt with in this pa

[PATCH] testsuite/120222 - adjust gcc.dg/tree-ssa/gen-vect-28.c for inlining change

2025-05-12 Thread Richard Biener
We now inline main_1, confusing the expected number of vectorizations. Pushed. PR testsuite/120222 * gcc.dg/tree-ssa/gen-vect-28.c: Use noipa on main_1. --- gcc/testsuite/gcc.dg/tree-ssa/gen-vect-28.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/tests

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

2025-05-12 Thread Surya Kumari Jangala
Hi Mike, Irrespective of whether -Ofast is used or not, should’nt we generate XSCMPUDP instruction for ‘isgreater()’ operation? This is because XSCMPGTDP insn will generate a trap if either operand is an SNaN or a QNaN. Whereas, XSCMPUDP insn will generate a trap only if either operand is an SNa

[PATCH] Partially lift restriction from loc_list_from_tree_1

2025-05-12 Thread Eric Botcazou
Hi, the function accepts all handled_component_p expressions and decodes them by means of get_inner_reference as expected, but bails out on bitfields: /* TODO: We can extract value of the small expression via shifting even for nonzero bitpos. */ if (list_ret == 0)

[PATCH] ext-dce: Only transform extend to subreg if TRULY_NOOP_TRUNCATION [PR 120050]

2025-05-12 Thread Xi Ruoyao
The tranform would be unsafe if !TRULY_NOOP_TRUNCATION because on these machines the hardware may look at bits outside of the given mode. gcc/ChangeLog: PR rtl-optimization/120050 * ext-dce.cc (ext_dce_try_optimize_insn): Only transform the insn if TRULY_NOOP_TRUNCATION. -

Re: [PATCH v2] loop2_unroll: split loop exit during unrolling of uncountable loops

2025-05-12 Thread Artemiy Volkov
On 4/23/2025 6:01 PM, Artemiy Volkov wrote: > Hi all, > > sending a v2 of > https://gcc.gnu.org/pipermail/gcc-patches/2025-April/680893.html after > fixing several issues with the original patch. Namely, the changes > since v1 are: > > - Remove the call to df_finish_pass () at the end of split_e

[Patch] Fortran: Use mpfr_sinu etc. with mpfr 4.2.0+ for degree trigonometric functions [PR120225]

2025-05-12 Thread Tobias Burnus
C23 added the sinpi, cospi, etc. functions. Therefore, MPFR in 4.2.0 added the mpfr_ counter parts. I assume that those internally use the mpfr_sinu, mpfr_cosu, ... functions, which are also user accessible. In any case, MPFR makes the ...u functions available and explicitly documents that for u

[committed v2 14/14] arm: doc: cleanup documentation references to iWMMXT extensions

2025-05-12 Thread Richard Earnshaw
Now that the iwmmxt extensions have been removed, clean up the references to it in the documentation. We keep the -mcpu/-mtune/-march references as these are still accepted by the driver. gcc/ChangeLog: * doc/extend.texi: Remove the iwmmxt intrinsics. * doc/md.texi: Remove the iw

[committed v2 13/14] arm: remove iwmmxt registers from allocator tables

2025-05-12 Thread Richard Earnshaw
These registers can no-longer be allocated, so remove them from the various tables. gcc/ChangeLog: * config/arm/aout.h (REGISTER_NAMES): Remove iwmmxt registers. * config/arm/arm.h (FIRST_IWMMXT_REGNUM): Delete. (LAST_IWMMXT_REGNUM): Delete. (FIRST_IWMMXT_GR_REGNUM

Re: [PATCH v3] Consider frequency in cost estimation when converting scalar to vector.

2025-05-12 Thread Jan Hubicka
> > gcc/ChangeLog: > > > > * config/i386/i386-features.cc > > (scalar_chain::mark_dual_mode_def): Weight > > n_integer_to_sse/n_sse_to_integer with bb frequency. > > (general_scalar_chain::compute_convert_gain): Ditto, and > > adjust function prototype to ret

Re: [PATCH] libstdc++: Restore std::scoped_lock for non-gthreads targets [PR120198]

2025-05-12 Thread Tomasz Kaminski
On Mon, May 12, 2025 at 12:04 PM Jonathan Wakely wrote: > This was a regression introduced with using version.def to define > feature test macros. Could you add link to commit here, I think this is r14-3248-g083b7f2833d71d. > std::scoped_lock can be defined unconditionally > (including for free

Re: [PATCH] libstdc++: Remove #warning from for C++17 [PR120187]

2025-05-12 Thread Tomasz Kaminski
On Mon, May 12, 2025 at 12:06 PM Jonathan Wakely wrote: > Although was removed from C++20, it was not formally > deprecated in C++17. In contrast, , , etc. were > formally deprecated in C++17 before being removed in C++20. > > Due to the widespread convention of including to detect > implementa

[PATCH 3/3] libstdc++: Renamed bits/move_only_function.h to bits/funcwrap.h [PR119125]

2025-05-12 Thread Tomasz Kamiński
The file now includes copyable_function in addition to move_only_function. PR libstdc++/119125 libstdc++-v3/ChangeLog: * include/bits/move_only_function.h: Move to... * include/bits/funcwrap.h: ...here. * doc/doxygen/stdheader.cc (init_map): Replaced move_only_func

Re: [PATCH] libstdc++: Restore std::scoped_lock for non-gthreads targets [PR120198]

2025-05-12 Thread Jonathan Wakely
On Mon, 12 May 2025 at 11:19, Tomasz Kaminski wrote: > > > > On Mon, May 12, 2025 at 12:04 PM Jonathan Wakely wrote: >> >> This was a regression introduced with using version.def to define >> feature test macros. > > Could you add link to commit here, I think this is r14-3248-g083b7f2833d71d. Do

[PATCH 2/3] libstdc++: Implement C++26 copyable_function [PR119125]

2025-05-12 Thread Tomasz Kamiński
This patch implements C++26 copyable_function as specified in P2548R6. It also implements LWG 4255 that adjust move_only_function so constructing from empty copyable_function, produces empty functor. This falls from existing checks, after specializing __is_polymorphic_function_v for copyable_functi

[PATCH 0/3] libstdc++: Implement P2548R6 (copyable function)

2025-05-12 Thread Tomasz Kamiński
This patch series implements the copyable_function as specified in P2548R6. It also modifies implementation of move_only_funtion to avoid doulbe indirection when constructing from other function wrappers, based on provision in C++26 [func.wrap.general] p2. Finally we rename bits/move_only_function.

[PATCH v2] libstdc++: Cleanup and stabilize format _Spec<_CharT> and _Pres_type.

2025-05-12 Thread Tomasz Kamiński
These patch makes following changes to _Pres_type values: * _Pres_esc is replaced with separate _M_debug flag. * _Pres_s, _Pres_p do not overlap with _Pres_none. * hexadecimal presentation use same values for pointer, integer and floating point types. The members of _Spec<_CharT> are rearang

Re: [PATCH v20 2/4] c: Add _Countof operator

2025-05-12 Thread Joseph Myers
On Sun, 11 May 2025, Alejandro Colomar wrote: > +/* { dg-options "-Wno-declaration-after-statement -Wno-pedantic -Wno-vla" } > */ > +/* { dg-options "-Wno-pedantic -Wvla-parameter" } */ > +/* { dg-options "-Wno-declaration-after-statement -Wno-pedantic -Wno-vla" } > */ Most of these options a

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

2025-05-12 Thread Richard Biener
On Mon, 12 May 2025, Icen Zeyada wrote: > 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 eq

Re: [PATCH] libstdc++: Fix constraint recursion in std::expected's operator== [PR119714]

2025-05-12 Thread Tomasz Kaminski
On Mon, May 12, 2025 at 3:01 PM Patrick Palka wrote: > On Tue, 6 May 2025, Tomasz Kaminski wrote: > > > > > > > On Mon, May 5, 2025 at 8:50 PM Patrick Palka wrote: > > Tested on x86_64-pc-linux-gnu, does this look OK for trunk/15? > > > > This LGTM. > > Out of curiosity, would declaring th

Re: [PATCH 1/3] libstdc++: Avoid double indirection in move_only_function when possible [PR119125]

2025-05-12 Thread Tomasz Kaminski
On Mon, May 12, 2025 at 12:57 PM Tomasz Kamiński wrote: > Based on the provision in C++26 [func.wrap.general] p2 this patch adjust > the generic > move_only_function(_Fn&&) constructor, such that when _Fn refers to > selected > move_only_function instantiations, the ownership of the target object

[PUSHED] nvptx: Support '-mptx=5.0'

2025-05-12 Thread Thomas Schwinge
gcc/ * config/nvptx/nvptx-opts.h (enum ptx_version): Add 'PTX_VERSION_5_0'. * config/nvptx/nvptx.cc (ptx_version_to_string) (ptx_version_to_number): Adjust. * config/nvptx/nvptx.h (TARGET_PTX_5_0): New. * config/nvptx/nvptx.opt (Enum(ptx_versi

[PATCH v2 2/3] libstdc++: Implement C++26 copyable_function [PR119125]

2025-05-12 Thread Tomasz Kamiński
This patch implements C++26 copyable_function as specified in P2548R6. It also implements LWG 4255 that adjust move_only_function so constructing from empty copyable_function, produces empty functor. This falls from existing checks, after specializing __is_polymorphic_function_v for copyable_functi

[PATCH v2 1/3] libstdc++: Avoid double indirection in move_only_function when possible [PR119125]

2025-05-12 Thread Tomasz Kamiński
Based on the provision in C++26 [func.wrap.general] p2 this patch adjust the generic move_only_function(_Fn&&) constructor, such that when _Fn refers to selected move_only_function instantiations, the ownership of the target object is direclty transfered to constructor object. This avoid cost of

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

2025-05-12 Thread Robin Dapp
I think we need the run tests for each op combine up to a point. But for asm check, Seems we can put it together? I mean something like below: +/* { dg-do compile } */ +/* { dg-options "-march=rv64gcv -mabi=lp64d --param=gpr2vr-cost=0" } */ + +#include "vx_binary.h" + +DEF_VX_BINARY_CASE_0(int3

[PUSHED] GCN, nvptx libstdc++: Force use of '__atomic' builtins: revert 'atomicity_dir=cpu/generic/atomicity_builtins' hard-coding [PR119645]"

2025-05-12 Thread Thomas Schwinge
Thanks to commit 86627faec10da53d7532805019e5296fcf15ac09 "libstdc++: Rewrite atomic builtin checks [PR70560]", for both GCN, nvptx we now get: +configure:16060: checking for atomic builtins for _Atomic_word +[...] +configure:16073: result: yes ..., and thus may revert the 'atomicity_

[PUSHED] nvptx: Support '-march=sm_61'

2025-05-12 Thread Thomas Schwinge
gcc/ * config/nvptx/nvptx-sm.def: Add '61'. * config/nvptx/nvptx-gen.h: Regenerate. * config/nvptx/nvptx-gen.opt: Likewise. * config/nvptx/nvptx.cc (first_ptx_version_supporting_sm): Adjust. * config/nvptx/nvptx.opt (-march-map=sm_61, -march-map=sm_62

[PUSHED] GCN, nvptx offloading: Restrain 'WARNING: program timed out.' while in 'dynamic_cast'" [PR119692]

2025-05-12 Thread Thomas Schwinge
PR target/119692 libgomp/ * testsuite/libgomp.c++/pr119692-1-4.C: '{ dg-timeout 10 }'. * testsuite/libgomp.c++/pr119692-1-5.C: Likewise. * testsuite/libgomp.c++/target-exceptions-bad_cast-1.C: Likewise. * testsuite/libgomp.c++/target-exceptions-bad_ca

[PATCH v2 3/3] libstdc++: Renamed bits/move_only_function.h to bits/funcwrap.h [PR119125]

2025-05-12 Thread Tomasz Kamiński
The file now includes copyable_function in addition to move_only_function. PR libstdc++/119125 libstdc++-v3/ChangeLog: * include/bits/move_only_function.h: Move to... * include/bits/funcwrap.h: ...here. * doc/doxygen/stdheader.cc (init_map): Replaced move_only_func

[PATCH v2 7/8] RISC-V: Drop riscv_ext_version_table in favor of riscv_ext_info_t data

2025-05-12 Thread Kito Cheng
This commit drops the riscv_ext_version_table and instead uses the riscv_ext_info_t data structure to provide the version information for RISC-V extensions. gcc/ChangeLog: * common/config/riscv/riscv-common.cc (riscv_ext_version_table): Remove. (standard_extensions_p): Use

[PATCH v2 1/8] RISC-V: Introduce riscv-ext*.def to define extensions

2025-05-12 Thread Kito Cheng
Adding a new ISA extension to RISC-V GCC requires modifying several places: 1. riscv_ext_version_table for the extension version. 2. riscv.opt for the target option and variable. 3. riscv_ext_flag_table to bind the extension to its target option. 4. riscv_combine_info if this extension is just a ma

[PATCH v2 2/8] RISC-V: Use riscv-ext.def to generate target options and variables

2025-05-12 Thread Kito Cheng
Leverage the centralized riscv-ext.def definitions to auto-generate the target option parsing and associated internal flags, replacing manual listings in riscv.opt; `riscv_ext_flag_table` part will remove in later patch. gcc/ChangeLog: * config/riscv/gen-riscv-ext-opt.cc: New. * c

[PATCH v2 3/8] RISC-V: Generate extension table in documentation from riscv-ext.def

2025-05-12 Thread Kito Cheng
Automatically build the ISA extension reference table in invoke.texi from the unified riscv-ext.def metadata, ensuring documentation stays in sync with extension definitions and reducing manual maintenance. gcc/ChangeLog: * doc/invoke.texi: Replace hand‑written extension table with

[PATCH v2 4/8] RISC-V: Adjust riscv_can_inline_p

2025-05-12 Thread Kito Cheng
We don't hold any extenison flags in `target_flags`, so no need to gather the extenison flags in `target_flags`. gcc/ChangeLog: * common/config/riscv/riscv-common.cc (riscv_can_inline_p): Drop extension flags check from `target_flags`. * config/riscv/riscv-subset.h (riscv_

[PATCH] libiberty: Fix off-by-one when collecting range expression

2025-05-12 Thread Andreas Schwab
Fixes this error during build of fixincludes: In function ‘byte_regex_compile’, inlined from ‘xregcomp’ at ../libiberty/../../libiberty/regex.c:7973:11: ../libiberty/../../libiberty/regex.c:3477:29: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] 3477 |

[PATCH v2 6/8] RISC-V: Drop riscv_implied_info and riscv_combine_info in favor of riscv_ext_info_t data

2025-05-12 Thread Kito Cheng
Consolidate implied-extension logic by removing the old `riscv_implied_info` array and using the `implied_exts` field in the unified riscv_ext_info_t structures generated from `riscv-ext.def`. gcc/ChangeLog: * common/config/riscv/riscv-common.cc (riscv_implied_info::riscv_implied_

  1   2   >