Re: [PATCH] match.pd: Fix indefinite recursion during exp-log transformations [PR118490]

2025-01-19 Thread Richard Biener
On Mon, 20 Jan 2025, Soumya AR wrote: > This patch fixes the ICE caused when comparing log or exp of a constant with > another constant. > > The transform is now restricted to cases where the resultant > log/exp (CST) can be constant folded. OK. Richard. > Signed-off-by: Soumya AR > > gcc/Ch

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

2025-01-19 Thread Richard Biener
On Mon, 20 Jan 2025, Hongyu Wang wrote: > Thanks Richard for willing to review this part, it is true that the > try_cmove_arith logic adds quite a lot of special handling for > optimization, so I reduce the logic in emit_mask_load_store to just > generate most simple load/store that does not allow

Re: [PATCH] match: Change (A + CST0) * CST1 to (A + sign_extend(CST0)) * CST1 [PR116845]

2025-01-19 Thread Richard Biener
On Fri, 17 Jan 2025, Philipp Tomsich wrote: > Folks, > > we'd appreciate it if someone could take the time to review this fix > for PR116845. > > Thanks, > Philipp. > > > > On Tue, 31 Dec 2024 at 10:03, Konstantinos Eleftheriou > wrote: > > > > From: kelefth > > > > `(A * B) + (-C) to (B -

Re: [COMMITTED] Regenerate sparc.opt.urls

2025-01-19 Thread Eric Botcazou
> sparc added a -mvis3b option, but the sparc.opt.url file wasn't > regenerated. > > Fixes: d309844d6fe0 ("Fix bootstrap failure on SPARC with -O3 > -mcpu=niagara4") Thanks, but how is one supposed to detect this? Everything worked fine. -- Eric Botcazou

[committed] RISC-V: Add sifive_vector.h

2025-01-19 Thread Kito Cheng
sifive_vector.h is a vendor specfic header, it should include before using sifive vector intrinsic, it's just include riscv_vector.h for now, we will separate the implementation by adding new pragma in future. gcc/ChangeLog: * config.gcc (riscv*): Install sifive_vector.h. * config

[PATCH v2] RISC-V: Correct the mode that is causing the program to fail for XTheadCondMov

2025-01-19 Thread Jin Ma
For XTheadCondMov, the bit width of rs2 should always be XLEN-sized, otherwise the program logic will be wrong. Reference form https://github.com/XUANTIE-RV/thead-extension-spec/releases/download/2.3.0/xthead-2023-11-10-2.3.0.pdf Synopsis Move if equal zero. Mnemonic th.mveqz rd, rs1, rs2 Descr

[PATCH] inline: Purge the abnormal edges as needed in fold_marked_statements [PR118077]

2025-01-19 Thread Andrew Pinski
While fixing PR target/117665, I had noticed that fold_marked_statements would not purge the abnormal edges which could not be taken any more due to folding a call (devirtualization or simplification of a [target] builtin). Devirutalization could also cause a call that used to be able to have an ab

Re: [PATCH] RISC-V: Correct the mode that is causing the program to fail for XTheadCondMov

2025-01-19 Thread Jin Ma
> > diff --git a/gcc/testsuite/gcc.target/riscv/xtheadcondmov-bug.c > > b/gcc/testsuite/gcc.target/riscv/xtheadcondmov-bug.c > > new file mode 100644 > > index ..33658b863514 > > --- /dev/null > > +++ b/gcc/testsuite/gcc.target/riscv/xtheadcondmov-bug.c > > @@ -0,0 +1,12 @@ > > +/* { d

[PATCH] match.pd: Fix indefinite recursion during exp-log transformations [PR118490]

2025-01-19 Thread Soumya AR
This patch fixes the ICE caused when comparing log or exp of a constant with another constant. The transform is now restricted to cases where the resultant log/exp (CST) can be constant folded. Signed-off-by: Soumya AR gcc/ChangeLog: PR target/118490 * match.pd: Added ! to verify that log/exp

Re: [PATCH v2 1/2] LoongArch: Simplify using bstr{ins,pick} instructions for and

2025-01-19 Thread Lulu Cheng
LGTM! Thanks! 在 2025/1/18 下午7:33, Xi Ruoyao 写道: For bstrins, we can merge it into and3 instead of having a separate define_insn. For bstrpick, we can use the constraints to ensure the first source register and the destination register are the same hardware register, instead of emitting a move

[PATCH] LoongArch: Correct the mode for mask{eq,ne}z

2025-01-19 Thread Xi Ruoyao
For mask{eq,ne}z, rk is always compared with 0 in the full width, thus the mode for rk should be X. I found the issue reviewing a patch fixing a similar issue for RISC-V XTheadCondMov [1], but interestingly I cannot find a test case really blowing up on LoongArch. But as the issue is obvious enou

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

2025-01-19 Thread Hongyu Wang
Thanks Richard for willing to review this part, it is true that the try_cmove_arith logic adds quite a lot of special handling for optimization, so I reduce the logic in emit_mask_load_store to just generate most simple load/store that does not allow sources to be swapped. Hi Jeff, would you help

RE: [PATCH] COBOL 3/8 gen: GENERIC interface

2025-01-19 Thread Robert Dubner
> -Original Message- > From: Michael Matz > Sent: Wednesday, January 15, 2025 09:50 > To: Robert Dubner > Cc: Richard Biener ; jklow...@symas.com; Joseph Myers > ; gcc-patches@gcc.gnu.org > Subject: RE: [PATCH] COBOL 3/8 gen: GENERIC interface > > Hello, > > On Mon, 23 Dec 2024, Robe

Re: [PATCH] aarch64: Provide initial specifications for Apple CPU cores.

2025-01-19 Thread Iain Sandoe
All: Thank you all for looking at this - there are a large number of moving parts and I could easily be making incorrect assumptions. FWIW the highest weighting in the inputs I have are given to DDI0487L_a_a-profile and the query output from the actual desktops. - Please note that the Dar

Re: [PATCH] testsuite: Only run test if alarm is available

2025-01-19 Thread Torbjorn SVENSSON
On 2025-01-19 21:20, Andrew Pinski wrote: On Sun, Jan 19, 2025 at 12:17 PM Torbjörn SVENSSON wrote: Ok for trunk? -- Most baremetal toolchains will not have an implementation for alarm and sigaction as they are target specific. For arm-none-eabi with newlib, function signatures are expose

[PATCH, RFC] Fortran: do not copy back for parameter actual arguments [PR81978]

2025-01-19 Thread Harald Anlauf
Dear all, this patch addresses a long-standing difference between gfortran and other brands: when an array actual argument was passed to a procedure, and the dummy argument had no intent specified, we would often create packing and unpacking code. Only the case of the dummy argument having inten

Re: [PATCH] testsuite: Only run test if alarm is available

2025-01-19 Thread Andrew Pinski
On Sun, Jan 19, 2025 at 12:17 PM Torbjörn SVENSSON wrote: > > Ok for trunk? > > -- > > Most baremetal toolchains will not have an implementation for alarm and > sigaction as they are target specific. > For arm-none-eabi with newlib, function signatures are exposed, but > there is no implmentation

[PATCH] testsuite: Only run test if alarm is available

2025-01-19 Thread Torbjörn SVENSSON
Ok for trunk? -- Most baremetal toolchains will not have an implementation for alarm and sigaction as they are target specific. For arm-none-eabi with newlib, function signatures are exposed, but there is no implmentation and thus the test cases causes a undefined symbol link error. gcc/testsuit

Re: [pushed]PR118067][LRA]: Check secondary memory mode for the reg class

2025-01-19 Thread Uros Bizjak
On Fri, Jan 17, 2025 at 10:01 PM Vladimir Makarov wrote: > > This is one more patch to solve > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118067 > > with different -mcpu used. > > The patch was successfully bootstrapped and tested on x86-64, aarch64, and > ppc64le. I have committed a small t

[COMMITTED] Regenerate sparc.opt.urls

2025-01-19 Thread Mark Wielaard
sparc added a -mvis3b option, but the sparc.opt.url file wasn't regenerated. Fixes: d309844d6fe0 ("Fix bootstrap failure on SPARC with -O3 -mcpu=niagara4") gcc/ChangeLog: * config/sparc/sparc.opt.urls: Regenerated. --- gcc/config/sparc/sparc.opt.urls | 3 +++ 1 file changed, 3 insertion

[PATCH] testsuite: arm: Use -std=c17 for gcc.target/arm/thumb-bitfld1.c

2025-01-19 Thread Torbjörn SVENSSON
Ok for trunk? -- Using -std=c17 avoids excess errors like: .../thumb-bitfld1.c:15:1: warning: old-style function definition [-Wold-style-definition] gcc/testsuite/ChangeLog: * gcc.target/arm/thumb-bitfld1.c: Use -std=c17. Signed-off-by: Torbjörn SVENSSON --- gcc/testsuite/gcc.target

[PATCH] libstdc++: perfectly forward std::ranges::clamp arguments

2025-01-19 Thread Giuseppe D'Angelo
Hi, the attached patch fixes PR118185 (mentioned in the earlier thread about 118160). Tested on x86-64 Linux. Thanks, -- Giuseppe D'Angelo From 9c61058809ac091335a5e73ad8080d8310e9942e Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Sun, 19 Jan 2025 16:30:20 +0100 Subject: [PATCH] libs

Re: [pushed] libstdc++: Delete leftover from Profile Mode removal

2025-01-19 Thread Gerald Pfeifer
On Sun, 29 Dec 2024, Jonathan Wakely wrote: > On Sun, 29 Dec 2024, 13:55 Gerald Pfeifer wrote: >> something tells me this is not the full extent of this issue. Something >> to dig into when I find more time. > I think the explanation for this is simple, and not likely to be part of a > bigger issu

Re: [PATCH] wwwdocs: Clarify DCO name/identity and (anonymous) pseudonym policy

2025-01-19 Thread Mark Wielaard
Hi Gerald, On Tue, Dec 17, 2024 at 04:40:10PM +0900, Gerald Pfeifer wrote: > On Mon, 2 Dec 2024, Mark Wielaard wrote: > > Adjust the DCO text to match the broader community usage and > > clarifications around the use of real names, known identities and > > (anonymous) pseudonyms. > > > > These ch

[PATCH] RISC-V: Fix a typo in zce to zcf implication

2025-01-19 Thread Yuriy Kolerov
zce must imply zcf but this rule was corrupted after refactoring in this commit: 9e12010b5e724277ea44c300630802f464407d8d gcc/ChangeLog: * common/config/riscv/riscv-common.cc: fix zce to zcf implication. Signed-off-by: Yuriy Kolerov --- gcc/common/config/riscv/riscv-common.cc

[PATCH] RISC-V: Fix ICE when prefetching addresses less than 12 bits for zicbop

2025-01-19 Thread Jin Ma
gcc/ChangeLog: * config/riscv/riscv.md: Change 'r' to 'p'. gcc/testsuite/ChangeLog: * gcc.target/riscv/prefetch-zicbop-ice.c: New test. --- gcc/config/riscv/riscv.md| 2 +- gcc/testsuite/gcc.target/riscv/prefetch-zicbop-ice.c | 9 + 2 files ch

Re: [PATCH] RISC-V: Correct the mode that is causing the program to fail for XTheadCondMov

2025-01-19 Thread Xi Ruoyao
On Sun, 2025-01-19 at 20:42 +0800, Jin Ma wrote: /* snip */ > diff --git a/gcc/testsuite/gcc.target/riscv/xtheadcondmov-bug.c > b/gcc/testsuite/gcc.target/riscv/xtheadcondmov-bug.c > new file mode 100644 > index ..33658b863514 > --- /dev/null > +++ b/gcc/testsuite/gcc.target/riscv/xt

Re: [PATCH] tree-ssa-dce: Punt on allocations with too large constant sizes [PR118224]

2025-01-19 Thread Jakub Jelinek
On Sun, Jan 19, 2025 at 02:27:32PM +0200, Dimitar Dimitrov wrote: > Shouldn't the two "calloc" arguments be multiplied here, instead of > added? Yes, will fix tomorrow. Jakub

[PATCH] RISC-V: Correct the mode that is causing the program to fail for XTheadCondMov

2025-01-19 Thread Jin Ma
For XTheadCondMov, the bit width of rs2 should always be XLEN-sized, otherwise the program logic will be wrong. Reference form https://github.com/XUANTIE-RV/thead-extension-spec/releases/download/2.3.0/xthead-2023-11-10-2.3.0.pdf Synopsis Move if equal zero. Mnemonic th.mveqz rd, rs1, rs2 Descr

Re: [PATCH] tree-ssa-dce: Punt on allocations with too large constant sizes [PR118224]

2025-01-19 Thread Dimitar Dimitrov
On Fri, Jan 03, 2025 at 10:46:18PM +0100, Jakub Jelinek wrote: > Hi! > > As suggested by Richi in the PR, the following patch will fail to DCE > allocation calls if they have constant size which is too large (over > PTRDIFF_MAX), or for the case of calloc, if either of the arguments > is too large

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

2025-01-19 Thread Jin Ma
> On 1/17/25 7:37 AM, Jin Ma wrote: > >>> 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

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

2025-01-19 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] c++/modules: Check linkage of structured binding decls

2025-01-19 Thread Nathaniel Shead
Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? -- >8 -- When looking at PR c++/118513 I noticed that we don't currently check the linkage of structured binding declarations in modules. This patch adds those checks, and corrects decl_linkage to properly recognise structured bind

Re: [PATCH] testsuite: Fixes for test case pr117546.c

2025-01-19 Thread Dimitar Dimitrov
On Sat, Jan 18, 2025 at 07:06:16PM +, Sam James wrote: > Dimitar Dimitrov writes: > > > This test fails on AVR. > > > > Debugging the test on x86 host, I noticed that u in function s sometimes > > has value 16128. The "t <= 3 * u" expression in the same function > > results in signed integer