[PATCH] RISC-V: Fix incorrect VTYPE fusion for floating point scalar move insn[PR111037]

2023-08-16 Thread Juzhe-Zhong
void foo(_Float16 y, int64_t *i64p) { vint64m1_t vx =__riscv_vle64_v_i64m1 (i64p, 1); vx = __riscv_vadd_vv_i64m1 (vx, vx, 1); vfloat16m1_t vy =__riscv_vfmv_s_f_f16m1 (y, 1); asm volatile ("# use %0 %1" : : "vr"(vx), "vr" (vy)); } zve64f: foo: vsetivlizero,1,e16,mf4,ta,ma

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

2023-08-16 Thread Kees Cook via Gcc-patches
On Fri, Aug 04, 2023 at 07:44:28PM +, Qing Zhao wrote: > This is the 2nd version of the patch, per our discussion based on the > review comments for the 1st version, the major changes in this version I've been using Coccinelle to find and annotate[1] structures (193 so far...), and I've

Re: [PATCH ver 2] rs6000, add overloaded DFP quantize support

2023-08-16 Thread Kewen.Lin via Gcc-patches
on 2023/8/17 11:11, Peter Bergner wrote: > On 8/16/23 7:19 PM, Carl Love wrote: >> +(define_insn "dfp_dquan_" >> + [(set (match_operand:DDTD 0 "gpc_reg_operand" "=d") >> +(unspec:DDTD [(match_operand:DDTD 1 "gpc_reg_operand" "d") >> + (match_operand:DDTD 2

Re: [PATCH v2] RISCV: Add rotate immediate regression test

2023-08-16 Thread Jeff Law via Gcc-patches
On 8/16/23 19:17, Patrick O'Neill wrote: This adds new regression tests to ensure half-register rotations are correctly optimized into rori instructions. gcc/testsuite/ChangeLog: * gcc.target/riscv/zbb-rol-ror-08.c: New test. * gcc.target/riscv/zbb-rol-ror-09.c: New test.

Re: [PATCH] RISC-V: Support simplify (-1-x) for vector.

2023-08-16 Thread Jeff Law via Gcc-patches
On 8/16/23 02:40, yanzhang.wang--- via Gcc-patches wrote: From: Yanzhang Wang The pattern is enabled for scalar but not for vector. The patch try to make it consistent and will convert below code, shortcut_for_riscv_vrsub_case_1_32: vl1re32.v v1,0(a1) vsetvli

Re: [PATCH v3] LoongArch:Implement 128-bit floating point functions in gcc.

2023-08-16 Thread Xi Ruoyao via Gcc-patches
On Tue, 2023-08-15 at 20:03 +, Joseph Myers wrote: > On Tue, 15 Aug 2023, chenxiaolong wrote: > > > In the implementation process, the "q" suffix function is > >     Re-register and associate the "__float128" type with the > >     "long double" type so that the compiler can

Re: [PATCH v1] RISC-V: Support RVV VFREDUSUM.VS rounding mode intrinsic API

2023-08-16 Thread Kito Cheng via Gcc-patches
Lgtm Pan Li via Gcc-patches 於 2023年8月17日 週四,11:09寫道: > From: Pan Li > > This patch would like to support the rounding mode API for the > VFREDUSUM.VS as the below samples. > > * __riscv_vfredusum_vs_f32m1_f32m1_rm > * __riscv_vfredusum_vs_f32m1_f32m1_rm_m > > Signed-off-by: Pan Li > >

Re: [PATCH v1] RISC-V: Support RVV VFNCVT.F.{X|XU|F}.W rounding mode intrinsic API

2023-08-16 Thread Kito Cheng via Gcc-patches
Lgtm Pan Li via Gcc-patches 於 2023年8月17日 週四,10:19寫道: > From: Pan Li > > This patch would like to support the rounding mode API for the > VFNCVT.F.{X|XU|F}.W as the below samples. > > * __riscv_vfncvt_f_x_w_f32m1_rm > * __riscv_vfncvt_f_x_w_f32m1_rm_m > * __riscv_vfncvt_f_xu_w_f32m1_rm > *

Re: RISC-V: Added support for CRC.

2023-08-16 Thread Jeff Law via Gcc-patches
On 8/16/23 13:10, Alexander Monakov wrote: On Tue, 15 Aug 2023, Jeff Law wrote: Because if the compiler can optimize it automatically, then the projects have to do literally nothing to take advantage of it. They just compile normally and their bitwise CRC gets optimized down to either a

Re: [PATCH ver 2] rs6000, add overloaded DFP quantize support

2023-08-16 Thread Peter Bergner via Gcc-patches
On 8/16/23 7:19 PM, Carl Love wrote: > +(define_insn "dfp_dquan_" > + [(set (match_operand:DDTD 0 "gpc_reg_operand" "=d") > +(unspec:DDTD [(match_operand:DDTD 1 "gpc_reg_operand" "d") > + (match_operand:DDTD 2 "gpc_reg_operand" "d") > +

[PATCH v1] RISC-V: Support RVV VFREDUSUM.VS rounding mode intrinsic API

2023-08-16 Thread Pan Li via Gcc-patches
From: Pan Li This patch would like to support the rounding mode API for the VFREDUSUM.VS as the below samples. * __riscv_vfredusum_vs_f32m1_f32m1_rm * __riscv_vfredusum_vs_f32m1_f32m1_rm_m Signed-off-by: Pan Li gcc/ChangeLog: * config/riscv/riscv-vector-builtins-bases.cc

[PATCH v1] RISC-V: Support RVV VFNCVT.F.{X|XU|F}.W rounding mode intrinsic API

2023-08-16 Thread Pan Li via Gcc-patches
From: Pan Li This patch would like to support the rounding mode API for the VFNCVT.F.{X|XU|F}.W as the below samples. * __riscv_vfncvt_f_x_w_f32m1_rm * __riscv_vfncvt_f_x_w_f32m1_rm_m * __riscv_vfncvt_f_xu_w_f32m1_rm * __riscv_vfncvt_f_xu_w_f32m1_rm_m * __riscv_vfncvt_f_f_w_f32m1_rm *

RE: [PATCH v1] RISC-V: Support RVV VFNCVT.XU.F.W rounding mode intrinsic API

2023-08-16 Thread Li, Pan2 via Gcc-patches
Thanks Kito, will commit it after the VFNCVT.X.F.W one, aka the signed integer cvt. Pan -Original Message- From: Kito Cheng Sent: Thursday, August 17, 2023 9:30 AM To: Li, Pan2 Cc: gcc-patches@gcc.gnu.org; juzhe.zh...@rivai.ai; Wang, Yanzhang Subject: Re: [PATCH v1] RISC-V: Support

[PATCH] MATCH: Sink convert for vec_cond

2023-08-16 Thread Andrew Pinski via Gcc-patches
Convert be sinked into a vec_cond if both sides fold. Unlike other unary operations, we need to check that we still can handle this vec_cond's first operand is the same as the new truth type. I tried a few different versions of this patch: view_convert to the new truth_type but that does not work

Re: [PATCH] Add support for vector conitional not

2023-08-16 Thread Andrew Pinski via Gcc-patches
On Mon, Aug 14, 2023 at 2:54 PM Andrew Pinski wrote: > > On Mon, Aug 14, 2023 at 2:37 PM Richard Sandiford via Gcc-patches > wrote: > > > > Andrew Pinski via Gcc-patches writes: > > > Like the support conditional neg (r12-4470-g20dcda98ed376cb61c74b2c71), > > > this just adds conditional not

Re: [PATCH v1] RISC-V: Support RVV VFNCVT.XU.F.W rounding mode intrinsic API

2023-08-16 Thread Kito Cheng via Gcc-patches
LGTM On Thu, Aug 17, 2023 at 9:23 AM Pan Li via Gcc-patches wrote: > > From: Pan Li > > This patch would like to support the rounding mode API for the > VFNCVT.XU.F.W as the below samples. > > * __riscv_vfncvt_xu_f_w_u16mf2_rm > * __riscv_vfncvt_xu_f_w_u16mf2_rm_m > > Signed-off-by: Pan Li > >

[PATCH v1] RISC-V: Support RVV VFNCVT.XU.F.W rounding mode intrinsic API

2023-08-16 Thread Pan Li via Gcc-patches
From: Pan Li This patch would like to support the rounding mode API for the VFNCVT.XU.F.W as the below samples. * __riscv_vfncvt_xu_f_w_u16mf2_rm * __riscv_vfncvt_xu_f_w_u16mf2_rm_m Signed-off-by: Pan Li gcc/ChangeLog: * config/riscv/riscv-vector-builtins-bases.cc

[PATCH v2] RISCV: Add rotate immediate regression test

2023-08-16 Thread Patrick O'Neill
This adds new regression tests to ensure half-register rotations are correctly optimized into rori instructions. gcc/testsuite/ChangeLog: * gcc.target/riscv/zbb-rol-ror-08.c: New test. * gcc.target/riscv/zbb-rol-ror-09.c: New test. Co-authored-by: Charlie Jenkins Signed-off-by:

[PATCH ver 2] rs6000, add overloaded DFP quantize support

2023-08-16 Thread Carl Love via Gcc-patches
GCC maintainers: Version 2, renamed the built-in instances. Changed the name of the overloaded built-in. Added the missing documentation for the new built-ins. Fixed typos. Changed name of the test. Updated the effective target for the test. Retested the patch on Power 10LE and Power 8

Re: [PATCH] RISC-V: Fix reduc_strict_run-1 test case.

2023-08-16 Thread Palmer Dabbelt
On Wed, 16 Aug 2023 15:59:13 PDT (-0700), jeffreya...@gmail.com wrote: On 8/16/23 07:50, Robin Dapp wrote: But if it's a float16 precision issue then I would have expected both the computations for the lhs and rhs values to have suffered similarly. Yeah, right. I didn't look closely

Re: [PATCH] RISC-V: Add rotate immediate regression test

2023-08-16 Thread Andrew Pinski via Gcc-patches
On Wed, Aug 16, 2023 at 4:15 PM Patrick O'Neill wrote: > > This adds new regression tests to ensure half-register rotations are > correctly optimized into rori instructions. > > gcc/testsuite/ChangeLog: > > * gcc.target/riscv/zbb-rol-ror-04.c: Add half-register rotation > cases. >

[PATCH] RISC-V: Add rotate immediate regression test

2023-08-16 Thread Patrick O'Neill
This adds new regression tests to ensure half-register rotations are correctly optimized into rori instructions. gcc/testsuite/ChangeLog: * gcc.target/riscv/zbb-rol-ror-04.c: Add half-register rotation cases. * gcc.target/riscv/zbb-rol-ror-05.c: Add half-register rotation

Re: [PATCH] libgccjit: Add support for `restrict` attribute on function parameters

2023-08-16 Thread David Malcolm via Gcc-patches
On Wed, 2023-08-16 at 22:06 +0200, Guillaume Gomez via Jit wrote: > My apologies, forgot to run the commit checkers. Here's the commit > with the errors fixed. > > Le mer. 16 août 2023 à 18:32, Guillaume Gomez > a écrit : > > > > Hi, Hi Guillaume, thanks for the patch. > > > > This patch

Re: [PATCH] RISC-V: Fix reduc_strict_run-1 test case.

2023-08-16 Thread Jeff Law via Gcc-patches
On 8/16/23 07:50, Robin Dapp wrote: But if it's a float16 precision issue then I would have expected both the computations for the lhs and rhs values to have suffered similarly. Yeah, right. I didn't look closely enough. The problem is not the reduction but the additional return-value

Re: [PATCH] Drop unused enum vrp_mode.

2023-08-16 Thread Jeff Law via Gcc-patches
On 8/16/23 14:23, Sergei Trofimovich via Gcc-patches wrote: From: Sergei Trofimovich Follow removal of EVRP and clean up unused defines. gcc/ * flag-types.h (vrp_mode): Remove unused. OK jeff

Re: [PATCH] libstdc++: fix memory clobbering in std::vector [PR110879]

2023-08-16 Thread Jonathan Wakely via Gcc-patches
On 09/08/23 01:34 +0300, Vladimir Palevich wrote: Because of the recent change in _M_realloc_insert and _M_default_append, call to deallocate was ordered after assignment to class members of std::vector (in the guard destructor), which is causing said members to be call-clobbered. This is

Re: [PATCH v2 1/2] libstdc++: Implement more maintainable header

2023-08-16 Thread Andrew Pinski via Gcc-patches
On Wed, Aug 16, 2023 at 3:36 PM David Edelsohn via Gcc-patches wrote: > > Was the dependency added to the dependencies in contrib/gcc_update? > Otherwise the timestamp can get out of sync in a Git checkout. I checked in https://gcc.gnu.org/pipermail/gcc-patches/2023-August/627667.html which just

Re: [PATCH v2 1/2] libstdc++: Implement more maintainable header

2023-08-16 Thread David Edelsohn via Gcc-patches
Was the dependency added to the dependencies in contrib/gcc_update? Otherwise the timestamp can get out of sync in a Git checkout. Thanks, David On Wed, Aug 16, 2023 at 6:20 PM Jonathan Wakely wrote: > On Wed, 16 Aug 2023 at 22:56, Jonathan Wakely wrote: > > > > On Wed, 16 Aug 2023 at 22:39,

[PATCH] Add libstdc++-v3/include/bits/version.h to gcc_update touch part

2023-08-16 Thread Andrew Pinski via Gcc-patches
This adds libstdc++-v3/include/bits/version.h so it has the correct timestamp. Committed as obvious after running contrib/gcc_update --touch contrib/ChangeLog: * gcc_update: Add libstdc++-v3/include/bits/version.h. --- contrib/gcc_update | 1 + 1 file changed, 1 insertion(+) diff

Re: [WIP RFC v2] analyzer: Add support of placement new and improved operator new [PR105948]

2023-08-16 Thread David Malcolm via Gcc-patches
On Wed, 2023-08-16 at 14:19 +0200, priour...@gmail.com wrote: > From: benjamin priour > > Hi, > (s/we/the analyzer/) Hi Benjamin, thanks for the updated patch. > > I've been continuing my patch of supporting operator new variants > in the analyzer, and have added a few more test cases. > >

Re: [PATCH v2 1/2] libstdc++: Implement more maintainable header

2023-08-16 Thread Jonathan Wakely via Gcc-patches
On Wed, 16 Aug 2023 at 22:56, Jonathan Wakely wrote: > > On Wed, 16 Aug 2023 at 22:39, David Edelsohn wrote: > > > > Hi, Arsen > > > > This patch broke bootstrap because it has introduced a new GCC build > > requirement for autogen that is not a previous requirement to build GCC. > >

Re: [PATCH v2 1/2] libstdc++: Implement more maintainable header

2023-08-16 Thread Jonathan Wakely via Gcc-patches
On Wed, 16 Aug 2023 at 22:39, David Edelsohn wrote: > > Hi, Arsen > > This patch broke bootstrap because it has introduced a new GCC build > requirement for autogen that is not a previous requirement to build GCC. > Previously the repository has included post-processed files. The repo does

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

2023-08-16 Thread Qing Zhao via Gcc-patches
Hi, After some more studying and consideration, the following is my thoughts: For a structure with FMA annotated with counted_by attribute: (the following small example) struct annotated { size_t foo; char b; char array[] __attribute__((counted_by (foo))); };

Re: [PATCH v2 1/2] libstdc++: Implement more maintainable header

2023-08-16 Thread David Edelsohn via Gcc-patches
Hi, Arsen This patch broke bootstrap because it has introduced a new GCC build requirement for autogen that is not a previous requirement to build GCC. Previously the repository has included post-processed files. +# AutoGen . +.PHONY: update-version +update-version: + cd ${bits_srcdir} &&

[PING] Re: [PATCH v2] Re: [WIP] Have -Wpointer-sign be enabled by -Wextra, too [PR109836]

2023-08-16 Thread Eric Gallager via Gcc-patches
PING On Tue, Aug 8, 2023 at 8:17 PM Eric Gallager wrote: > > On Tue, May 30, 2023 at 5:42 PM Eric Gallager wrote: > > > > PR109836 is a request to have -Wpointer-sign enabled by default. There > > were points of disagreement raised in the bug report, so I figured > > that maybe as a compromise,

Re: RISC-V: Added support for CRC.

2023-08-16 Thread Paul Koning via Gcc-patches
> On Aug 16, 2023, at 3:42 PM, Philipp Tomsich wrote: > > On Wed, 16 Aug 2023 at 21:10, Alexander Monakov wrote: >> >> >> On Tue, 15 Aug 2023, Jeff Law wrote: >> >>> Because if the compiler can optimize it automatically, then the projects >>> have >>> to do literally nothing to take

[PATCH] Drop unused enum vrp_mode.

2023-08-16 Thread Sergei Trofimovich via Gcc-patches
From: Sergei Trofimovich Follow removal of EVRP and clean up unused defines. gcc/ * flag-types.h (vrp_mode): Remove unused. --- gcc/flag-types.h | 7 --- 1 file changed, 7 deletions(-) diff --git a/gcc/flag-types.h b/gcc/flag-types.h index 36305de589e..7466c1106f2 100644 ---

[PATCH,committed] Fortran: fix memleak for character,value dummy of bind(c) procedure [PR110360]

2023-08-16 Thread Harald Anlauf via Gcc-patches
Dear all, the attached simple patch fixes a memleak in the frontend when a character literal is passed to a character,value dummy of a bind(c) procedure, by relying on gfc_replace_expr to do the cleanup. (This can be tested e.g. with gfortran.dg/bind_c_usage_13.f03 and running f951 under

Re: Another bug for __builtin_object_size? (Or expected behavior)

2023-08-16 Thread Qing Zhao via Gcc-patches
FYI, I filed a new PR https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111040 to record this issue. Qing > On Aug 16, 2023, at 11:59 AM, Qing Zhao via Gcc-patches > wrote: > > Jakub and Sid, > > During my study, I found an interesting behavior for the following small > testing case: > >

Re: [PATCH] libgccjit: Add support for `restrict` attribute on function parameters

2023-08-16 Thread Guillaume Gomez via Gcc-patches
My apologies, forgot to run the commit checkers. Here's the commit with the errors fixed. Le mer. 16 août 2023 à 18:32, Guillaume Gomez a écrit : > > Hi, > > This patch adds the possibility to specify the __restrict__ attribute > for function parameters. It is used by the Rust GCC backend. > >

Re: RISC-V: Added support for CRC.

2023-08-16 Thread Philipp Tomsich
On Wed, 16 Aug 2023 at 21:10, Alexander Monakov wrote: > > > On Tue, 15 Aug 2023, Jeff Law wrote: > > > Because if the compiler can optimize it automatically, then the projects > > have > > to do literally nothing to take advantage of it. They just compile normally > > and their bitwise CRC

Re: [PATCH v3][RFC] c-family: Implement __has_feature and __has_extension [PR60512]

2023-08-16 Thread Iain Sandoe
Hi Alex, > On 3 Aug 2023, at 10:21, Alex Coplan wrote: > > This patch implements clang's __has_feature and __has_extension in GCC. > This is a v3 which addresses feedback for the v2 patch posted here: > > https://gcc.gnu.org/pipermail/gcc-patches/2023-August/626058.html > > Main changes

Re: [PATCH] fixincludes: Update darwin_flt_eval_method for macOS 14

2023-08-16 Thread Bruce Korb via Gcc-patches
Looks reasonable to me! On 8/16/23 12:20, Rainer Orth wrote: On macOS 14, a guard in changed: -- MacOSX13.3.sdk/usr/include/math.h2023-04-19 01:54:44 +++ MacOSX14.0.sdk/usr/include/math.h 2023-08-01 08:42:43 @@ -22,0 +23 @@ + @@ -43 +44 @@ -#if __FLT_EVAL_METHOD__ == 0 +#if

Re: [PATCH] build: Allow for Xcode 15 ld -v output

2023-08-16 Thread Rainer Orth
Hi Iain, > OK, thanks > (I do not yet have an xcode-15 or darwin23 setup) Xcode 15 beta claims to also support macOS 13/Darwin 22, though I haven't tried this. > After some bake time, this will need backporting to open branches, to avoid > those also failing in the same way, Agreed: those

Re: [PATCH] fixincludes: Update darwin_flt_eval_method for macOS 14

2023-08-16 Thread Iain Sandoe
Hi Rainer, > On 16 Aug 2023, at 20:20, Rainer Orth wrote: > > On macOS 14, a guard in changed: > > -- MacOSX13.3.sdk/usr/include/math.h 2023-04-19 01:54:44 > +++ MacOSX14.0.sdk/usr/include/math.h 2023-08-01 08:42:43 > @@ -22,0 +23 @@ > + > @@ -43 +44 @@ > -#if __FLT_EVAL_METHOD__ == 0 > +#if

Re: [PATCH] build: Allow for Xcode 15 ld -v output

2023-08-16 Thread Iain Sandoe
Hi Rainer, > On 16 Aug 2023, at 20:13, Rainer Orth wrote: > > Since Xcode 15 beta 6, ld -v output differs from previous versions: > > * macOS 13/Xcode 14: > > @(#)PROGRAM:ld PROJECT:ld64-857.1 > > * macOS 14/Xcode 15: > > @(#)PROGRAM:ld PROJECT:dyld-1015.1 > > configure cannot handle

[PATCH] fixincludes: Update darwin_flt_eval_method for macOS 14

2023-08-16 Thread Rainer Orth
On macOS 14, a guard in changed: -- MacOSX13.3.sdk/usr/include/math.h2023-04-19 01:54:44 +++ MacOSX14.0.sdk/usr/include/math.h 2023-08-01 08:42:43 @@ -22,0 +23 @@ + @@ -43 +44 @@ -#if __FLT_EVAL_METHOD__ == 0 +#if __FLT_EVAL_METHOD__ == 0 || __FLT_EVAL_METHOD__ == -1 @@ -49 +50 @@ -#elif

[PATCH] build: Allow for Xcode 15 ld -v output

2023-08-16 Thread Rainer Orth
Since Xcode 15 beta 6, ld -v output differs from previous versions: * macOS 13/Xcode 14: @(#)PROGRAM:ld PROJECT:ld64-857.1 * macOS 14/Xcode 15: @(#)PROGRAM:ld PROJECT:dyld-1015.1 configure cannot handle the new form, so LD64_VERSION isn't set. This patch fixes this. The autoconf

Re: RISC-V: Added support for CRC.

2023-08-16 Thread Alexander Monakov
On Tue, 15 Aug 2023, Jeff Law wrote: > Because if the compiler can optimize it automatically, then the projects have > to do literally nothing to take advantage of it. They just compile normally > and their bitwise CRC gets optimized down to either a table lookup or a clmul > variant. That's

[committed] libstdc++: Fix std::basic_string::resize_and_overwrite

2023-08-16 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. This should be backported to gcc-12 and gcc-13 too (without the std::format test changes). -- >8 -- The callable used for resize_and_overwrite was being passed the string's expanded capacity, which might be greater than the new size being requested. This is

[committed] libstdc++: Update __cplusplus value for C++23 in version.def

2023-08-16 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * include/bits/version.def (stds): Update value for C++23. * include/bits/version.h: Regenerate. --- libstdc++-v3/include/bits/version.def | 2 +- libstdc++-v3/include/bits/version.h | 72

Re: [PATCH] config-list.mk Darwin: Use --with-gnu-as

2023-08-16 Thread Jan-Benedict Glaw
Hi Rainer! On Tue, 2023-08-15 21:49:37 +0200, Rainer Orth wrote: > > config-list.mk Darwin: Use --with-gnu-as for mass-building tests > > > > As `config-list.mk` is probably mostly used on Linux system, where > > Apple's tools aren't around. Let's use --with-gnu-as instead to have > > an

Re: [PATCH] libstdc++: fix memory clobbering in std::vector [PR110879]

2023-08-16 Thread Jonathan Wakely via Gcc-patches
On 09/08/23 01:34 +0300, Vladimir Palevich wrote: Because of the recent change in _M_realloc_insert and _M_default_append, call to deallocate was ordered after assignment to class members of std::vector (in the guard destructor), which is causing said members to be call-clobbered. This is

Re: [PATCH 1/2] libstdc++: Convert _RangeAdaptorClosure into a CRTP class [PR108827]

2023-08-16 Thread Jonathan Wakely via Gcc-patches
On Wed, 16 Aug 2023 at 17:06, Patrick Palka via Libstdc++ wrote: > > On Sun, Apr 16, 2023 at 11:24 PM Patrick Palka wrote: > > > > On Fri, 14 Apr 2023, Patrick Palka wrote: > > > > > Using the CRTP idiom for this base class avoids bloating the size of a > > > pipeline when adding distinct empty

Re: [PATCH] libstdc++: Make __max_size_type and __max_diff_type structural

2023-08-16 Thread Jonathan Wakely via Gcc-patches
On Wed, 16 Aug 2023 at 17:07, Patrick Palka via Libstdc++ wrote: > > On Mon, Apr 24, 2023 at 12:23 PM Patrick Palka wrote: > > > > This patch makes these integer-class type structural types by changing > > their private data members into public ones, which allows them to be > > used as NTTP

Re: [PATCH] libstdc++: Implement P2770R0 changes to join_view / join_with_view

2023-08-16 Thread Jonathan Wakely via Gcc-patches
On Wed, 16 Aug 2023 at 17:05, Patrick Palka via Libstdc++ wrote: > > On Mon, Apr 17, 2023 at 9:39 AM Patrick Palka wrote: > > > > This C++23 paper fixes a bug in these views when adapting a certain kind > > of non-forward range, and we treat it as a DR against C++20. > > > > Tested on

Re: [PATCH] libstdc++ Add cstdarg to freestanding

2023-08-16 Thread Paul M. Bendixen via Gcc-patches
Yes, the other files are in another committee proposal, and I'm working my way through the proposals one by one. Thank you for the feedback, I'll update and resend /Paul Den ons. 16. aug. 2023 kl. 15.51 skrev Arsen Arsenović : > > Jonathan Wakely writes: > > > On Fri, 21 Jul 2023 at 22:23, Paul

[PATCH] libgccjit: Add support for `restrict` attribute on function parameters

2023-08-16 Thread Guillaume Gomez via Gcc-patches
Hi, This patch adds the possibility to specify the __restrict__ attribute for function parameters. It is used by the Rust GCC backend. Thanks in advance for the review. From 8cafadb8409094c7fc66a1073397942a60cb27b3 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 11 Aug 2023 22:48:11

[committed] libstdc++: Fix comment naming upstream PSTL test file

2023-08-16 Thread Jonathan Wakely via Gcc-patches
Pushed to trunk. -- >8 -- These tests were derived from set.pass.cpp not set.pass.cc, specifically pstl/test/std/algorithms/alg.sorting/alg.set.operations/set.pass.cpp in the LLVM repo. libstdc++-v3/ChangeLog: * testsuite/25_algorithms/pstl/alg_sorting/set_difference.cc: Fix

[pushed][LRA]: Spill pseudos assigned to fp when fp->sp elimination became impossible

2023-08-16 Thread Vladimir Makarov via Gcc-patches
The attached patch fixes recently found wrong insn removal in LRA port for AVR. The patch was successfully tested and bootstrapped on x86-64 and aarch64. commit 748a77558ff37761faa234e19327ad1decaace33 Author: Vladimir N. Makarov Date: Wed Aug 16 09:13:54 2023 -0400 [LRA]: Spill

Re: [PATCH] libstdc++: Make __max_size_type and __max_diff_type structural

2023-08-16 Thread Patrick Palka via Gcc-patches
On Mon, Apr 24, 2023 at 12:23 PM Patrick Palka wrote: > > This patch makes these integer-class type structural types by changing > their private data members into public ones, which allows them to be > used as NTTP types. I'm not sure if this is required by the standard > but it seems handy. > >

Re: [PATCH 1/2] libstdc++: Convert _RangeAdaptorClosure into a CRTP class [PR108827]

2023-08-16 Thread Patrick Palka via Gcc-patches
On Sun, Apr 16, 2023 at 11:24 PM Patrick Palka wrote: > > On Fri, 14 Apr 2023, Patrick Palka wrote: > > > Using the CRTP idiom for this base class avoids bloating the size of a > > pipeline when adding distinct empty range adaptor closure objects to it, > > as detailed in section 4.1 of P2387R3.

Re: [PATCH] libstdc++: Implement P2770R0 changes to join_view / join_with_view

2023-08-16 Thread Patrick Palka via Gcc-patches
On Mon, Apr 17, 2023 at 9:39 AM Patrick Palka wrote: > > This C++23 paper fixes a bug in these views when adapting a certain kind > of non-forward range, and we treat it as a DR against C++20. > > Tested on x86_64-pc-linux-gnu, does this look OK for GCC 13? This > is an ABI change for join_view

Re: [RFC] GCC Security policy

2023-08-16 Thread Alexander Monakov
On Wed, 16 Aug 2023, Siddhesh Poyarekar wrote: > > Yeah, indicating scenarios that fall outside of intended guarantees should > > be helpful. I feel the exact text quoted above will be hard to decipher > > without knowing the discussion that led to it. Some sort of supplementary > > section

Another bug for __builtin_object_size? (Or expected behavior)

2023-08-16 Thread Qing Zhao via Gcc-patches
Jakub and Sid, During my study, I found an interesting behavior for the following small testing case: #include #include struct fixed { size_t foo; char b; char array[10]; } q = {}; #define noinline __attribute__((__noinline__)) static void noinline bar () { struct fixed *p =

Re: [RFC] GCC Security policy

2023-08-16 Thread Siddhesh Poyarekar
On 2023-08-16 11:06, Alexander Monakov wrote: No I understood the distinction you're trying to make, I just wanted to point out that the effect isn't all that different. The intent of the wording is not to prescribe a solution, but to describe what the compiler cannot do and hence, users must

Re: [RFC] GCC Security policy

2023-08-16 Thread Alexander Monakov
On Wed, 16 Aug 2023, Siddhesh Poyarekar wrote: > No I understood the distinction you're trying to make, I just wanted to point > out that the effect isn't all that different. The intent of the wording is > not to prescribe a solution, but to describe what the compiler cannot do and > hence,

Re: [PATCH] libstdc++ Add cstdarg to freestanding

2023-08-16 Thread Arsen Arsenović via Gcc-patches
Jonathan Wakely writes: > On Fri, 21 Jul 2023 at 22:23, Paul M. Bendixen via Libstdc++ > wrote: >> >> P1642 includes the header cstdarg to the freestanding implementation. >> This was probably left out by accident, this patch puts it in. >> Since this is one of the headers that go in whole

Re: [PATCH] RISC-V: Fix reduc_strict_run-1 test case.

2023-08-16 Thread Robin Dapp via Gcc-patches
> But if it's a float16 precision issue then I would have expected both > the computations for the lhs and rhs values to have suffered > similarly. Yeah, right. I didn't look closely enough. The problem is not the reduction but the additional return-value conversion that is omitted when

[WIP RFC v2] analyzer: Add support of placement new and improved operator new [PR105948]

2023-08-16 Thread Benjamin Priour via Gcc-patches
From: benjamin priour Hi, (s/we/the analyzer/) I've been continuing my patch of supporting operator new variants in the analyzer, and have added a few more test cases. > > If "y" is null then the allocation failed and dereferencing "y" will > > cause > > a segfault, not a

Re: [WIP RFC] Add support for keyword-based attributes

2023-08-16 Thread Joseph Myers
On Wed, 16 Aug 2023, Richard Sandiford via Gcc-patches wrote: > Would it be OK to add support for: > > [[__extension__ ...]] > > to suppress the pedwarn about using [[]] prior to C2X? Then we can That seems like a plausible feature to add. -- Joseph S. Myers jos...@codesourcery.com

[PATCH] RISC-V: Add COND_LEN_FNMA/COND_LEN_FMS/COND_LEN_FNMS testcases

2023-08-16 Thread Juzhe-Zhong
This patch is depending on middle-end patch: https://gcc.gnu.org/pipermail/gcc-patches/2023-August/627621.html We already had COND_LEN_FNMA/COND_LEN_FMS/COND_FNMS patterns. Remove TARGET_PREFERRED_ELSE_VALUE since it forbid the COND_LEN_FMS/COND_LEN_FNMS STMT fold. gcc/ChangeLog: *

Re: [PATCH v2 2/2] libstdc++: Replace all manual FTM definitions and use

2023-08-16 Thread Arsen Arsenović via Gcc-patches
Jonathan Wakely writes: > [..snip..] > Thanks for adding the comments like "// C++ < 20". > > I think in the comment on the #endif can be just __cpp_lib_any > rather than defined(__cpp_lib_any). Similarly for > __cpp_lib_atomic_float in . Oh, and __cpp_lib_atomic_ref. And > in , and several

Re: [PATCH v3] LoongArch:Implement 128-bit floating point functions in gcc.

2023-08-16 Thread Joseph Myers
On Wed, 16 Aug 2023, chenxiaolong wrote: > Thanks for the tip! Similar functions (e.g. __builtin_fabsf128 > (_Float128 a) are already supported by the compiler and can be handled > correctly, but functions that can be implemented on the LoongArch > architecture directly using the "bstrins"

[PATCH] gimple_fold: Support COND_LEN_FNMA/COND_LEN_FMS/COND_LEN_FNMS gimple fold

2023-08-16 Thread Juzhe-Zhong
Hi, Richard and Richi. Currently, GCC support COND_LEN_FMA for floating-point **NO** -ffast-math. It's supported in tree-ssa-math-opts.cc. However, GCC failed to support COND_LEN_FNMA/COND_LEN_FMS/COND_LEN_FNMS. Consider this following case: #define TEST_TYPE(TYPE)

Re: [RFC] GCC Security policy

2023-08-16 Thread Paul Koning via Gcc-patches
> On Aug 16, 2023, at 3:53 AM, Alexander Monakov wrote: > >> ... >> Is "timing-safety" a security property? Not the way I understand that >> term. It sounds like another way to say that the code meets real time >> constraints or requirements. > > I meant in the sense of not admitting

[PATCH v1] RISC-V: Support RVV VFNCVT.X.F.W rounding mode intrinsic API

2023-08-16 Thread Pan Li via Gcc-patches
From: Pan Li This patch would like to support the rounding mode API for the VFNCVT.X.F.W as the below samples. * __riscv_vfncvt_x_f_w_i16mf2_rm * __riscv_vfncvt_x_f_w_i16mf2_rm_m Signed-off-by: Pan Li gcc/ChangeLog: * config/riscv/riscv-vector-builtins-bases.cc (class

Re: [RFC] GCC Security policy

2023-08-16 Thread Siddhesh Poyarekar
On 2023-08-15 19:07, Alexander Monakov wrote: On Tue, 15 Aug 2023, Siddhesh Poyarekar wrote: Thanks, this is nicer (see notes below). My main concern is that we shouldn't pretend there's some method of verifying that arbitrary source code is "safe" to pass to an unsandboxed compiler, nor

Re: [RFC] GCC Security policy

2023-08-16 Thread Alexander Monakov
> > Unfortunately the lines that follow: > > > >> either sanitized by an external program to allow only trusted, > >> safe compilation and execution in the context of the application, > > > > again make a reference to a purely theoretical "external program" that > > is not going to

Re: [RFC] GCC Security policy

2023-08-16 Thread Siddhesh Poyarekar
On 2023-08-16 04:25, Alexander Monakov wrote: On Tue, 15 Aug 2023, David Malcolm via Gcc-patches wrote: I'd prefer to reword this, as libgccjit was a poor choice of name for the library (sorry!), to make it clearer it can be used for both ahead- of-time and just-in-time compilation, and that

Re: [RFC] [v2] Extend fold_vec_perm to handle VLA vectors

2023-08-16 Thread Prathamesh Kulkarni via Gcc-patches
On Wed, 16 Aug 2023 at 15:21, Richard Sandiford wrote: > > Prathamesh Kulkarni writes: > >> Unfortunately, the patch regressed following tests on ppc64le and > >> armhf respectively: > >> gcc.target/powerpc/vec-perm-ctor.c scan-tree-dump-not optimized > >> "VIEW_CONVERT_EXPR" > >>

Re: [PATCH] libstdc++ Add cstdarg to freestanding

2023-08-16 Thread Jonathan Wakely via Gcc-patches
On Fri, 21 Jul 2023 at 22:23, Paul M. Bendixen via Libstdc++ wrote: > > P1642 includes the header cstdarg to the freestanding implementation. > This was probably left out by accident, this patch puts it in. > Since this is one of the headers that go in whole cloth, there should be no > further

Re: [PATCH v2 2/2] libstdc++: Replace all manual FTM definitions and use

2023-08-16 Thread Jonathan Wakely via Gcc-patches
On Sun, 13 Aug 2023 at 21:16, Arsen Arsenović via Libstdc++ wrote: > > libstdc++-v3/ChangeLog: > > * libsupc++/typeinfo: Switch to bits/version.h for > __cpp_lib_constexpr_typeinfo. > * libsupc++/new: Switch to bits/version.h for >

Re: [PATCH v2 1/2] libstdc++: Implement more maintainable header

2023-08-16 Thread Jonathan Wakely via Gcc-patches
On Sun, 13 Aug 2023 at 21:15, Arsen Arsenović via Libstdc++ wrote: > > This commit replaces the ad-hoc logic in with an AutoGen > database that (mostly) declaratively generates a version.h bit which > combines all of the FTM logic across all headers together. > > This generated header defines

Re: [WIP RFC] Add support for keyword-based attributes

2023-08-16 Thread Richard Sandiford via Gcc-patches
Joseph Myers writes: > On Mon, 17 Jul 2023, Michael Matz via Gcc-patches wrote: > >> So, essentially you want unignorable attributes, right? Then implement >> exactly that: add one new keyword "__known_attribute__" (invent a better >> name, maybe :) ), semantics exactly as with __attribute__

Re: [PATCH v2][GCC] aarch64: Add support for Cortex-A720 CPU

2023-08-16 Thread Richard Sandiford via Gcc-patches
Richard Ball writes: > v2: Add missing PROFILE feature flag. > > This patch adds support for the Cortex-A720 CPU to GCC. > > No regressions on aarch64-none-elf. > > Ok for master? > > gcc/ChangeLog: > > * config/aarch64/aarch64-cores.def (AARCH64_CORE): Add Cortex- > A720 CPU. >

Re: [PATCH v3] LoongArch:Implement 128-bit floating point functions in gcc.

2023-08-16 Thread chenxiaolong
Thanks for the tip! Similar functions (e.g. __builtin_fabsf128 (_Float128 a) are already supported by the compiler and can be handled correctly, but functions that can be implemented on the LoongArch architecture directly using the "bstrins" directive (e.g. fabsq, copysignq, etc.) are better

Re: [PATCH] IFN: Fix vector extraction into promoted subreg.

2023-08-16 Thread Richard Sandiford via Gcc-patches
Robin Dapp writes: >> However: >> >> | #define vec_extract_direct { 3, 3, false } >> >> This looks wrong. The numbers are argument numbers (or -1 for a return >> value). vec_extract only takes 2 arguments, so 3 looks to be out-of-range. >> >> | #define direct_vec_extract_optab_supported_p

RE: [PATCH v2] RISC-V: Support RVV VFWCVT.XU.F.V rounding mode intrinsic API

2023-08-16 Thread Li, Pan2 via Gcc-patches
Committed, thanks Kito. Pan -Original Message- From: Kito Cheng Sent: Wednesday, August 16, 2023 5:54 PM To: Li, Pan2 Cc: gcc-patches@gcc.gnu.org; juzhe.zh...@rivai.ai; kito.ch...@sifive.com; Wang, Yanzhang Subject: Re: [PATCH v2] RISC-V: Support RVV VFWCVT.XU.F.V rounding mode

RE: [PATCH v1] RISC-V: Fix one build error for template default arg

2023-08-16 Thread Li, Pan2 via Gcc-patches
Committed, thanks Kito. Pan -Original Message- From: Kito Cheng Sent: Wednesday, August 16, 2023 5:49 PM To: Li, Pan2 Cc: gcc-patches@gcc.gnu.org; juzhe.zh...@rivai.ai; kito.ch...@sifive.com; Wang, Yanzhang Subject: Re: [PATCH v1] RISC-V: Fix one build error for template default arg

Re: [PATCH v2] RISC-V: Support RVV VFWCVT.XU.F.V rounding mode intrinsic API

2023-08-16 Thread Kito Cheng via Gcc-patches
ok On Wed, Aug 16, 2023 at 4:10 PM Pan Li via Gcc-patches wrote: > > From: Pan Li > > This patch would like to support the rounding mode API for the > VFWCVT.X.F.V as the below samples. > > * __riscv_vfwcvt_xu_f_v_u64m2_rm > * __riscv_vfwcvt_xu_f_v_u64m2_rm_m > > Signed-off-by: Pan Li > >

Re: [RFC] [v2] Extend fold_vec_perm to handle VLA vectors

2023-08-16 Thread Richard Sandiford via Gcc-patches
Prathamesh Kulkarni writes: >> Unfortunately, the patch regressed following tests on ppc64le and >> armhf respectively: >> gcc.target/powerpc/vec-perm-ctor.c scan-tree-dump-not optimized >> "VIEW_CONVERT_EXPR" >> gcc.dg/tree-ssa/forwprop-20.c scan-tree-dump-not forwprop1 "VEC_PERM_EXPR" >> >>

Re: [PATCH v1] RISC-V: Fix one build error for template default arg

2023-08-16 Thread Kito Cheng via Gcc-patches
ok On Wed, Aug 16, 2023 at 5:44 PM Pan Li via Gcc-patches wrote: > > From: Pan Li > > In some build option combination, the default value may result in > below error. This patch would like to fix it by passing a explict > argument. > > riscv-vector-builtins-bases.cc:2495:24: error: invalid use

[PATCH v1] RISC-V: Fix one build error for template default arg

2023-08-16 Thread Pan Li via Gcc-patches
From: Pan Li In some build option combination, the default value may result in below error. This patch would like to fix it by passing a explict argument. riscv-vector-builtins-bases.cc:2495:24: error: invalid use of template-name \ ‘riscv_vector::vfcvt_f’ without an argument list

Re: [PATCH] IFN: Fix vector extraction into promoted subreg.

2023-08-16 Thread Robin Dapp via Gcc-patches
> However: > > | #define vec_extract_direct { 3, 3, false } > > This looks wrong. The numbers are argument numbers (or -1 for a return > value). vec_extract only takes 2 arguments, so 3 looks to be out-of-range. > > | #define direct_vec_extract_optab_supported_p direct_optab_supported_p > >

Re: [RFC] GCC Security policy

2023-08-16 Thread Toon Moene
On 8/16/23 01:07, Alexander Monakov wrote: On Tue, 15 Aug 2023, Siddhesh Poyarekar wrote: Thanks, this is nicer (see notes below). My main concern is that we shouldn't pretend there's some method of verifying that arbitrary source code is "safe" to pass to an unsandboxed compiler, nor should

Re: Re: [PATCH 1/4][V4][RISC-V] support cm.push cm.pop cm.popret in zcmp

2023-08-16 Thread Fei Gao
Hi Kito Thanks for reporting these 2 issues.  Let me check and feedback you soon.  BR Fei On 2023-08-16 16:38  Kito Cheng wrote: > >Another fail case for CFI: > >$ riscv64-unknown-elf-gcc _mulhc3.i >-march=rv64imafd_zicsr_zifencei_zca_zcmp -mabi=lp64d -g  -O2  -o >_mulhc3.s > >typedef float a

Re: [RFC] [v2] Extend fold_vec_perm to handle VLA vectors

2023-08-16 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 15 Aug 2023 at 16:59, Prathamesh Kulkarni wrote: > > On Mon, 14 Aug 2023 at 18:23, Richard Sandiford > wrote: > > > > Prathamesh Kulkarni writes: > > > On Thu, 10 Aug 2023 at 21:27, Richard Sandiford > > > wrote: > > >> > > >> Prathamesh Kulkarni writes: > > >> >> static bool > > >>

[PATCH] RISC-V: Support simplify (-1-x) for vector.

2023-08-16 Thread yanzhang.wang--- via Gcc-patches
From: Yanzhang Wang The pattern is enabled for scalar but not for vector. The patch try to make it consistent and will convert below code, shortcut_for_riscv_vrsub_case_1_32: vl1re32.v v1,0(a1) vsetvli zero,a2,e32,m1,ta,ma vrsub.viv1,v1,-1 vs1r.v

Re: [PATCH 1/4][V4][RISC-V] support cm.push cm.pop cm.popret in zcmp

2023-08-16 Thread Kito Cheng via Gcc-patches
Another fail case for CFI: $ riscv64-unknown-elf-gcc _mulhc3.i -march=rv64imafd_zicsr_zifencei_zca_zcmp -mabi=lp64d -g -O2 -o _mulhc3.s typedef float a __attribute__((mode(HF))); b, c; f() { a a, d, e = a + d; if (g() && e) c = b; } 0x10e508a maybe_record_trace_start

  1   2   >