Re: Testsuite: fix contructor priority test

2023-09-03 Thread FX Coudert via Gcc-patches
Hi, I was about to ping the attached patch, and realised it bordered on obvious, so I pushed it directly. FX > Le 19 août 2023 à 22:40, FX Coudert a écrit : > > Bordering on obvious, tested on darwin where the test case fails before (and > now passes). > > OK to commit? > FX > > <0001-Te

[PATCH] Improve rewrite_to_defined_overflow for lhs already the correct type

2023-09-03 Thread Andrew Pinski via Gcc-patches
This improves rewrite_to_defined_overflow slightly if we already have an unsigned type. The only place where this seems to show up is ifcombine. It removes one extra statement which gets added and then later on removed. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/Chan

[PATCH] MATCH: Transform `(1 >> X) !=/== 0` into `X ==/!= 0`

2023-09-03 Thread Andrew Pinski via Gcc-patches
We currently have a pattern for handling `(C >> X) & D == 0` but if C is 1 and D is 1, the `& 1` might have been removed. gcc/ChangeLog: PR tree-optimization/105832 * match.pd (`(1 >> X) != 0`): New pattern gcc/testsuite/ChangeLog: PR tree-optimization/105832 * g

[PATCH v3] mklog: handle Signed-off-by, minor cleanup

2023-09-03 Thread Marc Poulhiès via Gcc-patches
Richard Sandiford via Gcc-patches writes: >> +# this regex matches the first line of the "end" in the initial commit >> message >> +FIRST_LINE_OF_END_RE = re.compile('(?i)^(signed-off-by|co-authored-by|#): ') > > The current code only requires an initial "#", rather than an initial "#: ". > Is th

[PATCH] MATCH: Add pattern for `(x | y) & (x & z)`

2023-09-03 Thread Andrew Pinski via Gcc-patches
Like the pattern already there for `(x | y) & x`, this adds a simple pattern to optimize `(x | y) & (x & z)` to just `x & z`. OK? Bootstrapped and tested on x86-64-linux-gnu with no regressions. gcc/ChangeLog: PR tree-optimization/103536 * match.pd (`(x | y) & (x & z)`, `

[PATCH] RISC-V: Fix Zicond ICE on large constants

2023-09-03 Thread Tsukasa OI via Gcc-patches
From: Tsukasa OI Large constant cons and/or alt will trigger ICEs building GCC target libraries (libgomp and libatomic) when the 'Zicond' extension is enabled. For instance, zicond-ice-2.c (new test case in this commit) will cause an ICE when SOME_NUMBER is 0x1000 or larger. While opposite numb

[PATCH] MATCH: Add `~MAX(~X, Y)` pattern: [PR96694]

2023-09-03 Thread Andrew Pinski via Gcc-patches
This adds `~MAX(~X, Y)` and `~MIN(~X, Y)` patterns that are like the `~(~a & b)` and `~(~a | b)` patterns and allows to reduce the number of ~ by 1. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. PR tree-optimization/96694 gcc/ChangeLog: * match.pd (`~MAX(~

Re: [PATCH 06/13] [APX EGPR] Map reg/mem constraints in inline asm to non-EGPR constraint.

2023-09-03 Thread Hongtao Liu via Gcc-patches
On Fri, Sep 1, 2023 at 7:27 PM Uros Bizjak wrote: > > On Fri, Sep 1, 2023 at 12:36 PM Hongtao Liu wrote: > > > > On Fri, Sep 1, 2023 at 5:38 PM Uros Bizjak via Gcc-patches > > wrote: > > > > > > On Fri, Sep 1, 2023 at 11:10 AM Hongyu Wang > > > wrote: > > > > > > > > Uros Bizjak via Gcc-patche

Re: [PATCH 06/13] [APX EGPR] Map reg/mem constraints in inline asm to non-EGPR constraint.

2023-09-03 Thread Hongtao Liu via Gcc-patches
On Fri, Sep 1, 2023 at 7:03 PM Richard Sandiford via Gcc-patches wrote: > > Uros Bizjak via Gcc-patches writes: > > On Thu, Aug 31, 2023 at 11:18 AM Jakub Jelinek via Gcc-patches > > wrote: > >> > >> On Thu, Aug 31, 2023 at 04:20:17PM +0800, Hongyu Wang via Gcc-patches > >> wrote: > >> > From:

[PATCH] MATCH: Add `(x | c) & ~(y | c)` and `x & ~(y | x)` patterns [PR98710]

2023-09-03 Thread Andrew Pinski via Gcc-patches
Adding some more simple bit_and/bit_ior patterns. How often these show up, I have no idea. This was tested on top of https://gcc.gnu.org/pipermail/gcc-patches/2023-September/629174.html . OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: PR tree-optimiz

Re:[pushed] [PATCH v2] LoongArch: Support storing floating-point zero into MEM[base + index].

2023-09-03 Thread chenglulu
pushed to r14-3643. 在 2023/9/2 下午3:02, Guo Jie 写道: v2: Modify commit message. gcc/ChangeLog: * config/loongarch/loongarch.md: Support 'G' -> 'k' in movsf_hardfloat and movdf_hardfloat. gcc/testsuite/ChangeLog: * gcc.target/loongarch/const-double-zero-stx.c: New test.

Re:[pushed] [PATCH 1/2] LoongArch: Optimize switch with sign-extended index.

2023-09-03 Thread chenglulu
Pushed to r14-3642. The description information was modified and XLEN was changed to GRLEN. Thanks!:-) 在 2023/9/2 下午4:09, WANG Xuerui 写道: On 9/2/23 14:24, Lulu Cheng wrote: The patch refers to the submission of RISCV 7bbce9b50302959286381d9177818642bceaf301. gcc/ChangeLog: * config/loo

Re: [PING][PATCH] LoongArch: initial ada support on linux

2023-09-03 Thread Yang Yujie
On Fri, Sep 01, 2023 at 01:52:16PM +, Arnaud Charlet wrote: > A small nit above: I'd suggest using += instead of := $(XXX) to make things > clearer. Ok, will fix in v2.

[PATCH v2] LoongArch: initial ada support on linux

2023-09-03 Thread Yang Yujie
gcc/ChangeLog: * ada/Makefile.rtl: Add LoongArch support. * ada/libgnarl/s-linux__loongarch.ads: New. * ada/libgnat/system-linux-loongarch.ads: New. * config/loongarch/loongarch.h: mark normalized options passed from driver to gnat1 as explicit for multilib.

Re: [PATCH V6] Optimize '(X - N * M) / N' to 'X / N - M' if valid

2023-09-03 Thread Jiufu Guo via Gcc-patches
Hi, Richard Biener writes: > On Fri, 1 Sep 2023, Jiufu Guo wrote: > >> Hi, >> >> Integer expression "(X - N * M) / N" can be optimized to "X / N - M" with >> the below conditions: >> 1. There is no wrap/overflow/underflow. >>wrap/overflow/underflow breaks the arithmetic operation. >> 2. "

[PATCH] RISC-V: Add conditional sqrt autovec pattern

2023-09-03 Thread Lehua Ding
This patch adds a combined pattern for combining vfsqrt.v and vcond_mask. gcc/ChangeLog: * config/riscv/autovec-opt.md (*cond_): Add sqrt + vcond_mask combine pattern. * config/riscv/autovec.md (2): Change define_expand to define_insn_and_split. gcc/testsuite/Chan

[PATCH-2v2, rs6000] Implement 32bit inline lrint [PR88558]

2023-09-03 Thread HAO CHEN GUI via Gcc-patches
Hi, This patch implements 32bit inline lrint by "fctiw". It depends on the patch1 to do SImode move from FP registers on P7. Compared to last version, the main change is to add tests for "lrintf" and adjust the count of corresponding instructions. https://gcc.gnu.org/pipermail/gcc-patches/2023

[PATCH-1v2, rs6000] Enable SImode in FP registers on P7 [PR88558]

2023-09-03 Thread HAO CHEN GUI via Gcc-patches
Hi, This patch enables SImode in FP registers on P7. Instruction "fctiw" stores its integer output in an FP register. So SImode in FP register needs be enabled on P7 if we want support "fctiw" on P7. The test case is in the second patch which implements 32bit inline lrint. Compared to the l

Re: PING^3: [PATCH] rtl-optimization/110939 Really fix narrow comparison of memory and constant

2023-09-03 Thread Stefan Schulze Frielinghaus via Gcc-patches
Ping. On Thu, Aug 24, 2023 at 11:31:32AM +0800, Xi Ruoyao wrote: > Ping again. > > On Fri, 2023-08-18 at 13:04 +0200, Stefan Schulze Frielinghaus via > Gcc-patches wrote: > > Ping.  Since this fixes bootstrap problem PR110939 for Loongarch I'm > > pingen this one earlier. > > > > On Thu, Aug 10

Re: [PATCH] RISC-V: Fix Zicond ICE on large constants

2023-09-03 Thread Kito Cheng via Gcc-patches
Maybe move the check logic a bit forward? My thought is the logic is already specialized into a few catalogs, (imm, imm), (imm, reg), (reg, reg)... and the logic you put is already in (imm, reg), but it should really move into (reg, reg) case IMO? and move that forward we could prevent add too much