Re: [PATCH v3 1/4] LoongArch: improved target configuration interface

2023-09-08 Thread Xi Ruoyao via Gcc-patches
On Sat, 2023-09-09 at 10:46 +0800, Yang Yujie wrote: > The next option I can think of would be MULTILIB_EXTRA_OPTS, where > -fmultiflags > fit in nicely.  However, these options won't reach the toplevel builds, and > tweaking config-ml.in for getting it there would be quite tedious and perhaps >

Re: [RFC] gcc: xtensa: use salt/saltu in xtensa_expand_scc

2023-09-08 Thread Takayuki 'January June' Suwa via Gcc-patches
Hi! On 2023/09/07 23:22, Max Filippov wrote: > gcc/ > * config/xtensa/predicates.md (xtensa_cstoresi_operator): Add > unsigned comparisons. > * config/xtensa/xtensa.cc (xtensa_expand_scc): Add code > generation of salt/saltu instructions. > * config/xtensa/xtensa.h

[PATCH] RISC-V: Add VLS modes VEC_PERM support[PR111311]

2023-09-08 Thread Juzhe-Zhong
This patch add VLS modes VEC_PERM support which fix these following FAILs in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111311: FAIL: gcc.dg/tree-ssa/forwprop-40.c scan-tree-dump-times optimized "BIT_FIELD_REF" 0 FAIL: gcc.dg/tree-ssa/forwprop-40.c scan-tree-dump-times optimized

[Committed] RISC-V: Fix VLS floating-point operations predicate

2023-09-08 Thread Juzhe-Zhong
VLS vfadd should depend on ZVFH instead of ZVFHMIN. Obvious fix and committed. gcc/ChangeLog: * config/riscv/vector-iterators.md: Fix floating-point operations predicate. --- gcc/config/riscv/vector-iterators.md | 24 1 file changed, 12 insertions(+), 12

Re: [PATCH v3 1/4] LoongArch: improved target configuration interface

2023-09-08 Thread Yang Yujie
On Thu, Sep 07, 2023 at 07:54:41PM +0800, Yang Yujie wrote: > On Thu, Sep 07, 2023 at 05:47:36PM +0800, Xi Ruoyao wrote: > > On Thu, 2023-09-07 at 17:31 +0800, Yang Yujie wrote: > > > > This is bad.  It makes BOOT_CFLAGS=-mlasx or CFLAGS_FOR_TARGET=-mlasx > > > > silently ignored so we cannot test

Re: [PATCH V3] Support folding min(poly,poly) to const

2023-09-08 Thread Lehua Ding
Committed, thanks Richard and Juzhe. On 2023/9/8 16:57, 钟居哲 wrote: Thanks Richard. LGTM again from RISC-V side :). juzhe.zh...@rivai.ai *From:* Richard Sandiford *Date:* 

Re: [PATCH v2 2/5] RISC-V: Add Types for Un-Typed zc Instructions

2023-09-08 Thread Jeff Law via Gcc-patches
On 9/8/23 12:16, Edwin Lu wrote: This patch adds types to the untyped zc instructions. Creates a new types "pushpop" and "mvpair" for now gcc/ChangeLog: * config/riscv/riscv.md: Add "csr" type * config/riscv/zc.md: Update types OK. Note that once we finish this exercise,

Re: [PATCH v2 1/5] RISC-V: Update Types for Vector Instructions

2023-09-08 Thread Jeff Law via Gcc-patches
On 9/8/23 12:16, Edwin Lu wrote: This patch adds types to vector instructions that were added after or were missed by the original patch https://gcc.gnu.org/pipermail/gcc-patches/2023-August/628594.html gcc/ChangeLog: * config/riscv/autovec-opt.md: Update types *

Re: [PATCH] fortran: Remove redundant tree walk to delete element

2023-09-08 Thread Harald Anlauf via Gcc-patches
Am 08.09.23 um 12:04 schrieb Mikael Morin via Gcc-patches: Hello, this avoids some redundant work in the symbol deletion code, which is used a lot by the parser to cancel statements that fail to match in the end. I haven't tried to measure the performance effect, if any, on a pathological

[COMMITTED] [frange] Revert relation handling in LTGT_EXPR.

2023-09-08 Thread Aldy Hernandez via Gcc-patches
In trying to come up with a missing testcase for commit 979e0fbf53cd, I've realized the patch doesn't catch anything. A relation of VREL_EQ in foperator_ltgt::fold_range() is either both arguments the same (x LTGT_EXPR x), which we should never emit, or two arguments that are actually the same,

Ping: [PATCH] testsuite: Add test for already-fixed issue with _Pragma expansion [PR90400]

2023-09-08 Thread Lewis Hyatt via Gcc-patches
Hello- May I please ping this one? It's adding a testcase prior to closing the PR. Thanks! https://gcc.gnu.org/pipermail/gcc-patches/2023-August/628488.html -Lewis On Fri, Aug 25, 2023 at 4:46 PM Lewis Hyatt wrote: > > Hello- > > This is adding a testcase for a PR that was already incidentally

[PATCH, pushed] testsuite: adjust for darwin linker warning

2023-09-08 Thread FX Coudert via Gcc-patches
Pushed as obvious to fix two testsuite FAILs on darwin with recent macOS linkers when -no_pie is passed. FX 0001-testsuite-adjust-for-darwin-linker-warning.patch Description: Binary data

[PATCH v3] c++: Move consteval folding to cp_fold_r

2023-09-08 Thread Marek Polacek via Gcc-patches
On Thu, Sep 07, 2023 at 02:32:51PM -0400, Jason Merrill wrote: > On 9/7/23 11:23, Marek Polacek wrote: > > On Tue, Sep 05, 2023 at 04:36:34PM -0400, Jason Merrill wrote: > > > On 9/5/23 15:59, Marek Polacek wrote: > > > > On Tue, Sep 05, 2023 at 10:52:04AM -0400, Jason Merrill wrote: > > > > > On

Re: [committed] libstdc++: Add Filesystem TS and std::stacktrace symbols to libstdc++exp.a

2023-09-08 Thread Jonathan Wakely via Gcc-patches
I forgot to say: Tested x86_64-linux and aarch64-linux, built for avr, arm-eabi and cris-elf. Pushed to trunk. On Fri, 8 Sept 2023 at 18:09, Jonathan Wakely via Libstdc++ wrote: > > This consolidates the three static archives for extensions into one, so > that -lstdc++exp can be used to

[PATCH v2 2/5] RISC-V: Add Types for Un-Typed zc Instructions

2023-09-08 Thread Edwin Lu
This patch adds types to the untyped zc instructions. Creates a new types "pushpop" and "mvpair" for now gcc/ChangeLog: * config/riscv/riscv.md: Add "csr" type * config/riscv/zc.md: Update types Signed-off-by: Edwin Lu --- Changes in V2: - Change "csr" type to "pushpop" and

[PATCH v2 1/5] RISC-V: Update Types for Vector Instructions

2023-09-08 Thread Edwin Lu
This patch adds types to vector instructions that were added after or were missed by the original patch https://gcc.gnu.org/pipermail/gcc-patches/2023-August/628594.html gcc/ChangeLog: * config/riscv/autovec-opt.md: Update types * config/riscv/autovec.md: likewise

[PATCH v2 0/5] RISC-V: Add Types to Untyped Instructions

2023-09-08 Thread Edwin Lu
This series adds types to the remaining untyped instructions. Related Discussion: https://inbox.sourceware.org/gcc-patches/12fb5088-3f28-0a69-de1e-f387371a5...@gmail.com/ Also enables assert which checks to make sure every instruction has a type All patches were tested with rv32/rv64

[committed] libstdc++: Update outdated default -std in testing docs

2023-09-08 Thread Jonathan Wakely via Gcc-patches
Pushed to gcc-13 (I've removed/rewritten this text on trunk). I'll push to the older branches too. -- >8 -- libstdc++-v3/ChangeLog: * doc/xml/manual/test.xml: Update reference to -std=gnu++14 as the default. * doc/html/manual/test.html: Regenerate. ---

[PATCH] match: Don't sink comparisons into vec_cond operands.

2023-09-08 Thread Robin Dapp via Gcc-patches
Hi, on riscv gcc.dg/pr70252.c ICEs at gimple-isel.cc:283. This is because we created the gimple statement mask__7.36_170 = VEC_COND_EXPR ; during vrp2. What happens is that, starting with maskdest = (vec_cond mask1 1 0) >= (vec_cond mask2 1 0) we fold to maskdest = mask1 >= (vec_cond

Re: [PATCH v2] libstdc++: Fix -Wunused-parameter warnings

2023-09-08 Thread Jonathan Wakely via Gcc-patches
On Thu, 7 Sept 2023 at 20:30, Pekka Seppänen wrote: > > On 7.9.2023 19:40, Jonathan Wakely wrote: > > On 29/08/23 15:04 +0300, Pekka Seppänen wrote: > >> libstdc++: Fix -Wunused-parameter warnings when _GLIBCXX_USE_WCHAR_T is > >> not defined. > >> > >> libstdc++-v3/ChangeLog: > >> > >> *

[committed] libstdc++: Add Filesystem TS and std::stacktrace symbols to libstdc++exp.a

2023-09-08 Thread Jonathan Wakely via Gcc-patches
This consolidates the three static archives for extensions into one, so that -lstdc++exp can be used to provide the definitions of all unstable library features. The libstdc++_libbacktrace.a archive is now just a "noinst" convenience library that is only used during the build, not installed. Its

Re: [PATCH] libstdc++: Reduce output of 'make check'

2023-09-08 Thread Jonathan Wakely via Gcc-patches
On Thu, 7 Sept 2023 at 14:32, Jonathan Wakely via Libstdc++ wrote: > > Any objections to this change? Pushed to trunk now. > > -- >8 -- > > This removes the 39 lines of shell commands that get echoed when > starting the testsuite. The fact that near the end of that output it > prints `echo

Re: [PATCH] libbacktrace: Fix unconditional -Werror

2023-09-08 Thread Jonathan Wakely via Gcc-patches
On Fri, 8 Sept 2023 at 11:10, Jonathan Wakely wrote: > > The patch looks good, thanks. I noticed the unconditional -Werror the other > day when testing a build on avr. > > N.B. All patches should go to gcc-patches (as well as a more specific list > like libstdc++ when appropriate). > > OK for

Re: [PATCH 01/13] [APX EGPR] middle-end: Add insn argument to base_reg_class

2023-09-08 Thread Vladimir Makarov via Gcc-patches
On 8/31/23 04:20, Hongyu Wang wrote: @@ -2542,6 +2542,8 @@ the code of the immediately enclosing expression (@code{MEM} for the top level of an address, @code{ADDRESS} for something that occurs in an @code{address_operand}). @var{index_code} is the code of the corresponding index

[PATCH] Allow target attributes in non-gnu namespaces

2023-09-08 Thread Richard Sandiford via Gcc-patches
Currently there are four static sources of attributes: - LANG_HOOKS_ATTRIBUTE_TABLE - LANG_HOOKS_COMMON_ATTRIBUTE_TABLE - LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE - TARGET_ATTRIBUTE_TABLE All of the attributes in these tables go in the "gnu" namespace. This means that they can use the traditional GNU

PING^4: [PATCH V4, rs6000] Disable generation of scalar modulo instructions

2023-09-08 Thread Pat Haugen via Gcc-patches
Ping. On 6/30/23 2:26 PM, Pat Haugen via Gcc-patches wrote: Updated from prior version to address latest review comment (simplify umod3). Disable generation of scalar modulo instructions. It was recently discovered that the scalar modulo instructions can suffer noticeable performance issues

Re: [PATCH 3/3] [V2] [RISC-V] support cm.mva01s cm.mvsa01 in zcmp

2023-09-08 Thread Jeff Law via Gcc-patches
On 9/7/23 20:06, Fei Gao wrote: On 2023-09-08 04:33  Palmer Dabbelt wrote: On Thu, 07 Sep 2023 13:16:36 PDT (-0700), dimi...@dinux.eu wrote: Hi, This patch appears to have caused PR 111259. Hi Patrick We're reproducing the issue also. One thing that puzzles me is why a zcmp predicate

[PATCH v3] libcpp: add function to check XID properties

2023-09-08 Thread Arthur Cohen
From: Raiki Tamura Fixed to include the enum's name which I had forgotten to commit. Thanks This commit adds a new function intended for checking the XID properties of a possibly unicode character, as well as the accompanying enum describing the possible properties. libcpp/ChangeLog:

Re: [V3][PATCH 2/3] Use the counted_by atribute info in builtin object size [PR108896]

2023-09-08 Thread Qing Zhao via Gcc-patches
Ping. thanks. Qing > On Aug 25, 2023, at 11:24 AM, Qing Zhao wrote: > > Use the counted_by atribute info in builtin object size to compute the > subobject size for flexible array members. > > gcc/ChangeLog: > > PR C/108896 > * tree-object-size.cc (addr_object_size): Use the

[PATCH v2] libcpp: add function to check XID properties

2023-09-08 Thread Arthur Cohen
From: Raiki Tamura This commit adds a new function intended for checking the XID properties of a possibly unicode character, as well as the accompanying enum describing the possible properties. libcpp/ChangeLog: * charset.cc (cpp_check_xid_property): New. * include/cpplib.h

Re: [V3][PATCH 3/3] Use the counted_by attribute information in bound sanitizer[PR108896]

2023-09-08 Thread Qing Zhao via Gcc-patches
Ping. thanks. Qing > On Aug 25, 2023, at 11:24 AM, Qing Zhao wrote: > > Use the counted_by attribute information in bound sanitizer. > > gcc/c-family/ChangeLog: > > PR C/108896 > * c-ubsan.cc (ubsan_instrument_bounds): Use counted_by attribute > information. > >

Re: [V3][PATCH 1/3] Provide counted_by attribute to flexible array member field (PR108896)

2023-09-08 Thread Qing Zhao via Gcc-patches
PIng. thanks. Qing > On Aug 25, 2023, at 11:24 AM, Qing Zhao wrote: > > Provide a new counted_by attribute to flexible array member field. > > 'counted_by (COUNT)' > The 'counted_by' attribute may be attached to the flexible array > member of a structure. It indicates that the

Re: [V3][PATCH 0/3] New attribute "counted_by" to annotate bounds for C99 FAM(PR108896)

2023-09-08 Thread Qing Zhao via Gcc-patches
Ping. Thanks. Qing > On Aug 25, 2023, at 11:24 AM, Qing Zhao wrote: > > This is the 3rd version of the patch, per our discussion based on the > review comments for the 1st and 2nd version, the major changes in this > version are: > > ***Against 1st version: > 1. change the name

Re: Skip a number of C++ test cases for '-fno-exceptions' testing (was: Support in the GCC(/C++) test suites for '-fno-exceptions')

2023-09-08 Thread Thomas Schwinge
Hi! GCC/C++ front end maintainers, please provide input on the overall approach here: On 2023-06-15T17:15:54+0200, I wrote: > On 2023-06-06T20:31:21+0100, Jonathan Wakely wrote: >> On Tue, 6 Jun 2023 at 20:14, Thomas Schwinge wrote: >>> This issue comes up in context of me working on C++

Re: [PATCH] libcpp: add function to check XID properties

2023-09-08 Thread Jakub Jelinek via Gcc-patches
On Fri, Sep 08, 2023 at 02:58:40PM +0200, Arthur Cohen wrote: > From: Raiki Tamura > > libcpp/ChangeLog: > > * charset.cc (check_xid_property):new function to check XID_Start and > XID_Continue > * include/cpplib.h (check_xid_property):add enum representing XID > properties Just

[PATCH] libcpp: add function to check XID properties

2023-09-08 Thread Arthur Cohen
From: Raiki Tamura libcpp/ChangeLog: * charset.cc (check_xid_property):new function to check XID_Start and XID_Continue * include/cpplib.h (check_xid_property):add enum representing XID properties Signed-off-by: Raiki Tamura --- libcpp/charset.cc | 36

[PATCH] Fix PR 111331: wrong code for `a > 28 ? MIN : 29`

2023-09-08 Thread Andrew Pinski via Gcc-patches
The problem here is after r6-7425-ga9fee7cdc3c62d0e51730, the comparison to see if the transformation could be done was using the wrong value. Instead of see if the inner was LE (for MIN and GE for MAX) the outer value, it was comparing the inner to the value used in the comparison which was

Re: [PATCH] riscv: xtheadbb: Fix extendqi insn

2023-09-08 Thread Philipp Tomsich
Applied to master. Thanks! Philipp. On Fri, 8 Sept 2023 at 14:17, Kito Cheng wrote: > LGTM > > Christoph Muellner 於 2023年9月8日 週五,14:00寫道: > >> From: Christoph Müllner >> >> Recently three SPEC CPU 2017 benchmarks broke when using xtheadbb: >> * 500.perlbench_r >> * 525.x264_r >> * 557.xz_r >>

Re: [PATCH] libstdc++: Reduce output of 'make check'

2023-09-08 Thread Jonathan Wakely via Gcc-patches
On Fri, 8 Sept 2023 at 13:15, Eric Gallager wrote: > > On Fri, Sep 8, 2023 at 6:32 AM Jonathan Wakely wrote: > > > > On Fri, 8 Sept 2023 at 03:16, Eric Gallager wrote: > > > > > > Maybe use $(AM_V_at) instead? That would allow it to be controlled by > > > the --enable-silent-rules flag to

Re: [PATCH] riscv: xtheadbb: Fix extendqi insn

2023-09-08 Thread Kito Cheng via Gcc-patches
LGTM Christoph Muellner 於 2023年9月8日 週五,14:00寫道: > From: Christoph Müllner > > Recently three SPEC CPU 2017 benchmarks broke when using xtheadbb: > * 500.perlbench_r > * 525.x264_r > * 557.xz_r > > Tracing the issue down revealed, that we emit a 'th.ext xN,xN,15,0' > for a extendqi insn, which

[PATCH] pretty-print: Fix up pp_wide_int [PR111329]

2023-09-08 Thread Jakub Jelinek via Gcc-patches
Hi! The recent pp_wide_int changes for _BitInt support (because not all wide_ints fit into the small fixed size digit_buffer anymore) apparently broke +FAIL: gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c (test for excess errors) +FAIL: gcc.dg/analyzer/out-of-bounds-diagram-1-debug.c 2 blank

Re: [PATCH] libstdc++: Reduce output of 'make check'

2023-09-08 Thread Eric Gallager via Gcc-patches
On Fri, Sep 8, 2023 at 6:32 AM Jonathan Wakely wrote: > > On Fri, 8 Sept 2023 at 03:16, Eric Gallager wrote: > > > > Maybe use $(AM_V_at) instead? That would allow it to be controlled by > > the --enable-silent-rules flag to configure, as well as make V=1 vs. > > make V=0 too. > > I see two

More '#ifdef ASM_OUTPUT_DEF' -> 'if (TARGET_SUPPORTS_ALIASES)' etc. (was: [PATCH][v2] Introduce TARGET_SUPPORTS_ALIASES)

2023-09-08 Thread Thomas Schwinge
Hi! On 2017-08-10T15:42:13+0200, Jan Hubicka wrote: >> On 07/31/2017 11:57 AM, Yuri Gribov wrote: >> > On Mon, Jul 31, 2017 at 9:04 AM, Martin Liška wrote: >> >> Doing the transformation suggested by Honza. ... which was: | On 2017-07-24T16:06:22+0200, Jan Hubicka wrote: | > we probably

Re: [PATCH] riscv: thead: Fix mode attribute for extension patterns

2023-09-08 Thread Philipp Tomsich
Applied to master. Thanks! Philipp. On Fri, 8 Sept 2023 at 10:13, Kito Cheng wrote: > LGTM > > Christoph Muellner 於 2023年9月8日 週五 14:16 寫道: > >> From: Christoph Müllner >> >> The mode attribute of an extension pattern is usually set to the target >> type. >> Let's follow this convention

[committed] Update contrib + libgomp ChangeLogs for failed reject-commit testing (was: [Patch] contrib/gcc-changelog: Check whether revert-commit exists)

2023-09-08 Thread Tobias Burnus
On 07.09.23 11:38, Jakub Jelinek wrote: On Thu, Sep 07, 2023 at 11:30:53AM +0200, Tobias Burnus wrote: contrib/gcc-changelog: Check whether revert-commit exists ... I think not should precede technically (or should we just drop technically)? 'technically' has been dropped (twice), based on

[PATCH v2] RISC-V: Implement TLS Descriptors.

2023-09-08 Thread Tatsuyuki Ishi via Gcc-patches
This implements TLS Descriptors (TLSDESC) as specified in [1]. In TLSDESC instruction sequence, the first instruction relocates against the target TLS variable, while subsequent instructions relocates against the address of the first. Such usage of labels are not well-supported within GCC. Due to

Re: [PATCH] libstdc++: Reduce output of 'make check'

2023-09-08 Thread Jonathan Wakely via Gcc-patches
On Fri, 8 Sept 2023 at 03:16, Eric Gallager wrote: > > Maybe use $(AM_V_at) instead? That would allow it to be controlled by > the --enable-silent-rules flag to configure, as well as make V=1 vs. > make V=0 too. I see two problems with that. Firstly, nobody uses that configure option, so the net

Re: [PATCH] libbacktrace: Fix unconditional -Werror

2023-09-08 Thread Jonathan Wakely via Gcc-patches
The patch looks good, thanks. I noticed the unconditional -Werror the other day when testing a build on avr. N.B. All patches should go to gcc-patches (as well as a more specific list like libstdc++ when appropriate). OK for trunk On Fri, 8 Sept 2023, 10:49 Alexey Lapshin via Libstdc++, <

[PATCH] fortran: Remove redundant tree walk to delete element

2023-09-08 Thread Mikael Morin via Gcc-patches
Hello, this avoids some redundant work in the symbol deletion code, which is used a lot by the parser to cancel statements that fail to match in the end. I haven't tried to measure the performance effect, if any, on a pathological example; just passed the fortran testsuite on

Re:[pushed] [PATCH] LoongArch: Enable -fsched-pressure by default at -O1 and higher.

2023-09-08 Thread chenglulu
Pushed to r14-3805. 在 2023/9/8 下午4:32, Xi Ruoyao 写道: On Fri, 2023-09-08 at 16:29 +0800, Guo Jie wrote: Hi, What I wanna change is "gcc/common/config/loongarch/loongarch- common.cc", and the patch is automatically generated by "git gcc-commit-mklog". Is it necessary to  to remove "common/" ?

Re:[pushed] [PATCH] LoongArch: Fix unintentional bash-ism in r14-3665.

2023-09-08 Thread chenglulu
Pushed to r14-3804. 在 2023/9/6 下午8:19, Richard Sandiford 写道: Yang Yujie writes: gcc/ChangeLog: * config.gcc: remove non-POSIX syntax "<<<". OK. Thanks for the quick fix. Richard. --- gcc/config.gcc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [pushed][PATCH v2] LoongArch: Adjust C++ multilib header layout.

2023-09-08 Thread chenglulu
PUshed to r14-3803. 在 2023/9/7 下午2:50, Yang Yujie 写道: For LoongArch, the toplevel library build is always aliased to one of the multilib variants. This patch installs it with the actual MULTISUBDIR (instead of ".") so that the headers can be reached by the compiler. This patch is an update of

Re: [PATCH] Fortran: runtime bounds-checking in presence of array constructors [PR31059]

2023-09-08 Thread Mikael Morin via Gcc-patches
Le 01/09/2023 à 22:48, Harald Anlauf a écrit : Hi Mikael, On 9/1/23 10:41, Mikael Morin via Gcc-patches wrote: May I suggest to handle functions the same way? I'll have a look at them, but will need to gather a few suitable testcases first. I have just opened PR111339

Re: [PATCH] riscv: bitmanip: Remove duplicate zero_extendhi2 pattern

2023-09-08 Thread Philipp Tomsich
Committed as 'obvious' to master. Thanks! Philipp. On Fri, 8 Sept 2023 at 08:53, Christoph Muellner < christoph.muell...@vrull.eu> wrote: > From: Christoph Müllner > > We currently have two identical zero_extendhi2 patterns: > * '*zero_extendhi2_zbb' > * '*zero_extendhi2_bitmanip' > > This

Re: [PATCH v2 1/3] libgomp, nvptx: low-latency memory allocator

2023-09-08 Thread Tobias Burnus
Hi Andrew, some early comments. I think in general, the direction/patches are fine, but I have some comments: On 02.08.23 19:00, Andrew Stubbs wrote: This patch adds support for allocating low-latency ".shared" memory on NVPTX GPU device, via the omp_low_lat_mem_space and omp_alloc. The

[PATCH] gimple-match: Do not try UNCOND optimization with COND_LEN.

2023-09-08 Thread Robin Dapp via Gcc-patches
Hi, found in slp-reduc-7.c, this patch prevents optimizing e.g. COND_LEN_ADD ({-1, ... }, a, 0, c, len, bias) unconditionally into just "a". Currently, we assume that COND_LEN operations can be optimized similarly to COND operations. As the length is part of the mask (and usually not

Re: Re: [PATCH V3] Support folding min(poly,poly) to const

2023-09-08 Thread 钟居哲
Thanks Richard. LGTM again from RISC-V side :). juzhe.zh...@rivai.ai From: Richard Sandiford Date: 2023-09-08 16:56 To: Lehua Ding CC: gcc-patches; juzhe.zhong Subject: Re: [PATCH V3] Support folding min(poly,poly) to const Lehua Ding writes: > V3 change: Address Richard's comments. > > Hi,

Re: [PATCH V3] Support folding min(poly,poly) to const

2023-09-08 Thread Richard Sandiford via Gcc-patches
Lehua Ding writes: > V3 change: Address Richard's comments. > > Hi, > > This patch adds support that tries to fold `MIN (poly, poly)` to > a constant. Consider the following C Code: > > ``` > void foo2 (int* restrict a, int* restrict b, int n) > { > for (int i = 0; i < 3; i += 1) > a[i]

[PATCH V3] Support folding min(poly,poly) to const

2023-09-08 Thread Lehua Ding
V3 change: Address Richard's comments. Hi, This patch adds support that tries to fold `MIN (poly, poly)` to a constant. Consider the following C Code: ``` void foo2 (int* restrict a, int* restrict b, int n) { for (int i = 0; i < 3; i += 1) a[i] += b[i]; } ``` Before this patch: ```

[PATCH] xtensa: Optimize several boolean evaluations of EQ/NE against constant zero

2023-09-08 Thread Takayuki 'January June' Suwa via Gcc-patches
An idiomatic implementation of boolean evaluation of whether a register is zero or not in Xtensa is to assign 0 and 1 to the temporary and destination, and then issue the MOV[EQ/NE]Z machine instruction (See 8.3.2 Instruction Idioms, Xtensa ISA refman., p.599): ;; A2 = (A3 != 0) ? 1 : 0;

Re: [PATCH V2] Support folding min(poly,poly) to const

2023-09-08 Thread Lehua Ding
Sorry, just realised that the poly_int_tree_p tests are redundant. The caller has already checked that. Indeed, I will removed poly_int_tree_p tests like the following code. Thanks for timely remind. /* Returns true if we know who is smaller or equal, ARG1 or ARG2, and set the min value

[PATCH] testsuite: Fix gcc.target/arm/mve/mve_vadcq_vsbcq_fpscr_overwrite.c

2023-09-08 Thread Christophe Lyon via Gcc-patches
The test was declaring 'int *carry;' and wrote to '*carry' without initializing 'carry' first, leading to an attempt to write at address zero, and a crash. Fix by declaring 'int carry;' and passing '' instead of 'carry' as parameter. 2023-09-08 Christophe Lyon gcc/testsuite/

Re: [Patch] contrib/gcc-changelog: Check whether revert-commit exists

2023-09-08 Thread Jakub Jelinek via Gcc-patches
On Fri, Sep 08, 2023 at 10:25:42AM +0200, Christophe Lyon wrote: > Revert "libstdc++: Use GLIBCXX_CHECK_LINKER_FEATURES for cross-builds > (PR111238)" > > diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog > index 8f7b01e0563..0c60149d7f6 100644 > --- a/libstdc++-v3/ChangeLog > +++

Re: [PATCH] LoongArch: Enable -fsched-pressure by default at -O1 and higher.

2023-09-08 Thread Xi Ruoyao via Gcc-patches
On Fri, 2023-09-08 at 16:29 +0800, Guo Jie wrote: > Hi, > > What I wanna change is "gcc/common/config/loongarch/loongarch- > common.cc", > > and the patch is automatically generated by "git gcc-commit-mklog". > > Is it necessary to  to remove "common/" ? My bad. I didn't realized the file has

Re: [PATCH V2] Support folding min(poly,poly) to const

2023-09-08 Thread Richard Sandiford via Gcc-patches
Richard Sandiford writes: > Lehua Ding writes: >> Hi, >> >> This patch adds support that tries to fold `MIN (poly, poly)` to >> a constant. Consider the following C Code: >> >> ``` >> void foo2 (int* restrict a, int* restrict b, int n) >> { >> for (int i = 0; i < 3; i += 1) >> a[i] +=

RE: [PATCH] RISC-V: Suppress bogus warning for VLS types

2023-09-08 Thread Li, Pan2 via Gcc-patches
Committed, thanks Kito. Pan -Original Message- From: Gcc-patches On Behalf Of Kito Cheng via Gcc-patches Sent: Friday, September 8, 2023 4:27 PM To: Juzhe-Zhong Cc: GCC Patches ; Kito Cheng Subject: Re: [PATCH] RISC-V: Suppress bogus warning for VLS types LGTM Juzhe-Zhong 於

Re: [PATCH] LoongArch: Enable -fsched-pressure by default at -O1 and higher.

2023-09-08 Thread Guo Jie
Hi, What I wanna change is "gcc/common/config/loongarch/loongarch-common.cc", and the patch is automatically generated by "git gcc-commit-mklog". Is it necessary to  to remove "common/" ? Thanks for the review. 在 2023/9/8 下午4:06, Xi Ruoyao 写道: On Fri, 2023-09-08 at 10:00 +0800, Guo Jie

Re: Re: [PATCH V2] Support folding min(poly,poly) to const

2023-09-08 Thread 钟居哲
Thanks Richard and Lehua. LGTM from RISC-V side. juzhe.zh...@rivai.ai From: Richard Sandiford Date: 2023-09-08 16:12 To: Lehua Ding CC: gcc-patches; richard.guenther; juzhe.zhong; jeffreyalaw Subject: Re: [PATCH V2] Support folding min(poly,poly) to const Lehua Ding writes: > Hi, > > This

Re: [PATCH] RISC-V: Suppress bogus warning for VLS types

2023-09-08 Thread Kito Cheng via Gcc-patches
LGTM Juzhe-Zhong 於 2023年9月8日 週五 16:20 寫道: > This patch fixes over 100+ bogus FAILs due to experimental vector ABI > warning. > > gcc/ChangeLog: > > * config/riscv/riscv.cc (riscv_pass_in_vector_p): Only allow RVV > type. > > --- > gcc/config/riscv/riscv.cc | 2 +- > 1 file changed, 1

Re: [Patch] contrib/gcc-changelog: Check whether revert-commit exists

2023-09-08 Thread Christophe Lyon via Gcc-patches
On Thu, 7 Sept 2023 at 11:45, Jakub Jelinek wrote: > On Thu, Sep 07, 2023 at 10:20:19AM +0200, Christophe Lyon via Gcc-patches > wrote: > > On Tue, 5 Sept 2023 at 16:38, Tobias Burnus > wrote: > > > > > That's based on the fail > > > https://gcc.gnu.org/pipermail/gccadmin/2023q3/020349.html > >

[PATCH] RISC-V: Suppress bogus warning for VLS types

2023-09-08 Thread Juzhe-Zhong
This patch fixes over 100+ bogus FAILs due to experimental vector ABI warning. gcc/ChangeLog: * config/riscv/riscv.cc (riscv_pass_in_vector_p): Only allow RVV type. --- gcc/config/riscv/riscv.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

RE: [PATCH] RISC-V: Fix incorrect nregs calculation for VLS modes

2023-09-08 Thread Li, Pan2 via Gcc-patches
Committed, thanks Kito. Pan -Original Message- From: Gcc-patches On Behalf Of Kito Cheng via Gcc-patches Sent: Friday, September 8, 2023 4:12 PM To: Juzhe-Zhong Cc: GCC Patches ; Kito Cheng Subject: Re: [PATCH] RISC-V: Fix incorrect nregs calculation for VLS modes LGTM Juzhe-Zhong

Re: [PATCH] riscv: thead: Fix mode attribute for extension patterns

2023-09-08 Thread Kito Cheng via Gcc-patches
LGTM Christoph Muellner 於 2023年9月8日 週五 14:16 寫道: > From: Christoph Müllner > > The mode attribute of an extension pattern is usually set to the target > type. > Let's follow this convention consistently for xtheadbb. > > Signed-off-by: Christoph Müllner > > gcc/ChangeLog: > > *

Re: [PATCH V2] Support folding min(poly,poly) to const

2023-09-08 Thread Richard Sandiford via Gcc-patches
Lehua Ding writes: > Hi, > > This patch adds support that tries to fold `MIN (poly, poly)` to > a constant. Consider the following C Code: > > ``` > void foo2 (int* restrict a, int* restrict b, int n) > { > for (int i = 0; i < 3; i += 1) > a[i] += b[i]; > } > ``` > > Before this patch:

Re: [PATCH] RISC-V: Fix incorrect nregs calculation for VLS modes

2023-09-08 Thread Kito Cheng via Gcc-patches
LGTM Juzhe-Zhong 於 2023年9月8日 週五 15:52 寫道: > This patch fixes obvious bug: TARGET_MIN_VLEN is bitsize. > > All these following bugs are fixed with this patch: > FAIL: gcc.target/riscv/zero-scratch-regs-3.c -O0 (internal compiler > error: in gen_reg_rtx, at emit-rtl.cc:1176) > FAIL:

Re: [PATCH] LoongArch: Enable -fsched-pressure by default at -O1 and higher.

2023-09-08 Thread Xi Ruoyao via Gcc-patches
On Fri, 2023-09-08 at 10:00 +0800, Guo Jie wrote: > gcc/ChangeLog: > > * common/config/loongarch/loongarch-common.cc: "common/" should be removed. You can use "git gcc-verify" to figure out this kind of error before sending a patch in the future. > (default_options

[PATCH] RISC-V: Fix incorrect nregs calculation for VLS modes

2023-09-08 Thread Juzhe-Zhong
This patch fixes obvious bug: TARGET_MIN_VLEN is bitsize. All these following bugs are fixed with this patch: FAIL: gcc.target/riscv/zero-scratch-regs-3.c -O0 (internal compiler error: in gen_reg_rtx, at emit-rtl.cc:1176) FAIL: gcc.target/riscv/zero-scratch-regs-3.c -O0 (test for excess

Re: [PATCH] Support folding min(poly,poly) to const

2023-09-08 Thread Lehua Ding
Hi Richard, On 2023/9/8 14:37, Richard Sandiford wrote: I think this should instead use poly_int_tree_p and wi::to_poly_widest. There's no need to handle int64 and uint64 separately. (And there's no need to handle just 64-bit types.) Thanks for the correction. I used wi::to_poly_wide(instead

[PATCH V2] Support folding min(poly,poly) to const

2023-09-08 Thread Lehua Ding
Hi, This patch adds support that tries to fold `MIN (poly, poly)` to a constant. Consider the following C Code: ``` void foo2 (int* restrict a, int* restrict b, int n) { for (int i = 0; i < 3; i += 1) a[i] += b[i]; } ``` Before this patch: ``` void foo2 (int * restrict a, int *

[PATCH] riscv: bitmanip: Remove duplicate zero_extendhi2 pattern

2023-09-08 Thread Christoph Muellner
From: Christoph Müllner We currently have two identical zero_extendhi2 patterns: * '*zero_extendhi2_zbb' * '*zero_extendhi2_bitmanip' This patch removes the *_zbb pattern and ensures that all sign- and zero-extensions use the postfix '_bitmanip'. Signed-off-by: Christoph Müllner

Re: [PATCH] Support folding min(poly,poly) to const

2023-09-08 Thread Richard Sandiford via Gcc-patches
Lehua Ding writes: > Hi, > > This patch adds support that tries to fold `MIN (poly, poly)` to > a constant. Consider the following C Code: > > ``` > void foo2 (int* restrict a, int* restrict b, int n) > { > for (int i = 0; i < 3; i += 1) > a[i] += b[i]; > } > ``` > > Before this patch:

Re: [PATCH V5 0/3] RISC-V: Add an experimental vector calling convention

2023-09-08 Thread Lehua Ding
Pushed to trunk with few testcase modifications, e.g. adding { target { riscv_vector } } to dg-run and adding -march / -mabi for compile tests. Thank you so much Kito for your help :) -- Best, Lehua

[PATCH] riscv: thead: Fix mode attribute for extension patterns

2023-09-08 Thread Christoph Muellner
From: Christoph Müllner The mode attribute of an extension pattern is usually set to the target type. Let's follow this convention consistently for xtheadbb. Signed-off-by: Christoph Müllner gcc/ChangeLog: * config/riscv/thead.md: Use more appropriate mode attributes for

Re: [PATCH] Support folding min(poly,poly) to const

2023-09-08 Thread Lehua Ding
Hi Andrew, On 2023/9/8 13:28, Andrew Pinski wrote: On Thu, Sep 7, 2023 at 10:25 PM Lehua Ding wrote: Hi, This patch adds support that tries to fold `MIN (poly, poly)` to a constant. Consider the following C Code: Does it make sense to handle max also? At the moment I can't construct a

[PATCH] riscv: xtheadbb: Fix extendqi insn

2023-09-08 Thread Christoph Muellner
From: Christoph Müllner Recently three SPEC CPU 2017 benchmarks broke when using xtheadbb: * 500.perlbench_r * 525.x264_r * 557.xz_r Tracing the issue down revealed, that we emit a 'th.ext xN,xN,15,0' for a extendqi insn, which is obviously wrong. This patch splits the common 'extend2_th_ext'