[PATCH] tree-optimization/115494 - PRE PHI translation and ranges

2025-01-16 Thread Richard Biener
When we PHI translate dependent expressions we keep SSA defs in place of the translated expression in case the expression itself did not change even though it's context did and thus the validity of ranges associated with it. That eventually leads to simplification errors given we violate the preco

Re: [PATCH v4] AArch64: Add LUTI ACLE for SVE2

2025-01-16 Thread Richard Sandiford
Thanks for the update. Mostly LGTM, but some comments below: writes: > diff --git a/gcc/config/aarch64/aarch64-sve2.md > b/gcc/config/aarch64/aarch64-sve2.md > index f8cfe08f4c0..0a1dc314f94 100644 > --- a/gcc/config/aarch64/aarch64-sve2.md > +++ b/gcc/config/aarch64/aarch64-sve2.md > @@ -133,6

Re: [PATCH v5 1/2] [APX CFCMOV] Support APX CFCMOV in if_convert pass

2025-01-16 Thread Richard Sandiford
Hongyu Wang writes: > From: Lingling Kong > > Hi, > > Appreciated to Richard's review, the v5 patch contaings below change: > > 1. Separate the maskload/maskstore emit out from noce_emit_cmove, add > a new function emit_mask_load_store in optabs.cc. > 2. Follow the operand order of maskload and m

Re: [PATCH] LoongArch: Add alsl.wu

2025-01-16 Thread Lulu Cheng
LGTM! Thanks! 在 2025/1/15 下午6:09, Xi Ruoyao 写道: On 64-bit capable LoongArch hardware, alsl.wu is similar to alsl.w but zero-extending the 32-bit result. gcc/ChangeLog: * config/loongarch/loongarch.md (alslsi3_extend): Add alsl.wu. gcc/testsuite/ChangeLog: * gcc.target/loonga

Re: [committed] libstdc++: Implement LWG 2937 for std::filesystem::equivalent [PR118158]

2025-01-16 Thread Jonathan Wakely
On Thu, 16 Jan 2025 at 09:50, Jonathan Wakely wrote: > > Do not report an error for (is_other(s1) && is_other(s2)) as the > standard originally said, nor for (is_other(s1) || is_other(s2)) as > libstdc++ was doing. We can compare inode numbers for special files and > so give sensible answers. > >

Re: [PATCH v5 1/4] RISC-V: Add Zicfiss ISA extension.

2025-01-16 Thread Kito Cheng
LGTM for the V5 series :) On Thu, Jan 16, 2025 at 4:13 PM Monk Chiang wrote: > > This patch is implemented according to the RISC-V CFI specification. > It supports the generation of shadow stack instructions in the prologue, > epilogue, non-local gotos, and unwinding. > > RISC-V CFI SPEC: https:

Re: [PATCH v6 6/6] OpenMP: Update documentation of metadirective implementation status.

2025-01-16 Thread Tobias Burnus
Hi Sandra, Sandra Loosemore: libgomp/ChangeLog * libgomp.texi (OpenMP 5.0): Mark metadirective and declare variant as implemented. (OpenMP 5.1): Mark target_device as supported. Add changed interaction between declare target and OpenMP context and dynamic

[wwwdocs, pushed] Document libstdc++ headers that are deprecated in GCC 15

2025-01-16 Thread Jonathan Wakely
Pushed to wwwdocs. --- htdocs/gcc-15/porting_to.html | 11 +++ 1 file changed, 11 insertions(+) diff --git a/htdocs/gcc-15/porting_to.html b/htdocs/gcc-15/porting_to.html index c446e309..2bc0d4e5 100644 --- a/htdocs/gcc-15/porting_to.html +++ b/htdocs/gcc-15/porting_to.html @@ -155,6 +15

[wwwdocs, pushed] Document dependency changes for libstdc++ header

2025-01-16 Thread Jonathan Wakely
Pushed to wwwdocs. --- htdocs/gcc-15/porting_to.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/gcc-15/porting_to.html b/htdocs/gcc-15/porting_to.html index 2bc0d4e5..b9b2efc7 100644 --- a/htdocs/gcc-15/porting_to.html +++ b/htdocs/gcc-15/porting_to.html @@ -153,6 +153,9 @@ may

[PATCH] libstdc++: Handle exceptions in std::ostream::sentry destructor

2025-01-16 Thread Jonathan Wakely
Because basic_ostream::sentry::~sentry is implicitly noexcept, we can't let any exceptions escape from it, or the program would terminate. If the streambuf's sync() function throws, or if it returns an error and setting badbit in the stream state throws, then the program would terminate. LWG 835 i

Re: [PATCH] MIPS: Add conditions for use of the -mmips16e2 and -mips16 option.

2025-01-16 Thread Maciej W. Rozycki
On Thu, 16 Jan 2025, Jie Mei wrote: > Make -mmips16e2 imply -mips16 as the ASE requires, so users won't > be surprised even if they expect it to. Meanwhile, check if > mips_isa_rev <= 5 when -mips16 is effective and >= 1 when -mmips16e2 > is effective. MIPSr1 is incompatible with MIPS16e2, and t

Re: [PATCH 09/11] aarch64: Rewrite architecture strings for assembler

2025-01-16 Thread Richard Sandiford
Andrew Carlotti writes: > Add infrastructure to allow rewriting the architecture strings passed to > the assembler (either as -march options or .arch directives). There was > already canonicalisation everywhere except for an -march driver option > passed directly to the compiler; this patch appli

Re: [PATCH 09/11] aarch64: Rewrite architecture strings for assembler

2025-01-16 Thread Richard Sandiford
Andrew Carlotti writes: > @@ -697,6 +697,50 @@ aarch64_get_extension_string_for_isa_flags > + const struct arch_info *entry; > + for (entry = all_architectures; entry->arch != aarch64_no_arch; entry++) > +{ > + if (entry->arch == arch) > + break; > +} Sorry for the nit, but for

[PUSHED] [OpenACC/Fortran testsuite] Use relative line numbers for a few DejaGnu directives

2025-01-16 Thread Thomas Schwinge
From: Thomas Schwinge For easier maintenance. gcc/testsuite/ * gfortran.dg/goacc/assumed.f95: Use relative line numbers for a few DejaGnu directives. * gfortran.dg/goacc/list.f95: Likewise. * gfortran.dg/goacc/loop-1-2.f95: Likewise. * gfortran.dg/

Re: [PATCH 10/11] aarch64: Refactor aarch64_rewrite_mcpu

2025-01-16 Thread Richard Sandiford
Andrew Carlotti writes: > Use aarch64_validate_cpu instead of the existing duplicate (and worse) > version of the -mcpu parsing code. > > The original code used fatal_error; I'm guessing that using error > instead should be ok. > > gcc/ChangeLog: > > * common/config/aarch64/aarch64-common.cc

Re: [PATCH] LoongArch: Fix cost model for alsl

2025-01-16 Thread Lulu Cheng
在 2025/1/16 下午8:59, Xi Ruoyao 写道: On Thu, 2025-01-16 at 20:52 +0800, Xi Ruoyao wrote: On Thu, 2025-01-16 at 20:30 +0800, Lulu Cheng wrote: 在 2025/1/15 下午6:10, Xi Ruoyao 写道: diff --git a/gcc/config/loongarch/loongarch.cc b/gcc/config/loongarch/loongarch.cc index 9d97f0216f0..3a8e1297bd3 1006

Re: [PATCH] c++: Make sure fold_sizeof_expr returns the correct type [PR117775]

2025-01-16 Thread Simon Martin
Hi Jakub, Jason, On 15 Jan 2025, at 22:55, Jakub Jelinek wrote: > On Wed, Jan 15, 2025 at 04:48:59PM -0500, Jason Merrill wrote: >>> --- a/gcc/cp/decl.cc >>> +++ b/gcc/cp/decl.cc >>> @@ -11686,6 +11686,7 @@ fold_sizeof_expr (tree t) >>> false, false); >>> if (r

Re: [PATCH] LoongArch: Fix cost model for alsl

2025-01-16 Thread Xi Ruoyao
On Thu, 2025-01-16 at 20:52 +0800, Xi Ruoyao wrote: > On Thu, 2025-01-16 at 20:30 +0800, Lulu Cheng wrote: > > > > 在 2025/1/15 下午6:10, Xi Ruoyao 写道: > > > diff --git a/gcc/config/loongarch/loongarch.cc > > > b/gcc/config/loongarch/loongarch.cc > > > index 9d97f0216f0..3a8e1297bd3 100644 > > > ---

[PATCH]middle-end: Add early break conditions to vect-switch-search-line-fast.c [PR118451]

2025-01-16 Thread Tamar Christina
Hi All, When this test was added initially it didn't add the early break effective target tests. This means that the test was "passing" (as in, it was failing to vectorize) because many targets don't support early break. But the test should not have been run for these targets. When the vectoriz

Re: [PATCH]middle-end: Add early break conditions to vect-switch-search-line-fast.c [PR118451]

2025-01-16 Thread Richard Biener
On Thu, 16 Jan 2025, Tamar Christina wrote: > Hi All, > > When this test was added initially it didn't add the early break effective > target tests. > > This means that the test was "passing" (as in, it was failing to vectorize) > because many targets don't support early break. > > But the test

[committed v2] libstdc++: Move std::basic_ostream to new internal header [PR99995]

2025-01-16 Thread Jonathan Wakely
This adds so that other headers don't need to include all of , which pulls in all of since C++23 (for the std::print and std::println overloads in ). This new header allows the constrained operator<< in to be defined without all of std::format being compiled. We could also replace with in all

Re: [PATCH 11/11] aarch64: Make AARCH64_FL_CRYPTO always unset

2025-01-16 Thread Richard Sandiford
Andrew Carlotti writes: > This feature flag bit only exists to support the +crypto alias. Outside > of option processing this bit needs to be set or unset consistently. > This patch goes with the latter option. > > gcc/ChangeLog: > > * common/config/aarch64/aarch64-common.cc: Assert that CR

[PATCH] arm: [MVE] Fix predicates for vec_cmp, vec_vcmpu and vcond_mask (PR 115439)

2025-01-16 Thread Christophe Lyon
When compiling c-c++-common/vector-compare-3.c with -march=armv8.1-m.main+mve+fp.dp -mfloat-abi=hard -mfpu=auto (which enables MVE), we fail to match vcond_mask because operand 3 has s_register_operand as predicate for a MVE_VPRED mode, but we try to match: (insn 26 25 27 2 (set (reg:V4SI 137)

Re: [PATCH] tailc, v2: Virtually undo IPA-VRP return value optimization for tail calls [PR118430]

2025-01-16 Thread Richard Biener
On Wed, 15 Jan 2025, Jakub Jelinek wrote: > On Wed, Jan 15, 2025 at 03:16:04PM +0100, Richard Biener wrote: > > > + /* If IPA-VRP proves called function always returns a singleton > > > range, > > > + the return value is replaced by the only value in that range. > > > + For tail call purpo

[PATCH v5 1/4] RISC-V: Add Zicfiss ISA extension.

2025-01-16 Thread Monk Chiang
This patch is implemented according to the RISC-V CFI specification. It supports the generation of shadow stack instructions in the prologue, epilogue, non-local gotos, and unwinding. RISC-V CFI SPEC: https://github.com/riscv/riscv-cfi gcc/ChangeLog: * common/config/riscv/riscv-common.cc:

[PATCH v5 3/4] RISC-V: Add .note.gnu.property for ZICFILP and ZICFISS ISA extension

2025-01-16 Thread Monk Chiang
gcc/ChangeLog: * gcc/config/riscv/riscv.cc (riscv_file_end_indicate_exec_stack): Add .note.gnu.property. * gcc/config/riscv/linux.h (TARGET_ASM_FILE_END): Define. libgcc/ChangeLog: * libgcc/config/riscv/crti.S: Add lpad instructions. * libgcc/config/riscv/cr

[PATCH v5 2/4] RISC-V: Add Zicfilp ISA extension.

2025-01-16 Thread Monk Chiang
This patch only support landing pad value is 0. The next version will implement function signature based labeling scheme. RISC-V CFI SPEC: https://github.com/riscv/riscv-cfi gcc/ChangeLog: * gcc/common/config/riscv/riscv-common.cc: Add ZICFILP ISA string. * gcc/config.gc

[PATCH v5 4/4] RISC-V: Add -fcf-protection=[full|branch|return] to enable zicfiss, zicfilp.

2025-01-16 Thread Monk Chiang
gcc/ChangeLog: * gcc/config/riscv/riscv.cc (is_zicfilp_p): New function. (is_zicfiss_p): New function. * gcc/config/riscv/riscv-zicfilp.cc: Update. * gcc/config/riscv/riscv.h: Update. * gcc/config/riscv/riscv.md: Update. gcc/testsuite/ChangeLog:

Re: [PATCH v3] AArch64: Add LUTI ACLE for SVE2

2025-01-16 Thread Richard Sandiford
Saurabh Jha writes: > On 1/8/2025 11:13 AM, Richard Sandiford wrote: >> writes: >>> [...] >>> diff --git a/gcc/config/aarch64/aarch64-sve-builtins-sve2.def >>> b/gcc/config/aarch64/aarch64-sve-builtins-sve2.def >>> index e726fa1fb68..0c4f8251ac0 100644 >>> --- a/gcc/config/aarch64/aarch64-sve-bu

Re: [PATCH v3 0/4] Hard Register Constraints

2025-01-16 Thread Stefan Schulze Frielinghaus
On Wed, Jan 15, 2025 at 10:29:03PM -0700, Jeff Law wrote: > > > On 11/29/24 2:15 AM, Stefan Schulze Frielinghaus wrote: > > Ping. > > > > On Fri, Oct 25, 2024 at 11:57:16AM +0200, Stefan Schulze Frielinghaus wrote: > > > This is a follow-up to > > > https://gcc.gnu.org/pipermail/gcc-patches/2024

Re: [EXTERNAL] Re: [PATCH] Fix setting of call graph node AutoFDO count [PR116743]

2025-01-16 Thread Richard Biener
On Thu, Jan 16, 2025 at 3:17 AM Eugene Rozenfeld wrote: > > I committed the patch to trunk. Is it ok to backport to gcc-12, gcc-13, and > gcc-14? Yes. > -Original Message- > From: Richard Biener > Sent: Monday, January 13, 2025 11:22 PM > To: Eugene Rozenfeld > Cc: GCC-Patches-ML ; Ja

[committed] libstdc++: Check feature test macro for associative container node extraction

2025-01-16 Thread Jonathan Wakely
Replace some `__cplusplus > 201402L` preprocessor checks with more expressive checks for the appropriate feature test macro. libstdc++-v3/ChangeLog: * include/bits/stl_map.h: Check __glibcxx_node_extract instead of __cplusplus. * include/bits/stl_multimap.h: Likewise.

[committed] libstdc++: Implement LWG 2937 for std::filesystem::equivalent [PR118158]

2025-01-16 Thread Jonathan Wakely
Do not report an error for (is_other(s1) && is_other(s2)) as the standard originally said, nor for (is_other(s1) || is_other(s2)) as libstdc++ was doing. We can compare inode numbers for special files and so give sensible answers. libstdc++-v3/ChangeLog: PR libstdc++/118158 * src/

[PATCH] libstdc++: fix possible undefined std::timespec in module std

2025-01-16 Thread yxj-github-437
I notice std::timespec and std::timespec_get are used in preprocessor condition _GLIBCXX_HAVE_TIMESPEC_GET. So in module std, it should be the same. libstdc++-v3: * src/c++23/std-clib.cc.in: move std::timespec in preprocessor condition _GLIBCXX_HAVE_TIMESPEC_GET --- libstdc++-v3/s

Re: [PATCH] c++: Make sure fold_sizeof_expr returns the correct type [PR117775]

2025-01-16 Thread Jason Merrill
On 1/16/25 10:25 AM, Simon Martin wrote: On 16 Jan 2025, at 16:05, Jason Merrill wrote: On 1/16/25 7:19 AM, Simon Martin wrote: Hi Jakub, Jason, On 15 Jan 2025, at 22:55, Jakub Jelinek wrote: On Wed, Jan 15, 2025 at 04:48:59PM -0500, Jason Merrill wrote: --- a/gcc/cp/decl.cc +++ b/gcc/cp/d

Re: [PATCH]AArch64: have -mcpu=native detect architecture extensions for unknown non-homogenous systems [PR113257]

2025-01-16 Thread Richard Sandiford
Tamar Christina writes: >> -Original Message- >> From: Richard Sandiford >> Sent: Thursday, January 16, 2025 7:11 AM >> To: Tamar Christina >> Cc: gcc-patches@gcc.gnu.org; nd ; Richard Earnshaw >> ; ktkac...@gcc.gnu.org >> Subject: Re: [PATCH]AArch64: have -mcpu=native detect architectur

Re: [PATCH] c++: Change c++2b and gnu++2b to c++23 and gnu++23 in C++ diagnostics

2025-01-16 Thread Jason Merrill
On 1/15/25 4:31 PM, Jakub Jelinek wrote: Hi! This is something we should have done when -std=c++23 was made the primary option and -std=c++2b turned into undocumented alias. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? OK. 2025-01-15 Jakub Jelinek gcc/cp/

Re: [PATCH] wwwdocs: experiments with a Python postprocessing script

2025-01-16 Thread David Malcolm
On Thu, 2025-01-16 at 22:58 +0800, Gerald Pfeifer wrote: > On Wed, 15 Jan 2025, David Malcolm wrote: > > The heading elements in our website contain "id" information, > > but currently to find them you to look at the page source, > > whereas in the generated HTML for the manual we have e.g.: > > >

Re: [PATCH] c++, v2: Fix up reshape_* RAW_DATA_CST handling [PR118214]

2025-01-16 Thread Jason Merrill
On 1/15/25 4:29 PM, Jakub Jelinek wrote: On Wed, Jan 15, 2025 at 10:27:56AM -0500, Jason Merrill wrote: @@ -7432,12 +7426,18 @@ reshape_init_r (tree type, reshape_iter { vec *v = 0; CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, init); - tree raw_init = cp_maybe_split_

[Patch] Fortran/OpenMP: Fix declare_variant's 'adjust_args' mishandling with return by reference [PR118321]

2025-01-16 Thread Tobias Burnus
For declare_variant's 'adjust_args', the arguments for need_device_ptr are referenced by argument number. This patch fixes that calculation if hidden arguments due to return-by-reference calling exist. Note: It only fixes the Fortran issue; the C++ issue still needs to be fixed. Build + regteste

[PATCH] Fix uniqueness of symtab_node::get_dump_name.

2025-01-16 Thread Michal Jires
symtab_node::get_dump_name uses node order to identify nodes. Order is no longer unique because of Incremental LTO patches. This patch moves uid from cgraph_node node to symtab_node, so get_dump_name can use uid instead and get back unique dump names. In inlining passes, uid is replaced with more

[patch,avr] Use INT_N to built-in define __int24.

2025-01-16 Thread Georg-Johann Lay
This patch uses the INT_N interface to define __int24. Ok for trunk? Johann -- AVR: Use INT_N to built-in define __int24. This patch uses the INT_N interface to define __int24 in avr-modes.def. Since the testsuite uses -Wpedantic and __int24 is a C/C++ extension, uses of __int24 and __uint24

Re: Ping: [PATCH] d,ada/spec: only sub nostd{inc,lib} rather than nostd{inc,lib}*

2025-01-16 Thread Iain Buclaw
Excerpts from Arsen Arsenović's message of Oktober 7, 2024 11:31 pm: > Ping on this patch. > Thanks, this is OK for D. Note, that the gdc driver does try to accomodate for mixing C++ and D code in the same application - so given: gdc a.d b.cc It adds -lstdc++ to the link command for conve

RE: [RFC] PR81358: Enable automatic linking of libatomic

2025-01-16 Thread Prathamesh Kulkarni
> -Original Message- > From: Prathamesh Kulkarni > Sent: 10 January 2025 09:48 > To: Thomas Schwinge > Cc: Tobias Burnus ; Joseph Myers > ; Xi Ruoyao ; Matthew > Malcomson ; gcc-patches@gcc.gnu.org; Tom de > Vries > Subject: RE: [RFC] PR81358: Enable automatic linking of libatomic > >

[committed] d: Add testcase for fixed PR116373

2025-01-16 Thread Iain Buclaw
Hi, This patch adds a testcase for a PR that was fixed in upstream, and merged in r15-6559-g332cf038fda109. Regression tested on x86_64-linux-gnu, and committed to mainline. Regards, Iain. --- PR d/116373 gcc/testsuite/ChangeLog: * gdc.dg/pr116373.d: New test. --- gcc/testsui

Re: [PATCH] rs6000: Fix ICE for invalid constants in built-in functions

2025-01-16 Thread Peter Bergner
On 1/13/25 3:59 PM, Peter Bergner wrote: > rs6000: Fix ICE for invalid constants in built-in functions > > For invalid constant operand values used in built-in functions, return > const0_rtx to signify an error occurred during expansion. > > Bootstrapped and retested on powerlc64le-linux with no

Re: [PATCH] rs6000: Fix loop limit for built-in constant checking

2025-01-16 Thread Peter Bergner
On 1/10/25 11:18 AM, Peter Bergner wrote: > The loop checking for built-in constant operand restrictions was missing > some operands due to the loop limit being too small. Fixing that exposed > a testsuite failure which is caused by a typo in the pmxvi4ger8pp definition > where we had made the PMA

[GCC-14][committed] d: Fix ICE in dmd.expressionsem.resolveLoc

2025-01-16 Thread Iain Buclaw
Hi, This patch backports the individual fix for PR116373 from the upstream merge in r15-6559-g332cf038fda109 into the releases/gcc-14 branch. Bootstrapped and regression tested on x86_64-linux-gnu/-m32, and committed to branch. Regards, Iain. --- PR d/116373 gcc/d/ChangeLog: *

Re: [PATCH v6 0/6] Remaining patches for metadirectives/dynamic selectors

2025-01-16 Thread Sandra Loosemore
On 1/14/25 20:38, Sandra Loosemore wrote: I've incorporated a fix for Tobias's recent comment about recognizing C_OMP_DIR_META in the "assumes" directive in the C and C++ front ends, but I've deferred fixing the wording of the existing error message because it affects a pile of testcases unrelate

Re: [PATCH v3 1/2] RISC-V: Update Xsfvfnrclip implementation.

2025-01-16 Thread Kito Cheng
committed, thanks :) On Fri, Dec 13, 2024 at 8:39 PM Jiawei wrote: > > Update implementation of Xsfvfnrclip, using return type as iterator. > > gcc/ChangeLog: > > * config/riscv/genrvv-type-indexer.cc (expand_floattype): New func. > (main): New type. > * config/riscv/riscv

Re: [PATCH v3 2/2] RISC-V: Update Xsfvqmacc and Xsfvfnrclip's testcases

2025-01-16 Thread Kito Cheng
committed, thanks :) On Fri, Dec 13, 2024 at 8:39 PM Jiawei wrote: > > From: Liao Shihua > > Update Sifive Xsfvqmacc and Xsfvfnrclip extension's testcases. > > version log: > Update synchronize LMUL settings with return type. > > gcc/ChangeLog: > > * config/riscv/vector.md: New a

Honor dump options for C/C++ '-fdump-tree-original'

2025-01-16 Thread Thomas Schwinge
Hi! I have noticed that '-fdump-tree-original-lineno' for Fortran (for example) does dump location information, but for C/C++ it does not. The reason is that Fortran (and other front ends) use code like: /* Output the GENERIC tree. */ dump_function (TDI_original, fndecl); ..., but 'gcc/

Re: [PATCH] wwwdocs: experiments with a Python postprocessing script

2025-01-16 Thread Gerald Pfeifer
On Wed, 15 Jan 2025, David Malcolm wrote: > The heading elements in our website contain "id" information, > but currently to find them you to look at the page source, > whereas in the generated HTML for the manual we have e.g.: > > ¶ > > which shows up nicely in the browser in e.g. > https://

Re: [PATCH] c++: Make sure fold_sizeof_expr returns the correct type [PR117775]

2025-01-16 Thread Jason Merrill
On 1/16/25 7:19 AM, Simon Martin wrote: Hi Jakub, Jason, On 15 Jan 2025, at 22:55, Jakub Jelinek wrote: On Wed, Jan 15, 2025 at 04:48:59PM -0500, Jason Merrill wrote: --- a/gcc/cp/decl.cc +++ b/gcc/cp/decl.cc @@ -11686,6 +11686,7 @@ fold_sizeof_expr (tree t)

RE: [PATCH]AArch64: have -mcpu=native detect architecture extensions for unknown non-homogenous systems [PR113257]

2025-01-16 Thread Tamar Christina
> -Original Message- > From: Richard Sandiford > Sent: Thursday, January 16, 2025 7:11 AM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; nd ; Richard Earnshaw > ; ktkac...@gcc.gnu.org > Subject: Re: [PATCH]AArch64: have -mcpu=native detect architecture extensions > for unknown non-h

Re: [PATCH] LoongArch: Fix cost model for alsl

2025-01-16 Thread Lulu Cheng
在 2025/1/15 下午6:10, Xi Ruoyao 写道: diff --git a/gcc/config/loongarch/loongarch.cc b/gcc/config/loongarch/loongarch.cc index 9d97f0216f0..3a8e1297bd3 100644 --- a/gcc/config/loongarch/loongarch.cc +++ b/gcc/config/loongarch/loongarch.cc @@ -3929,14 +3929,31 @@ loongarch_rtx_costs (rtx x, machine

Re: [PATCH] LoongArch: Fix cost model for alsl

2025-01-16 Thread Xi Ruoyao
On Thu, 2025-01-16 at 20:30 +0800, Lulu Cheng wrote: > > 在 2025/1/15 下午6:10, Xi Ruoyao 写道: > > diff --git a/gcc/config/loongarch/loongarch.cc > > b/gcc/config/loongarch/loongarch.cc > > index 9d97f0216f0..3a8e1297bd3 100644 > > --- a/gcc/config/loongarch/loongarch.cc > > +++ b/gcc/config/loongarc

Re: [PATCH] c++: Make sure fold_sizeof_expr returns the correct type [PR117775]

2025-01-16 Thread Simon Martin
On 16 Jan 2025, at 16:05, Jason Merrill wrote: > On 1/16/25 7:19 AM, Simon Martin wrote: >> Hi Jakub, Jason, >> >> On 15 Jan 2025, at 22:55, Jakub Jelinek wrote: >> >>> On Wed, Jan 15, 2025 at 04:48:59PM -0500, Jason Merrill wrote: > --- a/gcc/cp/decl.cc > +++ b/gcc/cp/decl.cc > @@ -11

Re: [PATCH] c++: 'this' capture clobbered during recursive inst [PR116756]

2025-01-16 Thread Patrick Palka
On Mon, 13 Jan 2025, Jason Merrill wrote: > On 1/10/25 2:20 PM, Patrick Palka wrote: > > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look > > OK for trunk? > > > > The documentation for LAMBDA_EXPR_THIS_CAPTURE seems outdated because > > it says the field is only used at parse ti

Re: PING **(6./7.): [patch, Fortran] -fc-prototypes fixes.

2025-01-16 Thread Thomas Koenig
Am 16.01.25 um 01:50 schrieb Jerry D: Yes I think this is OK, a definite improvement. Committed as r15-6967. Thanks for the review! Best regards Thomas

[pushed]PR118067][LRA]: Use the right mode to evaluate secondary memory reload

2025-01-16 Thread Vladimir Makarov
The following patch solves https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118067 The patch was successfully tested and bootstrapped on x86_64, aarch64, and ppc64le. commit d9835825b3d7193b3d6669174f4386be2cb1 Author: Vladimir N. Makarov Date: Thu Jan 16 12:17:31 2025 -0500 [PR118067

Re: [PATCH] [testsuite] rearrange requirements for dfp bitint run tests

2025-01-16 Thread Alexandre Oliva
On Jan 10, 2025, Alexandre Oliva wrote: > dfp.exp sets the default to compile when dfprt is not available, but > some dfp bitint tests override the default without that requirement, > and try to run even when dfprt is not available. > Instead of overriding the default, rewrite the requirements s

[PATCH] libfortran: fix conversion of UNSIGNED(kind=16) to decimal in output [PR118406]

2025-01-16 Thread Harald Anlauf
Dear all, the conversion of (unsigned) integers to decimal in output was designed to be efficient up to INTEGER(kind=16) and did not handle values larger than roughly (10^19 * 2^64). The attached obvious patch fixes this. Regtested on x86_64-pc-linux-gnu. OK for mainline? Thanks, Harald From

[PATCH #2/2] [testsuite] drop explicit run overrider in more dfp tests

2025-01-16 Thread Alexandre Oliva
A few more dfp tests that recently got backported to gcc-14 override dfp.exp's selection of default action depending on dfprt. Let the default stand. This is a followup of the patch I've just pinged. Regstrapped on x86_64-linux-gnu, also tested on arm-eabi and aarch64-elf. Ok to install? fo

Re: [PATCH] libfortran: fix conversion of UNSIGNED(kind=16) to decimal in output [PR118406]

2025-01-16 Thread Thomas Koenig
Hello Harald, the conversion of (unsigned) integers to decimal in output was designed to be efficient up to INTEGER(kind=16) and did not handle values larger than roughly (10^19 * 2^64). The attached obvious patch fixes this. Regtested on x86_64-pc-linux-gnu.  OK for mainline? OK. Thanks a

[PATCH] [testsuite] skip test on non-hosted libstdc++ [PR113994]

2025-01-16 Thread Alexandre Oliva
Tests that include need to be skipped when libstdc++ is built in freestanding mode. for gcc/testsuite/ChangeLog PR rtl-optimization/113994 * g++.dg/pr113994.C: Require hosted libstdc++. --- gcc/testsuite/g++.dg/torture/pr113994.C |1 + 1 file changed, 1 insertion(+) dif

Re: [PATCH] wwwdocs: experiments with a Python postprocessing script

2025-01-16 Thread David Malcolm
On Thu, 2025-01-16 at 22:58 +0800, Gerald Pfeifer wrote: > On Wed, 15 Jan 2025, David Malcolm wrote: > > The heading elements in our website contain "id" information, > > but currently to find them you to look at the page source, > > whereas in the generated HTML for the manual we have e.g.: > > >

[PATCH] [testsuite] [arm] adjust wmul expectations [PR113560]

2025-01-16 Thread Alexandre Oliva
Since the machine-independent widening multiply logic was improved PR113560, ARM's wmul-[567].c fail. AFAICT the logic takes advantage of the fact that, after zero-extending a narrow integral type to a wider type, further zero- or sign-extending is equivalent, which enables different instruction

Re: [PATCH] MIPS: Add conditions for use of the -mmips16e2 and -mips16 option.

2025-01-16 Thread Rong Zhang
On Thu, 2025-01-16 at 11:41 +, Maciej W. Rozycki wrote: > On Thu, 16 Jan 2025, Jie Mei wrote: > > > Make -mmips16e2 imply -mips16 as the ASE requires, so users won't > > be surprised even if they expect it to. Meanwhile, check if > > mips_isa_rev <= 5 when -mips16 is effective and >= 1 when -m

Re: [PATCH] i386: Fix wrong insn generated by shld/shrd ndd split [PR118510]

2025-01-16 Thread Uros Bizjak
On Fri, Jan 17, 2025 at 4:38 AM Hongyu Wang wrote: > > Hi, > > For shld/shrd_ndd_2 insn, the spiltter outputs wrong pattern that > mixed parallel for clobber and set. Separate out the set to dest > from parallel to fix it. > > Bootstrapped & regtested on x86-64-pc-linux-gnu. > > Ok for trunk? > >

RE: [COMMITTED] OpenMP: Fix metadirective test failures on x86_64 with -m32

2025-01-16 Thread Jiang, Haochen
> From: Sandra Loosemore > Sent: Friday, January 17, 2025 12:11 PM > Thanks for the quick fix! Thx, Haochen > gcc/testsuite/ChangeLog > * c-c++-common/gomp/metadirective-device.c: Don't add extra > options > for target ia32. > * c-c++-common/gomp/metadirective-target-device-1

[COMMITTED] OpenMP: Fix metadirective test failures on x86_64 with -m32

2025-01-16 Thread Sandra Loosemore
gcc/testsuite/ChangeLog * c-c++-common/gomp/metadirective-device.c: Don't add extra options for target ia32. * c-c++-common/gomp/metadirective-target-device-1.c: Likewise. --- gcc/testsuite/c-c++-common/gomp/metadirective-device.c | 2 +- gcc/testsuite/c-c++-common

Re: [PATCH] c++: Friend classes don't shadow enclosing template class paramater [PR118255]

2025-01-16 Thread Simon Martin
On 17 Jan 2025, at 0:12, Jason Merrill wrote: > On 1/5/25 11:19 AM, Simon Martin wrote: >> We currently reject the following code >> >> === code here === >> template struct S { friend class non_template; }; >> class non_template {}; >> S<0> s; >> === code here === >> >> While EDG agrees with the

Re: [PATCH 2/2] LoongArch: Improve reassociation for bitwise operation and left shift [PR 115921]

2025-01-16 Thread Xi Ruoyao
于 2025年1月15日 GMT+08:00 下午6:12:34,Xi Ruoyao 写道: >For things like > >(x | 0x101) << 11 > >It's obvious to write: > >ori $r4,$r4,257 >slli.d $r4,$r4,11 > >But we are actually generating something insane: > >lu12i.w $r12,524288>>12 # 0x8 >

Re: [PATCH] tree-optimization/92539 - missed optimization leads to bogus -Warray-bounds

2025-01-16 Thread Richard Biener
On Wed, 15 Jan 2025, Richard Biener wrote: > The following makes niter analysis recognize a loop with an exit > condition scanning over a STRING_CST. This is done via enhancing > the force evaluation code rather than recognizing for example > strlen (s) as number of iterations because it allows t

[PATCH v3 1/2] RISC-V: Allocate the initial register in the expand phase for the vl of XTheadVector

2025-01-16 Thread Jin Ma
Since the parameter vl of XTheadVector does not support immediate numbers, we need to put it in the register in advance. That generates the initial code correctly. PR 116593 gcc/ChangeLog: * config/riscv/riscv-vector-builtins.cc (function_expander::add_input_operand): P

[PATCH v3 2/2] RISC-V: Add a new constraint to ensure that the vl of XTheadVector does not produce a non-zero immediate.

2025-01-16 Thread Jin Ma
Although we have handled the vl of XTheadVector correctly in the expand phase and predicates, the results show that the work is still insufficient. In the curr_insn_transform function, the insn is transformed from: (insn 69 67 225 12 (set (mem:RVVM8SF (reg/f:DI 218 [ _77 ]) [0 S[128, 128] A32])

[PATCH] i386: Fix wrong insn generated by shld/shrd ndd split [PR118510]

2025-01-16 Thread Hongyu Wang
Hi, For shld/shrd_ndd_2 insn, the spiltter outputs wrong pattern that mixed parallel for clobber and set. Separate out the set to dest from parallel to fix it. Bootstrapped & regtested on x86-64-pc-linux-gnu. Ok for trunk? gcc/ChangeLog: PR target/118510 * config/i386/i386.md (

Re: [PATCH] Fix uniqueness of symtab_node::get_dump_name.

2025-01-16 Thread Richard Biener
On Thu, 16 Jan 2025, Michal Jires wrote: > symtab_node::get_dump_name uses node order to identify nodes. > Order is no longer unique because of Incremental LTO patches. > This patch moves uid from cgraph_node node to symtab_node, > so get_dump_name can use uid instead and get back unique dump name

Re: [PATCH 2/2] match: Improve the `x ==/!= ~x` pattern [PR118483]

2025-01-16 Thread Richard Biener
On Fri, Jan 17, 2025 at 1:11 AM Andrew Pinski wrote: > > This improves this pattern by 2 ways: > * Allow for an optional convert, similar to how the few other > `a OP ~a` patterns also allow for an optional convert. > * Use bitwise_inverted_equal_p/maybe_bit_not instead of directly > matching

[GCC16 stage 1][RFC][C][PATCH 1/3] Extend "counted_by" attribute to pointer fields of structures.

2025-01-16 Thread Qing Zhao
For example: struct PP { size_t count2; char other1; char *array2 __attribute__ ((counted_by (count2))); int other2; } *pp; specifies that the "array2" is an array that is pointed by the pointer field, and its number of elements is given by the field "count2" in the same structure. gcc/c

[GCC16 stage 1][RFC][PATCH 0/3]extend "counted_by" attribute to pointer fields of structures

2025-01-16 Thread Qing Zhao
Hi, This is the patch set to extend "counted_by" attribute to pointer fields of structures. For example: struct PP { size_t count2; char other1; char *array2 __attribute__ ((counted_by (count2))); int other2; } *pp; specifies that the "array2" is an array that is pointed by the pointer

[GCC16 stage 1][RFC][PATCH 2/3] Convert a pointer reference with counted_by attribute to .ACCESS_WITH_SIZE and use it in builtinin-object-size.

2025-01-16 Thread Qing Zhao
gcc/c/ChangeLog: * c-typeck.cc (build_counted_by_ref): Handle pointers with counted_by. (build_access_with_size_for_counted_by): Likewise. gcc/ChangeLog: * tree-object-size.cc (access_with_size_object_size): Handle pointers with counted_by. (collect_object

[GCC16 stage 1][RFC][C][PATCH 3/3] Use the counted_by attribute of pointers in array bound checker.

2025-01-16 Thread Qing Zhao
Current array bound checker only instruments ARRAY_REF, and the INDEX information is the 2nd operand of the ARRAY_REF. When extending the array bound checker to pointer references with counted_by attributes, the hardest part is to get the INDEX of the corresponding array ref from the offset comput

Re: [GCC16 stage 1][RFC][PATCH 0/3]extend "counted_by" attribute to pointer fields of structures

2025-01-16 Thread Qing Zhao
> On Jan 16, 2025, at 17:29, Bill Wendling wrote: > > On Thu, Jan 16, 2025 at 1:19 PM Qing Zhao wrote: >> >> Hi, >> >> This is the patch set to extend "counted_by" attribute to pointer fields of >> structures. >> >> For example: >> >> struct PP { >> size_t count2; >> char other1; >> ch

Re: [GCC16 stage 1][RFC][PATCH 0/3]extend "counted_by" attribute to pointer fields of structures

2025-01-16 Thread Bill Wendling
On Thu, Jan 16, 2025 at 3:06 PM Qing Zhao wrote: > > On Jan 16, 2025, at 17:29, Bill Wendling wrote: > > > > On Thu, Jan 16, 2025 at 1:19 PM Qing Zhao wrote: > >> > >> Hi, > >> > >> This is the patch set to extend "counted_by" attribute to pointer fields > >> of structures. > >> > >> For exampl

RE: gcc mode switching issue (was Re: RISC-V round_away () handling of non canonical rounding modes)

2025-01-16 Thread Li, Pan2
Hi Vineet, Is there any more information about the issue description here? Like steps for reproducing, as well as expect behavior but actual result.. etc. It is not easy to start the investigation with blow mail thread. Thanks a lot. Pan -Original Message- From: Vineet Gupta Sent: Fri

Re: [PATCH 0/5] Add btf_decl_tag and btf_type_tag C attributes

2025-01-16 Thread Yonghong Song
On 10/30/24 11:31 AM, David Faust wrote: This patch series adds support for the btf_decl_tag and btf_type_tag attributes to GCC. This entails: - Two new C-family attributes that allow to associate (to "tag") particular declarations and types with arbitrary strings. As explained below, thi

Re: [PATCH v8] c++: Fix overeager Woverloaded-virtual with conversion operators [PR109918]

2025-01-16 Thread Jason Merrill
On 10/16/24 11:43 AM, Simon Martin wrote: As you know the patch had to be reverted due to PR117114, that highlighted a bunch of issues with comparing DECL_VINDEXes: it might give false positives in case of multiple inheritance (the case in PR117114), but also if there’s single inheritance by the

[PATCH] c++: fix wrong-code with constexpr prvalue opt [PR118396]

2025-01-16 Thread Marek Polacek
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- The recent r15-6369 unfortunately caused a bad wrong-code issue. Here we have TARGET_EXPR and call cp_fold_r -> maybe_constant_init with object=D.2996. In cxx_eval_outermost_constant_expr we now take the type of the object

gcc mode switching issue (was Re: RISC-V round_away () handling of non canonical rounding modes)

2025-01-16 Thread Vineet Gupta
On 1/16/25 15:07, Vineet Gupta wrote: > +CC Juzhe, Robin, gcc patches mailing list > > On 1/16/25 14:49, Andrew Waterman wrote: >> On Thu, Jan 16, 2025 at 11:43 AM Vineet Gupta wrote: >>> On 1/16/25 11:14, Joseph Myers wrote: The simple thing to do is to change sysdeps/riscv/rvf/get-rounding-

[PATCH] c++: Use mapped reads and writes when munmap and msync are available

2025-01-16 Thread John David Anglin
Tested on hppa64-hp-hpux11.11 and hppa-unknown-linux-gnu. Okay for trunk? Dave --- c++: Use mapped reads and writes when munmap and msync are available Module support is broken when MAPPED_READING and MAPPED_WRITING are defined to 0. This causes internal compiler errors in the permissive-error

Re: [PATCH] c++: bogus error with nested lambdas [PR117602]

2025-01-16 Thread Marek Polacek
On Wed, Jan 15, 2025 at 04:18:36PM -0500, Jason Merrill wrote: > On 1/15/25 12:55 PM, Marek Polacek wrote: > > On Wed, Jan 15, 2025 at 09:39:41AM -0500, Jason Merrill wrote: > > > On 11/15/24 9:08 AM, Marek Polacek wrote: > > > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > >

Re: [PATCH v3 3/6] c++: Fix ABI for lambdas declared in alias templates [PR116568]

2025-01-16 Thread Nathaniel Shead
On Thu, Jan 16, 2025 at 07:09:33PM -0500, Jason Merrill wrote: > On 1/6/25 7:22 AM, Nathaniel Shead wrote: > > I'm not 100% sure I've handled this properly, any feedback welcome. > > In particular, maybe should I use `DECL_IMPLICIT_TYPEDEF_P` in the > > mangling logic instead of `!TYPE_DECL_ALIAS_P

Re: [PATCH] libstdc++: Use string::push_back instead of string::operator+=

2025-01-16 Thread Aditya K
>> From db5036e40ed7ac43b66ca74c44ec8d0bdc934b07 Mon Sep 17 00:00:00 2001 >> From: AdityaK >> <1108430...@users.noreply.github.com> >> Date: Sun, 29 Dec 2024 18:14:29 -0800 >> Subject: [PATCH] libstdc++: Use string::push_back instead of >> string::opera

[PATCH V2] rs6000: Disassemble opaque modes using subregs to allow optimizations [PR109116]

2025-01-16 Thread Peter Bergner
Unfortunately I accidentally dropped this patch series without posting V2 after Kewen's patch review. :-( Here's V2 with the suggested changes made. Here is the thread from the V1 patch submission: https://inbox.sourceware.org/gcc-patches/1f32e2bf-83c2-4664-b7f3-4a6996978...@linux.ibm.com/ Chan

Re: [PATCH] c++: Relax checking assert about elision to support -fno-elide-constructors [PR114619]

2025-01-16 Thread Jason Merrill
On 10/19/24 5:09 AM, Simon Martin wrote: We currently ICE in checking mode with cxx_dialect < 17 on the following valid code === cut here === struct X { X(const X&) {} }; extern X x; void foo () { new X[1]{x}; } === cut here === The problem is that cp_gimplify_expr gcc_checking_asserts th

Re: [GCC16 stage 1][RFC][PATCH 0/3]extend "counted_by" attribute to pointer fields of structures

2025-01-16 Thread Bill Wendling
On Thu, Jan 16, 2025 at 1:19 PM Qing Zhao wrote: > > Hi, > > This is the patch set to extend "counted_by" attribute to pointer fields of > structures. > > For example: > > struct PP { > size_t count2; > char other1; > char *array2 __attribute__ ((counted_by (count2))); > int other2; > } *

[r15-6963 Regression] FAIL: c-c++-common/gomp/metadirective-target-device-1.c -std=c++98 scan-tree-dump-times optimized "GOMP_error" 0 on Linux/x86_64

2025-01-16 Thread haochen.jiang
On Linux/x86_64, fdeceba59bee60040fd58203b6fe0239d789eade is the first bad commit commit fdeceba59bee60040fd58203b6fe0239d789eade Author: Sandra Loosemore Date: Wed Jan 8 01:55:47 2025 + OpenMP: Shared metadirective/dynamic selector tests for C and C++ caused FAIL: c-c++-common/gomp/

Re: [PATCH] [testsuite] skip test on non-hosted libstdc++ [PR113994]

2025-01-16 Thread Mike Stump
On Jan 16, 2025, at 11:42 AM, Alexandre Oliva wrote: > > Tests that include need to be skipped when libstdc++ is built > in freestanding mode. Ok. > for gcc/testsuite/ChangeLog > > PR rtl-optimization/113994 > * g++.dg/pr113994.C: Require hosted libstdc++.

  1   2   >