Re: ICE after folding svld1rq to vec_perm_expr duing forwprop

2022-07-12 Thread Richard Biener via Gcc-patches
On Tue, Jul 12, 2022 at 9:12 PM Prathamesh Kulkarni via Gcc-patches wrote: > > Hi Richard, > For the following test: > > svint32_t f2(int a, int b, int c, int d) > { > int32x4_t v = (int32x4_t) {a, b, c, d}; > return svld1rq_s32 (svptrue_b8 (), &v[0]); > } > > The compiler emits following ICE

[RFC] RISC-V: Add support for RV64E/lp64e

2022-07-12 Thread Palmer Dabbelt
gcc/ChangeLog * config.gcc (riscv): Accept rv64e and lp64e. * config/riscv/arch-canonicalize: Likewise. * config/riscv/riscv-c.cc (riscv_cpu_cpp_builtins): Likewise. * config/riscv/riscv-opts.h (riscv_abi_type): Likewise. * config/riscv/riscv.cc (riscv_optio

Re: [PATCH] [RFC]Support vectorization for Complex type.

2022-07-12 Thread Hongtao Liu via Gcc-patches
On Tue, Jul 12, 2022 at 10:12 PM Richard Biener wrote: > > On Tue, Jul 12, 2022 at 6:11 AM Hongtao Liu wrote: > > > > On Mon, Jul 11, 2022 at 7:47 PM Richard Biener via Gcc-patches > > wrote: > > > > > > On Mon, Jul 11, 2022 at 5:44 AM liuhongt wrote: > > > > > > > > The patch only handles load

Re: kernel sparse annotations vs. compiler attributes and debug_annotate_{type, decl} WAS: Re: [PATCH 0/9] Add debug_annotate attributes

2022-07-12 Thread Yonghong Song via Gcc-patches
On 7/7/22 1:24 PM, Jose E. Marchesi wrote: Hi Yonghong. On 6/21/22 9:12 AM, Jose E. Marchesi wrote: On 6/17/22 10:18 AM, Jose E. Marchesi wrote: Hi Yonghong. On 6/15/22 1:57 PM, David Faust wrote: On 6/14/22 22:53, Yonghong Song wrote: On 6/7/22 2:43 PM, David Faust wrote: Hello

Re: Mips: Fix kernel_stat structure size

2022-07-12 Thread Xi Ruoyao via Gcc-patches
On Tue, 2022-07-12 at 06:42 +, Dimitrije Milosevic wrote: > I will send out a review, covering both 32 ABIs, meaning that both O32 > and N32 ABIs will be working properly. Please CC me (@xry111) in LLVM review. By the way, if you have some spare time, you can also add the value for Musl (all

[PATCH 1/1 V5] RISC-V: Support Zmmul extension

2022-07-12 Thread shihua
From: LiaoShihua gcc/ChangeLog: * common/config/riscv/riscv-common.cc: Add Zmmul. * config/riscv/riscv-opts.h (MASK_ZMMUL): New. (TARGET_ZMMUL): Ditto. * config/riscv/riscv.cc (riscv_option_override):Ditto. * config/riscv/riscv.md: Add Zmmul * conf

[PATCH 0/1 V5] RISC-V: Support Zmmul extension

2022-07-12 Thread shihua
From: LiaoShihua Zmmul extension is Multiply only extension for RISC-V.It implements the multiplication subset of the M extension. The encodings are identical to those of the corresponding M-extension instructions. LiaoShihua (1): RISC-V: Support Zmmul extension gcc/common/config/

Re: [PATCH] Add condition coverage profiling

2022-07-12 Thread Jørgen Kvalsvik via Gcc-patches
On 12/07/2022 16:05, Sebastian Huber wrote: > Hello Jørgen, > > thanks for the updated patch. I used it for a test suite run and the results > look quite good. > > Could you please add this hunk to your patch set: > > diff --git a/libgcc/libgcov-merge.c b/libgcc/libgcov-merge.c > index 89741f637

Re: Mips: Fix kernel_stat structure size

2022-07-12 Thread Xi Ruoyao via Gcc-patches
On Tue, 2022-07-12 at 06:42 +, Dimitrije Milosevic wrote: > Hi Hans-Peter, > You're right, this is not ok for the O32 ABI. Your change however, broke the > functionality > for the N32 ABI. AFAIK, the changes like this should go through LLVM first > (yours didn't), > so I will send out a revie

Re: [PATCH V2] btf: emit linkage information in BTF_KIND_FUNC entries

2022-07-12 Thread Indu Bhagat via Gcc-patches
On 7/12/22 8:13 AM, Jose E. Marchesi via Gcc-patches wrote: The kernel bpftool expects BTF_KIND_FUNC entries in BTF to include an annotation reflecting the linkage of functions (static, global). For whatever reason they abuse the `vlen' field of the BTF_KIND_FUNC entry instead of adding a varia

[committed] libstdc++: Check for EOF if extraction avoids buffer overflow [PR106248]

2022-07-12 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. Backports to gcc-12 and gcc-11 to follow. -- >8 -- In r11-2581-g17abcc77341584 (for LWG 2499) I added overflow checks to the pre-C++20 operator>>(istream&, char*) overload. Those checks can cause extraction to stop after filling the buffer, where previously

Re: [PATCH] c++: Add __reference_con{struc,ver}ts_from_temporary [PR104477]

2022-07-12 Thread Jason Merrill via Gcc-patches
On 7/12/22 16:10, Jason Merrill wrote: On 7/8/22 13:41, Marek Polacek wrote: This patch implements C++23 P2255R2, which adds two new type traits to detect reference binding to a temporary.  They can be used to detect code like    std::tuple t("meow"); which is incorrect because it always creat

Re: [PATCH] c++: Add __reference_con{struc,ver}ts_from_temporary [PR104477]

2022-07-12 Thread Jason Merrill via Gcc-patches
On 7/8/22 13:41, Marek Polacek wrote: This patch implements C++23 P2255R2, which adds two new type traits to detect reference binding to a temporary. They can be used to detect code like std::tuple t("meow"); which is incorrect because it always creates a dangling reference, because the std

Re: [PATCH 2/3] tree-cfg: do not duplicate returns_twice calls

2022-07-12 Thread Alexander Monakov via Gcc-patches
Apologies for the prolonged silence Richard, it is a bit of an obscure topic, and I was unsure I'd be able to handle any complications in a timely manner. I'm ready to revisit it now, please see below. On Mon, 17 Jan 2022, Richard Biener wrote: > On Fri, Jan 14, 2022 at 7:21 PM Alexander Monako

ICE after folding svld1rq to vec_perm_expr duing forwprop

2022-07-12 Thread Prathamesh Kulkarni via Gcc-patches
Hi Richard, For the following test: svint32_t f2(int a, int b, int c, int d) { int32x4_t v = (int32x4_t) {a, b, c, d}; return svld1rq_s32 (svptrue_b8 (), &v[0]); } The compiler emits following ICE with -O3 -mcpu=generic+sve: foo.c: In function ‘f2’: foo.c:4:11: error: non-trivial conversion i

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Jonathan Wakely via Gcc-patches
On Tue, 12 Jul 2022 at 19:58, Jonathan Wakely wrote: > [OFFLIST] Oops, sorry, reply-all fail. I meant to spare everybody any further musing on this topic. Really leaving the thread now!

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Jonathan Wakely via Gcc-patches
On Tue, 12 Jul 2022 at 19:41, Pedro Alves wrote: > > On 2022-07-12 7:36 p.m., Pedro Alves wrote: > > On 2022-07-12 7:22 p.m., Jonathan Wakely wrote: > >> > >> > >> On Tue, 12 Jul 2022, 17:40 Pedro Alves, >> > wrote: > >> > >> On 2022-07-12 4:14 p.m., Jonathan Wakely w

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Pedro Alves
On 2022-07-12 7:50 p.m., Jonathan Wakely wrote: > Yeah, and I don't think optimizing for indentation is the right trade off. > Putting something in a namespace with a three-letter name just so you don't > have to re-indent some statements in a few years seems odd. > > I see no technical difficu

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Jonathan Wakely via Gcc-patches
On Tue, 12 Jul 2022, 19:36 Pedro Alves, wrote: > On 2022-07-12 7:22 p.m., Jonathan Wakely wrote: > > > > > > On Tue, 12 Jul 2022, 17:40 Pedro Alves, pe...@palves.net>> wrote: > > > > On 2022-07-12 4:14 p.m., Jonathan Wakely wrote: > > > > >> So once GCC requires C++14, why would you wan

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Pedro Alves
On 2022-07-12 7:36 p.m., David Malcolm wrote: > On Tue, 2022-07-12 at 17:40 +0100, Pedro Alves wrote: >>> >> >> If that's the approach, then GCC should import std::unique_ptr, >> std::move, >> std::foo, std::bar into the gcc namespace too, no?  Are you really >> going >> to propose that? > > Pedr

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Pedro Alves
On 2022-07-12 7:36 p.m., Pedro Alves wrote: > On 2022-07-12 7:22 p.m., Jonathan Wakely wrote: >> >> >> On Tue, 12 Jul 2022, 17:40 Pedro Alves, > > wrote: >> >> On 2022-07-12 4:14 p.m., Jonathan Wakely wrote: >> >> >>  So once GCC requires C++14, why would you want t

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread David Malcolm via Gcc-patches
On Tue, 2022-07-12 at 17:40 +0100, Pedro Alves wrote: > On 2022-07-12 4:14 p.m., Jonathan Wakely wrote: > > > >  So once GCC requires C++14, why would you want to preserve I look forward to the happy day when we can use C++14 in GCC's implementation, but I don't see it happening anytime soon. GC

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Pedro Alves
On 2022-07-12 7:22 p.m., Jonathan Wakely wrote: > > > On Tue, 12 Jul 2022, 17:40 Pedro Alves, > wrote: > > On 2022-07-12 4:14 p.m., Jonathan Wakely wrote: > > >>  So once GCC requires C++14, why would you want to preserve > >> once-backported symbols in a n

Re: [PATCH] Fortran: error recovery simplifying PACK with invalid arguments [PR106049]

2022-07-12 Thread Harald Anlauf via Gcc-patches
As there were no comments, committed as r13-1650. Am 05.07.22 um 22:31 schrieb Harald Anlauf via Fortran: Dear all, poor error recovery while trying to simplify intrinsics with given invalid arguments seems to be a recurrent theme in testcases submitted by Gerhard. In the present case, simplif

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Jonathan Wakely via Gcc-patches
On Tue, 12 Jul 2022, 17:40 Pedro Alves, wrote: > On 2022-07-12 4:14 p.m., Jonathan Wakely wrote: > > >> So once GCC requires C++14, why would you want to preserve > >> once-backported symbols in a namespace other than std, when you no > longer have a reason to? > >> It will just be another unnec

Re: [PATCH v3, rs6000] Disable TImode from Bool expanders [PR100694, PR93123]

2022-07-12 Thread Segher Boessenkool
Hi! On Mon, Jul 04, 2022 at 02:27:42PM +0800, HAO CHEN GUI wrote: > This patch fails TImode for all 128-bit logical operation expanders. So > TImode splits to two DI registers during expand. Potential optimizations can > be taken after expand pass. Originally, the TImode logical operations are >

[PATCH v2] c++: Add __reference_con{struc,ver}ts_from_temporary [PR104477]

2022-07-12 Thread Marek Polacek via Gcc-patches
On Mon, Jul 11, 2022 at 11:19:19AM +0100, Jonathan Wakely wrote: > On Fri, 8 Jul 2022 at 18:41, Marek Polacek wrote: > > The patch also adds the relevant class and variable templates to > > . > > > + template > +struct reference_constructs_from_temp > orary > +: public __bool_constant<_

Re: [PATCH] c++: coroutines - Overlap variables in frame [PR105989]

2022-07-12 Thread Iain Sandoe
Hi Michal, > On 12 Jul 2022, at 16:14, Michal Jankovič wrote: > One other related thing I would like to investigate is reducing the > number of compiler generated variables in the frame, particularly > _Coro_destroy_fn and _Coro_self_handle. > > As I understand it, _Coro_destroy_fn just sets

Re: [PATCH v2] Simplify memchr with small constant strings

2022-07-12 Thread H.J. Lu via Gcc-patches
On Fri, Jul 8, 2022 at 5:54 AM Richard Biener wrote: > > On Thu, Jul 7, 2022 at 6:45 PM H.J. Lu wrote: > > > > When memchr is applied on a constant string of no more than the bytes of > > a word, simplify memchr by checking each byte in the constant string. > > > > int f (int a) > > { > >retu

Re: Mips: Fix kernel_stat structure size

2022-07-12 Thread Hans-Peter Nilsson
On Tue, 12 Jul 2022, Dimitrije Milosevic wrote: > Hi Hans-Peter, > You're right, this is not ok for the O32 ABI. Your change however, broke the > functionality > for the N32 ABI. That's just not true. There was no mips support for ASAN in gcc, hence nothing to break for N32. Maybe an anachronis

[PATCH] dwarf2.h (enum dwarf_source_language): Add new DWARF5 language codes.

2022-07-12 Thread Meghan Denny
Updated constants from diff --git a/include/dwarf2.h b/include/dwarf2.h index 40aa5a54f01..87bf764a4fb 100644 --- a/include/dwarf2.h +++ b/include/dwarf2.h @@ -373,6 +373,16 @@ enum dwarf_source_language DW_LANG_Fortran03 = 0x0022, DW_LANG_Fortran08 = 0x0023,

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Pedro Alves
On 2022-07-12 4:14 p.m., Jonathan Wakely wrote: >> So once GCC requires C++14, why would you want to preserve >> once-backported symbols in a namespace other than std, when you no longer >> have a reason to? >> It will just be another unnecessary thing that newcomers at that future time >> will

Re: [PATCH] i386 testsuite: cope with --enable-default-pie

2022-07-12 Thread Alexandre Oliva via Gcc-patches
On Jul 11, 2022, Mike Stump wrote: > Ok. >> PS: There's at least one additional FAIL with --enable-default-pie in >> the trunk, namely gcc.target/i386/mvc7.c >> WDYT? > Seems reasonable. Thanks, here's what I installed. i386 testsuite: cope with --enable-default-pie Running the testsuite o

Re: [PATCH] c++: dependence of constrained memfn from current inst [PR105842]

2022-07-12 Thread Jason Merrill via Gcc-patches
On 7/11/22 09:33, Patrick Palka wrote: Here we incorrectly deem the calls to func1, func2 and tmpl2 as ambiguous ahead of time ultimately because we mishandle dependence of a constrained member function from the current instantiation. In type_dependent_expression_p, we consider the dependence of

Re: [PATCH] c++: non-dependent call to consteval operator [PR105912]

2022-07-12 Thread Jason Merrill via Gcc-patches
On 7/11/22 21:27, Patrick Palka wrote: Here we were crashing when substituting a non-dependent call to a consteval operator, whose CALL_EXPR_OPERATOR_SYNTAX flag we try to propagate to the result, but the result isn't a CALL_EXPR since the called function is consteval. This patch fixes this by c

[PATCH 5/12 V2] arm: Implement target feature macros for PACBTI

2022-07-12 Thread Andrea Corallo via Gcc-patches
Richard Earnshaw writes: > On 28/04/2022 10:42, Andrea Corallo via Gcc-patches wrote: >> This patch implements target feature macros when PACBTI is enabled >> through the -march option or -mbranch-protection. The target feature >> macros __ARM_FEATURE_PAC_DEFAULT and __ARM_FEATURE_BTI_DEFAULT ar

Re: [PATCH] c++: coroutines - Overlap variables in frame [PR105989]

2022-07-12 Thread Michal Jankovič via Gcc-patches
Hi Iain, Thanks for the reply, this is my first time contributing and I am looking forward to your input. One other related thing I would like to investigate is reducing the number of compiler generated variables in the frame, particularly _Coro_destroy_fn and _Coro_self_handle. As I understan

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Jonathan Wakely via Gcc-patches
On Tue, 12 Jul 2022 at 15:06, Pedro Alves wrote: > > On 2022-07-12 2:45 p.m., Jonathan Wakely wrote: > > On Tue, 12 Jul 2022 at 14:24, Pedro Alves wrote: > >> > >> On 2022-07-12 1:25 a.m., David Malcolm via Gcc-patches wrote: > >> > >>> I tried adding it to gcc/system.h, but anything that uses it

[PATCH V2] btf: emit linkage information in BTF_KIND_FUNC entries

2022-07-12 Thread Jose E. Marchesi via Gcc-patches
The kernel bpftool expects BTF_KIND_FUNC entries in BTF to include an annotation reflecting the linkage of functions (static, global). For whatever reason they abuse the `vlen' field of the BTF_KIND_FUNC entry instead of adding a variable-part to the record like it is done with other entry kinds

Re: [PATCH] btf: emit linkage information in BTF_KIND_FUNC entries

2022-07-12 Thread Jose E. Marchesi via Gcc-patches
> On 7/8/22 11:30 AM, Jose E. Marchesi via Gcc-patches wrote: >> >> The kernel bpftool expects BTF_KIND_FUNC entries in BTF to include an >> annotation reflecting the linkage of functions (static, global). For >> whatever reason they (ab)use the `vlen' field of the BTF_KIND_FUNC entry >> instea

[PATCH v2 2/2] aarch64: Lower vcombine to GIMPLE

2022-07-12 Thread Andrew Carlotti via Gcc-patches
This lowers vcombine intrinsics to a GIMPLE vector constructor, which enables better optimisation during GIMPLE passes. gcc/ * config/aarch64/aarch64-builtins.c (aarch64_general_gimple_fold_builtin): Add combine. gcc/testsuite/ * gcc.target/aarch64/advsimd-intrinsics/com

[COMMITTED] Set nonzero bits from bitwise and operator in range-ops.

2022-07-12 Thread Aldy Hernandez via Gcc-patches
Now that nonzero bits are first class citizens in the range, we can keep better track of them in range-ops, especially the bitwise and operator. This patch sets the nonzero mask for the trivial case. In doing so, I've removed some old dead code that was an attempt to keep better track of masks.

[PATCH v2 1/2] aarch64: Don't return invalid GIMPLE assign statements

2022-07-12 Thread Andrew Carlotti via Gcc-patches
aarch64_general_gimple_fold_builtin doesn't check whether the LHS of a function call is null before converting it to an assign statement. To avoid returning an invalid GIMPLE statement in this case, we instead assign the expression result to a new (unused) variable. This change only affects code t

[PATCH] openmp: fix max_vf setting for amdgcn offloading

2022-07-12 Thread Andrew Stubbs
This patch ensures that the maximum vectorization factor used to set the "safelen" attribute on "omp simd" constructs is suitable for all the configured offload devices. Right now it makes the proper adjustment for NVPTX, but otherwise just uses a value suitable for the host system (always x86

Re: Modula-2: merge followup (brief update on the progress of the new linking implementation)

2022-07-12 Thread Rainer Orth
Hi Gaius, > many thanks for the patch and log of the failures. I've committed the > patch and rebuilt all Makefile.in's which are affected by m2. thanks. I've noticed that libgm2/configure has been generated with a patched autoconf which includes runstatedir, unlike the upstream version. It's

Re: [PATCH] [RFC]Support vectorization for Complex type.

2022-07-12 Thread Richard Biener via Gcc-patches
On Tue, Jul 12, 2022 at 6:11 AM Hongtao Liu wrote: > > On Mon, Jul 11, 2022 at 7:47 PM Richard Biener via Gcc-patches > wrote: > > > > On Mon, Jul 11, 2022 at 5:44 AM liuhongt wrote: > > > > > > The patch only handles load/store(including ctor/permutation, except > > > gather/scatter) for comple

Re: [PING][PATCH][gdb/build] Fix build breaker with --enabled-shared

2022-07-12 Thread Tom de Vries via Gcc-patches
On 7/12/22 15:59, Iain Sandoe wrote: Hi Tom On 12 Jul 2022, at 14:42, Tom de Vries via Gcc-patches wrote: [ dropped gdb-patches, since already applied there. ] On 6/27/22 15:38, Tom de Vries wrote: On 6/27/22 15:03, Tom de Vries wrote: Hi, When building gdb with --enabled-shared, I run i

Re: [PATCH] c++: coroutines - Overlap variables in frame [PR105989]

2022-07-12 Thread Iain Sandoe
Hi Michal, > On 12 Jul 2022, at 14:35, Michal Jankovič via Gcc-patches > wrote: > > Currently, coroutine frames store all variables of a coroutine separately, > even if their lifetime does not overlap (they are in distinct scopes). This > patch implements overlapping distinct variable scopes in

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Pedro Alves
On 2022-07-12 2:45 p.m., Jonathan Wakely wrote: > On Tue, 12 Jul 2022 at 14:24, Pedro Alves wrote: >> >> On 2022-07-12 1:25 a.m., David Malcolm via Gcc-patches wrote: >> >>> I tried adding it to gcc/system.h, but anything that uses it needs to >>> have std::unique_ptr declared, which meant forcibly

Re: [PATCH] Add condition coverage profiling

2022-07-12 Thread Sebastian Huber
Hello Jørgen, thanks for the updated patch. I used it for a test suite run and the results look quite good. Could you please add this hunk to your patch set: diff --git a/libgcc/libgcov-merge.c b/libgcc/libgcov-merge.c index 89741f637e1..9e3e8ee5657 100644 --- a/libgcc/libgcov-merge.c +++ b/l

Re: [PING][PATCH][gdb/build] Fix build breaker with --enabled-shared

2022-07-12 Thread Iain Sandoe via Gcc-patches
Hi Tom > On 12 Jul 2022, at 14:42, Tom de Vries via Gcc-patches > wrote: > > [ dropped gdb-patches, since already applied there. ] > > On 6/27/22 15:38, Tom de Vries wrote: >> On 6/27/22 15:03, Tom de Vries wrote: >>> Hi, >>> >>> When building gdb with --enabled-shared, I run into: >>> ... >>

RE: [PATCH 1/2]AArch64 Fix 128-bit sequential consistency atomic operations.

2022-07-12 Thread Kyrylo Tkachov via Gcc-patches
Hi Tamar, Let me be the latest to offer my apologies for the slow review. > -Original Message- > From: Tamar Christina > Sent: Wednesday, June 8, 2022 3:49 PM > To: gcc-patches@gcc.gnu.org > Cc: nd ; Richard Earnshaw ; > Marcus Shawcroft ; Kyrylo Tkachov > ; Richard Sandiford > > Subjec

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Jonathan Wakely via Gcc-patches
On Tue, 12 Jul 2022 at 14:24, Pedro Alves wrote: > > On 2022-07-12 1:25 a.m., David Malcolm via Gcc-patches wrote: > > > I tried adding it to gcc/system.h, but anything that uses it needs to > > have std::unique_ptr declared, which meant forcibly including > > from gcc/system.h > > Did you conside

[PING][PATCH][gdb/build] Fix build breaker with --enabled-shared

2022-07-12 Thread Tom de Vries via Gcc-patches
[ dropped gdb-patches, since already applied there. ] On 6/27/22 15:38, Tom de Vries wrote: On 6/27/22 15:03, Tom de Vries wrote: Hi, When building gdb with --enabled-shared, I run into: ... ld: build/zlib/libz.a(libz_a-inffast.o): relocation R_X86_64_32S against \    `.rodata' can not be use

[PATCH] c++: coroutines - Overlap variables in frame [PR105989]

2022-07-12 Thread Michal Jankovič via Gcc-patches
Currently, coroutine frames store all variables of a coroutine separately, even if their lifetime does not overlap (they are in distinct scopes). This patch implements overlapping distinct variable scopes in the coroutine frame, by storing the frame fields in nested unions of structs. This lowers t

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-12 Thread Martin Liška
On 7/12/22 13:50, Rui Ueyama wrote: > I'm fine, though I don't think I have a right to sign off. I've just pushed that. @Rui: Can you please merge the mold counter-part? Thanks, Martin

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Pedro Alves
On 2022-07-12 1:25 a.m., David Malcolm via Gcc-patches wrote: > I tried adding it to gcc/system.h, but anything that uses it needs to > have std::unique_ptr declared, which meant forcibly including > from gcc/system.h Did you consider making gcc/system.h include gcc/make-unique.h itself if INCL

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-12 Thread Richard Biener via Gcc-patches
On Tue, Jul 12, 2022 at 1:50 PM Rui Ueyama wrote: > > I'm fine, though I don't think I have a right to sign off. > > On Tue, Jul 12, 2022 at 3:36 PM Martin Liška wrote: > > > > On 7/12/22 08:28, Richard Biener wrote: > > > On Mon, Jul 11, 2022 at 6:35 PM Alexander Monakov > > > wrote: > > >> >

RE: [PATCH 2/2]middle-end: Support recognition of three-way max/min.

2022-07-12 Thread Richard Biener via Gcc-patches
On Tue, 5 Jul 2022, Tamar Christina wrote: > > > } > > > + else if (EDGE_SUCC (bb1, 0)->dest == EDGE_SUCC (bb2, 0)->dest > > > +&& single_succ_p (bb1) > > > +&& single_succ_p (bb2) > > > +&& single_pred_p (bb1) > > > +&& single_pred_p (bb2) > > > +&&

Re: XFAIL 'offloading_enabled' diagnostics issue in 'libgomp.oacc-c-c++-common/reduction-5.c' [PR101551] (was: Enhance '_Pragma' diagnostics verification in OMP C/C++ test cases)

2022-07-12 Thread Tobias Burnus
Hi, On 12.07.22 13:50, Lewis Hyatt via Gcc-patches wrote: On Tue, Jul 12, 2022 at 2:33 AM Thomas Schwinge wrote: On 2022-07-11T11:27:12+0200, I wrote: Oh my, PR101551 "[offloading] Differences in diagnostics etc." strikes again... The latter two 'note' diagnostics are currently only emitted

Re: [PATCH] Add internal functions for iround etc. [PR106253]

2022-07-12 Thread Richard Biener via Gcc-patches
On Tue, Jul 12, 2022 at 2:07 PM Richard Sandiford via Gcc-patches wrote: > > The PR is about the aarch64 port using an ACLE built-in function > to vectorise a scalar function call, even though the ECF_* flags for > the ACLE function didn't match the ECF_* flags for the scalar call. > > To some ext

Re: [PATCH 1/1 V4] RISC-V: Support Zmmul extension

2022-07-12 Thread Kito Cheng via Gcc-patches
> gcc\ChangeLog: It's minor but that should be gcc/ChangeLog rather than gcc\ChangeLog: > > gcc\testsuite\ChangeLog: Same here. > --- a/gcc/config/riscv/riscv.cc > +++ b/gcc/config/riscv/riscv.cc > @@ -4999,10 +4999,14 @@ riscv_option_override (void) >/* The presence of the M extension impl

[PATCH] Remove create_lcssa_for_virtual_phi and uses

2022-07-12 Thread Richard Biener via Gcc-patches
The following expands the comment in vect_do_peeling as to why we do not need create_lcssa_for_virtual_phi and removes that function. That's the last bit I have queued for the vectorizer virtual LCSSA cleanup. Bootstrapped and tested on x86_64-unknown-linux-gnu and aarch64-linux-gnu (sic), pushed

[Ada] Use right implementation type for nonbinary-modulus ops

2022-07-12 Thread Pierre-Marie de Rodat via Gcc-patches
If the flag Opt.Expand_Nonbinary_Modular_Ops is set (which occurs if -gnateg is specified) then we implement predefined operations for a modular type whose modulus is not a power of two by converting the operands to some other type (either a signed integer type or a modular type with a power-of-two

Re: Modula-2: merge followup (brief update on the progress of the new linking implementation)

2022-07-12 Thread Gaius Mulley via Gcc-patches
Rainer Orth writes: Hi Rainer, many thanks for the patch and log of the failures. I've committed the patch and rebuilt all Makefile.in's which are affected by m2. I think this just leaves: > * While this lets the build finish on all of i386-pc-solaris2.11, > sparcv9-sun-solaris2.11, and x86

RE: [ping][vect-patterns] Refactor widen_plus/widen_minus as internal_fns

2022-07-12 Thread Richard Biener via Gcc-patches
On Thu, 30 Jun 2022, Joel Hutton wrote: > > We can go with a private vect_gimple_build function until we sort out the > > API > > issue to unblock Tamar (I'll reply to Richards reply with further thoughts > > on > > this) > > > > Done. > > > > Similarly are you ok with the use of gimple_extra

[Ada] Spurious use_type clause warning

2022-07-12 Thread Pierre-Marie de Rodat via Gcc-patches
This patch corrects an error in the compiler whereby a spurious redundant use_type_clause warning gets issued when the clause appears in the context_clause of a package preceding a with_clause for a package with an identical use_clause in its specification. Tested on x86_64-pc-linux-gnu, committed

Ping^2: [RFA configure parts] aarch64: Make cc1 &co handle --with options

2022-07-12 Thread Richard Sandiford via Gcc-patches
Ping^2 for the configure bits. Richard Sandiford via Gcc-patches writes: > On aarch64, --with-arch, --with-cpu and --with-tune only have an > effect on the driver, so “./xgcc -B./ -O3” can give significantly > different results from “./cc1 -O3”. --with-arch did have a limited > effect on ./cc1 i

[Ada] Extend No_Dependence restriction to code generation

2022-07-12 Thread Pierre-Marie de Rodat via Gcc-patches
This makes it possible to report violations of the No_Dependence restriction during code generation, in other words outside of the Ada front-end proper. These violations are supposed to be only for child units of System, so the implementation is restricted to these cases. Tested on x86_64-pc-linux

[Ada] Do not create large objects for indefinite protected types

2022-07-12 Thread Pierre-Marie de Rodat via Gcc-patches
This plugs a small loophole in the Needs_Secondary_Stack predicate for some protected types and record types containing protected components. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_util.adb (Caller_Known_Size_Record): Make entry assertion more robust and

[Ada] Fix 0-sized secondary stack allocations

2022-07-12 Thread Pierre-Marie de Rodat via Gcc-patches
The Has_Enough_Free_Memory was not correctly reporting a completely full chunk in the case of a 0-sized allocation. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-secsta.adb (Has_Enough_Free_Memory): Check for full chunk before computing the available size

[Ada] Fix inconsistent comment about expansion of exception declarations

2022-07-12 Thread Pierre-Marie de Rodat via Gcc-patches
Code cleanup. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_ch11.adb (Expand_N_Exception_Declaration): Sync comment with declaration in System.Standard_Library.diff --git a/gcc/ada/exp_ch11.adb b/gcc/ada/exp_ch11.adb --- a/gcc/ada/exp_ch11.adb +++ b/gcc/ada/exp

[Ada] Don't check for misspelling of Not_A_Restriction_Id

2022-07-12 Thread Pierre-Marie de Rodat via Gcc-patches
When looking for a misspelling of a restriction identifier we should ignore the Not_A_Restriction_Id literal, because it doesn't represent any restriction. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings): Fi

[Ada] Ada 2020: Allow declarative items mixed with statements

2022-07-12 Thread Pierre-Marie de Rodat via Gcc-patches
This patch implements a syntactic language extension that allows declarative items to appear in a sequence of statements. For example: for X in S'Range loop Item : Character renames S (X); Item := Transform (Item); end loop; Previously, declare/begin/end was required, whi

[Ada] Annotate libraries with returning annotation

2022-07-12 Thread Pierre-Marie de Rodat via Gcc-patches
This patch annotates SPARK-annotated libraries with returning annotations (Always_Return, Might_Not_Return) to remove the warnings raised by GNATprove about missing annotations. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnarl/a-reatim.ads, libgnat/a-cfdlli.ads,

[Ada] Fix confusing error expression on an unknown restriction

2022-07-12 Thread Pierre-Marie de Rodat via Gcc-patches
When pragma Restriction is used with an unknown restriction identifier, it is better to not process the restriction expression, as it will likely produce confusing error message. In particular, an odd message appeared when there was a typo in the restriction identifier whose expression requires sp

[Ada] Simplify rewriting of attributes into Boolean literals

2022-07-12 Thread Pierre-Marie de Rodat via Gcc-patches
Code cleanup; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_attr.adb (Set_Boolean_Result): Simplify using Boolean_Literals.diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@

[Ada] Suppress warning in g-socthi__vxworks.adb

2022-07-12 Thread Pierre-Marie de Rodat via Gcc-patches
Follow-on to previous change, which missed the vxworks version of this package. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/g-socthi__vxworks.adb (C_Connect): Suppress new warning.diff --git a/gcc/ada/libgnat/g-socthi__vxworks.adb b/gcc/ada/libgnat/g-socthi__vxwo

[Ada] Warn on unset objects in packages with no bodies

2022-07-12 Thread Pierre-Marie de Rodat via Gcc-patches
Fix an inconsistency, where GNAT was warning about references to unset objects inside generic packages with no bodies but not inside ordinary packages with no bodies. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch7.adb (Analyze_Package_Declaration): Check references

[Ada] Make it clear that gnatmake passes the ball to gprbuild if -P is set

2022-07-12 Thread Pierre-Marie de Rodat via Gcc-patches
Also move -P switch description to the top of the switches list. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * makeusg.adb, doc/gnat_ugn/building_executable_programs_with_gnat.rst: Move -P to the top of switches list and make it clear that gnatmake

[Ada] Accept aspect Yield on subprogram bodies acting as specs

2022-07-12 Thread Pierre-Marie de Rodat via Gcc-patches
A small fix for the aspect Yield defined in AI12-0279 for Ada 2022, to accept aspect given for a subprogram body which acts as its own spec. For example: procedure Switch with Yield => True is begin ... end Switch; Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/

[Ada] Vxworks7* - Makefile.rtl rtp vs rtp-smp cleanup - remove unused files

2022-07-12 Thread Pierre-Marie de Rodat via Gcc-patches
Only smp runtimes are built for vxworks7*, even though the -smp suffix is removed during install. This change removes unused system packages for rtp runtimes. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/system-vxworks7-ppc-rtp.ads: Remove * libgnat/system

[Ada] Refine heuristics for unreachable-code warnings

2022-07-12 Thread Pierre-Marie de Rodat via Gcc-patches
This patch refines the heuristics for when we warn about unreachable code, to avoid common false alarms. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch5.adb (Check_Unreachable_Code): Refine heuristics. * sem_util.ads, sem_util.adb (Is_Static_Constant_Name): R

[Ada] Ignore switches for controlling frontend warnings in GNATprove mode

2022-07-12 Thread Pierre-Marie de Rodat via Gcc-patches
In the special mode for GNATprove, ignore switches controlling frontend warnings, like already done for the control of style checks warnings. Also remove special handling of warning mode in Errout to make up for the previous division of control between -gnatw (GNAT) and --warnings (GNATprove). Tes

[Ada] Fix buffer overrun for small string concatenation at -O0

2022-07-12 Thread Pierre-Marie de Rodat via Gcc-patches
The concatenation routines may read too much data on the source side when the destination buffer is larger than the final result. This change makes sure that this does not happen any more and also removes obsolete stuff. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * rtsfi

[Ada] Avoid namespace pollution for Next and Previous

2022-07-12 Thread Pierre-Marie de Rodat via Gcc-patches
This patch renames Next and Previous in a-convec.ads and other containers to be _Next and _Previous, to avoid namespace pollution. The compiler now uses the leading-underscore names to look them up. The scanner is changed to allow this. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/

[Ada] Remove out-of-range warning in unreachable code

2022-07-12 Thread Pierre-Marie de Rodat via Gcc-patches
This patch removes a warning in examples like this: if cond then return; -- or other jump end if; X := ...; -- where the value is out of range where cond is known at compile time. It could, for example, be a generic formal parameter that is known to be True in some instances.

[Ada] Fix spurious warning on unreferenced internal generic instance

2022-07-12 Thread Pierre-Marie de Rodat via Gcc-patches
This patch removes a spurious warning, saying that an internal entity of a generic formal package is unreferenced. The immediate cause of this warning is that the internal entity is explicitly flagged as coming from source. The explicit flagging was added decades ago to fix a missing cross-referen

[Ada] Proper freezing for dispatching expression functions.

2022-07-12 Thread Pierre-Marie de Rodat via Gcc-patches
In the case of an expression function that is a primitive function of a tagged type, freezing the tagged type needs to freeze the function (and its return expression). A bug in this area could result in incorrect behavior both at compile time and at run time. At compile time, freezing rule violatio

[Ada] Fix missing Overflow and Range checks

2022-07-12 Thread Pierre-Marie de Rodat via Gcc-patches
While doing Preanalysis (as is the case during ghost code handling), some range and/or overflow checks can be saved (see Saved_Checks in checks.adb) and later one omitted as they would be redundant (see Find_Check in checks.adb). In the case of ghost code, the node being Preanalyzed is a temporary

[Ada] Add one more leading underscore to couple of exported symbols

2022-07-12 Thread Pierre-Marie de Rodat via Gcc-patches
For the sake of consistency with other runtime units. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * libgnat/s-stchop.ads: Use a double underscore prefix for symbols.diff --git a/gcc/ada/libgnat/s-stchop.ads b/gcc/ada/libgnat/s-stchop.ads --- a/gcc/ada/libgnat/s-stchop.ads

[Ada] Ignore exceptions in task termination handlers

2022-07-12 Thread Pierre-Marie de Rodat via Gcc-patches
This patch fixes a bug in which if the environment task has a specific termination handler, and that handler raises an exception, the handler is called recursively, causing infinite recursion. The RM requires such exceptions to be ignored. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada

[Ada] Add new unbounded and indefinite formal doubly linked list

2022-07-12 Thread Pierre-Marie de Rodat via Gcc-patches
Before this patch, the only formal doubly linked lists were bounded and definite. This means that it is necessary to provide their maximum length or capacity at instantiation and that they can only be used with definite element types. The formal lists added by this patch are unbounded and indefini

[Ada] Clean up scanner

2022-07-12 Thread Pierre-Marie de Rodat via Gcc-patches
This patch removes some obsolete code in the scanner and related files, and corrects some comments. Tok_Special is used only by the preprocessor, and uses only the two characters '#' and '$'. It might be simpler to have a single flag indicating we're scanning for preprocessing, instead of the Spec

[Ada] Warn about unreachable code after calls with No_Return

2022-07-12 Thread Pierre-Marie de Rodat via Gcc-patches
GNAT was already warning about unreachable code after raise/goto/exit statements, but not after calls to procedures with No_Return. Now this warning is extended. Also, previously the warning was suppressed for unreachable RETURN after RAISE statements. Now this suppression is narrowed to functions

[Ada] Remove excessive guard in detection of access-to-variable objects

2022-07-12 Thread Pierre-Marie de Rodat via Gcc-patches
It is safe to call Is_Access_Variable without calling Is_Access_Object_Type before. Compiler cleanup only; semantics is unaffected. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_util.adb (Is_Variable): Remove excessive guard.diff --git a/gcc/ada/sem_util.adb b/gcc/ada/

[PATCH] Add internal functions for iround etc. [PR106253]

2022-07-12 Thread Richard Sandiford via Gcc-patches
The PR is about the aarch64 port using an ACLE built-in function to vectorise a scalar function call, even though the ECF_* flags for the ACLE function didn't match the ECF_* flags for the scalar call. To some extent that kind of difference is inevitable, since the ACLE intrinsics are supposed to

[PATCH] aarch64: Remove redundant builtins code

2022-07-12 Thread Richard Sandiford via Gcc-patches
aarch64_builtin_vectorized_function handles some built-in functions that already have equivalent internal functions. This seems to be redundant now, since the target builtins that it chooses are mapped to the same optab patterns as the internal functions. Tested on aarch64-linux-gnu & pushed. Ri

Re: XFAIL 'offloading_enabled' diagnostics issue in 'libgomp.oacc-c-c++-common/reduction-5.c' [PR101551] (was: Enhance '_Pragma' diagnostics verification in OMP C/C++ test cases)

2022-07-12 Thread Lewis Hyatt via Gcc-patches
On Tue, Jul 12, 2022 at 2:33 AM Thomas Schwinge wrote: > > Hi! > > On 2022-07-11T11:27:12+0200, I wrote: > > [...], I've just pushed to master branch > > commit 06b2a2abe26554c6f9365676683d67368cbba206 > > "Enhance '_Pragma' diagnostics verification in OMP C/C++ test cases" > > > --- a/libgomp/tes

Re: [PATCH 3/3] lto-plugin: implement LDPT_GET_API_VERSION

2022-07-12 Thread Rui Ueyama via Gcc-patches
I'm fine, though I don't think I have a right to sign off. On Tue, Jul 12, 2022 at 3:36 PM Martin Liška wrote: > > On 7/12/22 08:28, Richard Biener wrote: > > On Mon, Jul 11, 2022 at 6:35 PM Alexander Monakov > > wrote: > >> > >> On Mon, 11 Jul 2022, Martin Liška wrote: > >> > >>> I've clarifie

  1   2   >