Re: [PATCH] RISC-V: Remove testcase that cannot be compiled because VLEN limitation

2023-07-18 Thread Lehua Ding
Committed to the trunk, thank you.   -- Original -- From: "juzhe.zh...@rivai.ai"

[PATCH v4 1/4] c++, libstdc++: Implement __is_arithmetic built-in trait

2023-07-18 Thread Ken Matsui via Gcc-patches
This patch implements built-in trait for std::is_arithmetic. gcc/cp/ChangeLog: * cp-trait.def: Define __is_arithmetic. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_ARITHMETIC. * semantics.cc (trait_expr_value): Likewise. (finish_trait_expr): Likewise. gcc

[PATCH v4 2/4] libstdc++: Optimize is_arithmetic trait performance

2023-07-18 Thread Ken Matsui via Gcc-patches
This patch optimizes the performance of the is_arithmetic trait by dispatching to the new __is_arithmetic built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_arithmetic): Use __is_arithmetic built-in trait. (is_arithmetic_v): Likewise. Signed-off-by: Ken

[PATCH] RISC-V: Fix testcase failed when default -mcmodel=medany

2023-07-18 Thread Lehua Ding
Hi, This patch fix testcase failed when I build RISC-V GCC with -mcmodel=medany as default. If set to medany, stack_save_restore.c testcase will fail because of the reduced use of s3 registers in assembly (thus calling __riscv_save/store_3 instead of __riscv_save/store_4). Explicitly add -mcmodel=

[PATCH v4 3/4] libstdc++: Optimize is_fundamental trait performance

2023-07-18 Thread Ken Matsui via Gcc-patches
This patch optimizes the performance of the is_fundamental trait by dispatching to the new __is_arithmetic built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_fundamental_v): Use __is_arithmetic built-in trait. (is_fundamental): Likewise. Optimize the ori

[PATCH v4 4/4] libstdc++: Optimize is_compound trait performance

2023-07-18 Thread Ken Matsui via Gcc-patches
This patch optimizes the performance of the is_compound trait by dispatching to the new __is_arithmetic built-in trait. libstdc++-v3/ChangeLog: * include/std/type_traits (is_compound): Use __is_arithmetic built-in trait. (is_compound_v): Use is_fundamental_v instead. Sign

Re: [PATCH] RISC-V: Fix testcase failed when default -mcmodel=medany

2023-07-18 Thread juzhe.zh...@rivai.ai
Not familiar with this stuff. I leave it other RISC-V folks to review. juzhe.zh...@rivai.ai From: Lehua Ding Date: 2023-07-18 15:42 To: gcc-patches CC: juzhe.zhong; rdapp.gcc; kito.cheng; palmer; jeffreyalaw Subject: [PATCH] RISC-V: Fix testcase failed when default -mcmodel=medany Hi, This

Re: [PATCH] RISC-V: Enable SLP un-order reduction

2023-07-18 Thread Robin Dapp via Gcc-patches
Hi Juzhe, > +;; - > +;; [INT,FP] Initialize from individual elements > +;; - > +;; Includes: > +;; - vslide1up.vx/vfslide1up.vf > +;; ---

PING^1 [PATCH v7] tree-ssa-sink: Improve code sinking pass

2023-07-18 Thread Ajit Agarwal via Gcc-patches
Ping! please review. Thanks & Regards Ajit This patch improves code sinking pass to sink statements before call to reduce register pressure. Review comments are incorporated. For example : void bar(); int j; void foo(int a, int b, int c, int d, int e, int f) { int l; l = a + b + c + d +

[PING^2] PATCH v5 4/4] ree: Improve ree pass for rs6000 target using defined ABI interfaces.

2023-07-18 Thread Ajit Agarwal via Gcc-patches
Ping^2. Please review. Thanks & Regards Ajit This new version of patch 4 use improve ree pass for rs6000 target using defined ABI interfaces. Bootstrapped and regtested on power64-linux-gnu. Review comments incorporated. Thanks & Regards Ajit Improve ree pass for rs6000 target using defin

[PING^2] [PATCH 3/4] ree: Improve functionality of ree pass for rs6000 target.

2023-07-18 Thread Ajit Agarwal via Gcc-patches
Ping^2. Please review. Thanks & Regards Ajit This patch provide functionality to improve ree pass for rs6000 target. Eliminated sign_extend/zero_extend/AND with varying constants. Bootstrapped and regtested on powerpc64-linux-gnu. Thanks & Regards Ajit ree: Improve ree pass for rs6000 target

[PATCH v3] RISCV: Add -m(no)-omit-leaf-frame-pointer support.

2023-07-18 Thread yanzhang.wang--- via Gcc-patches
From: Yanzhang Wang gcc/ChangeLog: * config/riscv/riscv.cc (riscv_save_reg_p): Save ra for leaf when enabling -mno-omit-leaf-frame-pointer (riscv_option_override): Override omit-frame-pointer. (riscv_frame_pointer_required): Save s0 for non-leaf function

Re: [PATCH] RISC-V: Fix testcase failed when default -mcmodel=medany

2023-07-18 Thread Robin Dapp via Gcc-patches
Hi Lehua, > This patch fix testcase failed when I build RISC-V GCC with -mcmodel=medany > as default. If set to medany, stack_save_restore.c testcase will fail because > of > the reduced use of s3 registers in assembly (thus calling __riscv_save/store_3 > instead of __riscv_save/store_4). Explici

[PATCH V2] RISC-V: Enable SLP un-order reduction

2023-07-18 Thread Juzhe-Zhong
This patch is to enable SLP un-order reduction autao-vectorization Consider this following case: int __attribute__((noipa)) add_loop (int *x, int n, int res) { for (int i = 0; i < n; ++i) { res += x[i * 2]; res += x[i * 2 + 1]; } return res; } --param riscv-autovec-prefer

Re: Re: [PATCH] RISC-V: Enable SLP un-order reduction

2023-07-18 Thread juzhe.zh...@rivai.ai
Address comment with V2: https://gcc.gnu.org/pipermail/gcc-patches/2023-July/624754.html with moving the location of VSET_SHI_INSERT patterns. juzhe.zh...@rivai.ai From: Robin Dapp Date: 2023-07-18 15:54 To: Juzhe-Zhong; gcc-patches CC: rdapp.gcc; kito.cheng; kito.cheng; jeffreyalaw Subject:

Re: [PATCH V2] RISC-V: Enable SLP un-order reduction

2023-07-18 Thread Robin Dapp via Gcc-patches
OK. Regards Robin

Re: [PATCH] RISC-V: Fix testcase failed when default -mcmodel=medany

2023-07-18 Thread Lehua Ding
Hi Robin, > Wouldn't you rather want to adjust the test to not check for one register > number but 3 or 4 instead? I think the purpose of this testcase is to check whether the modifications to the stack frame are as expected, so it is necessary to specify exactly whether three or four registers

Re: [PATCH V2] RISC-V: Enable SLP un-order reduction

2023-07-18 Thread Lehua Ding
Committed to the trunk, thanks Robin.

[PATCH] MAINTAINERS: Add myself as riscv port reviewer.

2023-07-18 Thread juzhe . zhong
From: Ju-Zhe Zhong ChangeLog: * MAINTAINERS: Add myself as a reviewer for the riscv port. --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index c9c9115678f..87a4f906d42 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -306,6 +3

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

2023-07-18 Thread Jiufu Guo via Gcc-patches
Hi, Andrew MacLeod writes: > On 7/17/23 09:45, Jiufu Guo wrote: >> Should we decide we would like it in general, it wouldnt be hard to add to irange.  wi_fold() cuurently returns null, it could easily return a bool indicating if an overflow happened, and wi_fold_in_parts and fol

[PATCH] aarch64: remove useless pairs of rev instructions

2023-07-18 Thread Serval Martinot-Lagarde via Gcc-patches
SVE generates superflous rev instructions that can be replaced by single mov instruction or a pair of (rev, mov) instructions gcc/ * config/aarch64/aarch64-sve.md: New peephole2. * testsuite/gcc.target/aarch64/sve/revrev.c: New dg test. Signed-off-by: Serval Martinot-Lagarde ---

Re: [PATCH] RISC-V: Fix testcase failed when default -mcmodel=medany

2023-07-18 Thread Robin Dapp via Gcc-patches
Hi Lehua, > I think the purpose of this testcase is to check whether the modifications to > the stack frame are as expected, so it is necessary to specify exactly whether > three or four registers are saved. But I think its need to add another > testcase > which use another option -mcmodel=medany

[PATCH] middle-end/105715 - missed RTL if-conversion with COND_EXPR expansion

2023-07-18 Thread Richard Biener via Gcc-patches
When the COND_EXPR condition operand was split out to a separate stmt it became subject to CSE with other condition evaluations. This unfortunately leads to TER no longer applying and in turn RTL expansion of COND_EXPRs no longer seeing the condition and thus failing to try conditional move expans

Re: [PATCH] RISC-V: Dynamic adjust size of VLA vector according to TARGET_MIN_VLEN

2023-07-18 Thread Kito Cheng via Gcc-patches
LGTM, thanks:) Juzhe-Zhong 於 2023年7月18日 週二 14:28 寫道: > This patch is to dynamic adjust size of VLA vectors according to > TARGET_MIN_VLEN (-march=*zvl*b). > > Currently, VNx16QImode is always [16,16] when TARGET_MINV_LEN >= 128. > > We are going to add a bunch of VLS modes (V16QI,V32QI,etc),

Re: [PATCH] aarch64: remove useless pairs of rev instructions

2023-07-18 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 18 Jul 2023 at 15:20, Serval Martinot-Lagarde via Gcc-patches wrote: > > SVE generates superflous rev instructions that can be replaced > by single mov instruction or a pair of (rev, mov) instructions Hi Serval, I had added a similar transform to remove pair of rev instructions in: https:/

Re: [PATCH] RISC-V: Dynamic adjust size of VLA vector according to TARGET_MIN_VLEN

2023-07-18 Thread Lehua Ding
> LGTM, thanks:) Committed to the trunk, thanks Kito and Juzhe.

[PATCH v2 1/8] LoongArch: Added Loongson SX vector directive compilation framework.

2023-07-18 Thread Chenghui Pan
From: Lulu Cheng gcc/ChangeLog: * config/loongarch/genopts/loongarch-strings: Added compilation framework. * config/loongarch/genopts/loongarch.opt.in: Ditto. * config/loongarch/loongarch-c.cc (loongarch_cpu_cpp_builtins): Ditto. * config/loongarch/loongarch-def.

[PATCH v2 4/8] LoongArch: Added Loongson ASX vector directive compilation framework.

2023-07-18 Thread Chenghui Pan
From: Lulu Cheng gcc/ChangeLog: * config/loongarch/genopts/loongarch-strings: Added compilation framework. * config/loongarch/genopts/loongarch.opt.in: Ditto. * config/loongarch/loongarch-c.cc (loongarch_cpu_cpp_builtins): Ditto. * config/loongarch/loongarch-def.

[PATCH v2 0/8] Add Loongson SX/ASX instruction support to LoongArch target.

2023-07-18 Thread Chenghui Pan
This is an update of https://gcc.gnu.org/pipermail/gcc-patches/2023-June/623262.html In addition, LSX/LASX instructions support is added in the master branch of binutils-gdb, and these GCC patches can be used with future releases of binutils-gdb. Changes since v1: - Some usages of "unspec" in l

Re: PING^1 [PATCH v7] tree-ssa-sink: Improve code sinking pass

2023-07-18 Thread Prathamesh Kulkarni via Gcc-patches
On Tue, 18 Jul 2023 at 13:26, Ajit Agarwal via Gcc-patches wrote: > > > Ping! > > please review. > > Thanks & Regards > Ajit > > > This patch improves code sinking pass to sink statements before call to reduce > register pressure. > Review comments are incorporated. > > For example : > > void bar(

Re: PING^1 [PATCH v7] tree-ssa-sink: Improve code sinking pass

2023-07-18 Thread Ajit Agarwal via Gcc-patches
On 18/07/23 4:38 pm, Prathamesh Kulkarni wrote: > On Tue, 18 Jul 2023 at 13:26, Ajit Agarwal via Gcc-patches > wrote: >> >> >> Ping! >> >> please review. >> >> Thanks & Regards >> Ajit >> >> >> This patch improves code sinking pass to sink statements before call to >> reduce >> register pressu

[PATCH] middle-end/61747 - conditional move expansion and constants

2023-07-18 Thread Richard Biener via Gcc-patches
When expanding a COND_EXPR or a VEC_COND_EXPR the x86 backend for example tries to match FP min/max instructions. But this only works when it can see the equality of the comparison and selected operands. This breaks in both prepare_cmp_insn and vector_compare_rtx where the former forces expensive

Re: [PATCH RFA (fold)] c++: constexpr bit_cast with empty field

2023-07-18 Thread Richard Biener via Gcc-patches
On Mon, Jul 17, 2023 at 11:20 PM Jason Merrill via Gcc-patches wrote: > > Tested x86_64-pc-linux-gnu, OK for trunk? > > -- 8< -- > > The change to only cache constexpr calls that are > reduced_constant_expression_p tripped on bit-cast3.C, which failed that > predicate due to the presence of an emp

Re: [PATCH v3] Introduce attribute reverse_alias

2023-07-18 Thread Richard Biener via Gcc-patches
On Tue, Jul 18, 2023 at 6:29 AM Alexandre Oliva via Gcc-patches wrote: > > Hello, Nathan, > > On Jul 15, 2023, Nathan Sidwell wrote: > > > Not commenting on the semantics, but the name seems unfortunate (hello > > bikeshed). > > Yeah, it's a bit challenging to express the concept, when the notion

Re: [PATCH v2] tree-optimization/110279- Check for nested FMA chains in reassoc

2023-07-18 Thread Richard Biener via Gcc-patches
On Mon, Jul 17, 2023 at 4:26 PM Tamar Christina via Gcc-patches wrote: > > I think Andrew is listed as maintainer for tree-ssa, or maybe it's on one of > the Richard's lists? It's on my rather longish list of things to review ... > > -Original Message- > > From: Gcc-patches > bounces+t

Re: PING^1 [PATCH v7] tree-ssa-sink: Improve code sinking pass

2023-07-18 Thread Richard Biener via Gcc-patches
On Tue, Jul 18, 2023 at 1:17 PM Ajit Agarwal wrote: > > > > On 18/07/23 4:38 pm, Prathamesh Kulkarni wrote: > > On Tue, 18 Jul 2023 at 13:26, Ajit Agarwal via Gcc-patches > > wrote: > >> > >> > >> Ping! > >> > >> please review. > >> > >> Thanks & Regards > >> Ajit > >> > >> > >> This patch improv

[patch] OpenMP/Fortran: Non-rectangular loops with constant steps other than 1 or -1 [PR107424]

2023-07-18 Thread Tobias Burnus
Comments regarding the validity of the Fortran assumptions are welcome! This patch now uses a 'simple' loop for OpenMP loops with a constant loop-step size. Before, it only did so for step = ±1. (Otherwise, a count variable is used from which the original loop index variable is calculated from.)

Re: [PATCH v2 0/8] Add Loongson SX/ASX instruction support to LoongArch target.

2023-07-18 Thread Xi Ruoyao via Gcc-patches
On Tue, 2023-07-18 at 19:06 +0800, Chenghui Pan wrote: > Lulu Cheng (8): >   LoongArch: Added Loongson SX vector directive compilation framework. >   LoongArch: Added Loongson SX base instruction support. >   LoongArch: Added Loongson SX directive builtin function support. >   LoongArch: Added Loon

[COMMITTED] ada: Fix Valid_Scalars attribute applied to types from limited with

2023-07-18 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou The attribute is wrongly computed as always True because, unlike for e.g. private types, Validated_View does not look through the limited view. gcc/ada/ * sem_util.ads (Validated_View): Document enhanced behavior. * sem_util.adb (Validated_View): Return the n

[COMMITTED] ada: Allow warnings with explain code

2023-07-18 Thread Marc Poulhiès via Gcc-patches
From: Yannick Moy Change the way explain codes are handled to generate the command for the user to get the explanations, as this was not working for warnings. gcc/ada/ * errout.adb (Error_Msg_Internal): Remove call to Prescan_Message on the special continuation for the explain c

[COMMITTED] ada: Fix assertion failure introduced by latest change

2023-07-18 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou The new processing is not properly guarded. gcc/ada/ * sem_ch13.adb (Replace_Type_References_Generic.Visible_Component): In the case of private discriminated types, explicitly check that we have a private declaration before examining its discriminant

[COMMITTED] ada: Fix internal error on aggregates of self-referencing types

2023-07-18 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou The front-end contains a specific mechanism to deal with aggregates of self-referencing types by means of the Has_Self_Reference flag, which is supposed to be set during semantic analysis and used during expansion. The problem is that the first part overlooks aggregates of de

[COMMITTED] ada: Expose expected_throw attribute

2023-07-18 Thread Marc Poulhiès via Gcc-patches
From: Alexandre Oliva Mark exception-raising subprograms with expected_throw attribute. Document the use of the attribute in Control Flow Redundancy. Enable marking subprograms as expected_throw with Machine_Attribute pragmas. gcc/ada/ * libgnat/a-except.ads (Raise_Exception): Mark ex

[COMMITTED] ada: Apply correct element type for container aggregates

2023-07-18 Thread Marc Poulhiès via Gcc-patches
From: Viljar Indus When dealing with a container aggregate with an iterator specification the iterator should take the value of the element of the container instead of the key. gcc/ada/ * sem_aggr.adb (Resolve_Iterated_Association): Use the element type for the iterator in a con

[COMMITTED] ada: Constraint_Error caused by interface conversion

2023-07-18 Thread Marc Poulhiès via Gcc-patches
From: Javier Miranda When the sources have a type conversion from an interface type T2 to some ancestor interface type T1 (that is, T2 extends T1) the tag check added by the compiler may fail at runtime. gcc/ada/ * exp_disp.adb (Has_Dispatching_Constructor_Call): Removed. (Expan

[COMMITTED] ada: Tweak CPU affinity handling on Linux

2023-07-18 Thread Marc Poulhiès via Gcc-patches
From: Ronan Desplanques Before this patch, the run-time assumed that not specifying a CPU affinity mask when creating a thread was equivalent to specifying a CPU affinity mask that included all CPUs. As documented in the man pages for pthread_create and pthread_setaffinity_np, this assumption is

[COMMITTED] ada: Avoid iterator conflicts in container aggregates

2023-07-18 Thread Marc Poulhiès via Gcc-patches
From: Viljar Indus Create temporary scope for the iterators defined in a container aggregate so that it would not be put to the same scope where the expression was used. This would otherwise lead to multiple aggregates with iterators that have the same name leading to a name conflict. gcc/ada/

[COMMITTED] ada: Fix expanding container aggregates with Iterator specification

2023-07-18 Thread Marc Poulhiès via Gcc-patches
From: Viljar Indus The compiler should use unnamed addition methods such as Append when expanding a container aggregate with Iterator Specification. gcc/ada/ * exp_aggr.adb (Expand_Container_Aggregate): Use the positional addition method only when dealing with a container aggreg

[COMMITTED] ada: Improve error message for ambiguous subprogram call

2023-07-18 Thread Marc Poulhiès via Gcc-patches
From: Eric Botcazou This restores the full listing of the types for the interpretations. gcc/ada/ * sem_util.ads (Wrong_Type): Add Multiple parameter defaulting to False and document it. * sem_util.adb (Wrong_Type): Do not return early if an error has already bee

[COMMITTED] ada: Constraint_Error caused by 'Image applied to interface type

2023-07-18 Thread Marc Poulhiès via Gcc-patches
From: Javier Miranda When the prefix of 'Image is used with a class-wide interface type object, the frontend does not generate code to displace the pointer to the underlying object to reference its base, and this is required to invoke Ada.Tags.Wide_Wide_Expanded_Name. gcc/ada/ * exp_imgv

[COMMITTED] ada: Use new typedefs in gcc-interface

2023-07-18 Thread Marc Poulhiès via Gcc-patches
From: Tom Tromey This changes gcc-interface to use the typedefs that were recently introduced in gnat. This is another step toward switching the code generator to emit enums rather than preprocessor defines. In a couple of spots, a 'default' case is also added. These avoid warnings from -Wswit

[RFC] analyzer: Add optional trim of the analyzer diagnostics going too deep [PR110543]

2023-07-18 Thread Benjamin Priour via Gcc-patches
Hi, I'd like to request comments on a patch I am writing for PR110543. The goal of this patch is to reduce the noise of the analyzer emitted diagnostics when dealing with system headers, or simply diagnostic paths that are too long. The new option only affects the display of the diagnostics, but d

[PATCH v8] tree-ssa-sink: Improve code sinking pass.

2023-07-18 Thread Ajit Agarwal via Gcc-patches
Hello All: This patch improves code sinking pass to sink statements before call to reduce register pressure. Review comments are incorporated. For example : void bar(); int j; void foo(int a, int b, int c, int d, int e, int f) { int l; l = a + b + c + d +e + f; if (a != 5) { bar(

RE: [PATCH] aarch64: remove useless pairs of rev instructions

2023-07-18 Thread Serval Martinot-Lagarde via Gcc-patches
Hi Prathamesh, > On Tue, 18 Jul 2023 at 12:54, Prathamesh Kulkarni > wrote: > I had added a similar transform to remove pair of rev instructions in: > https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=f0eabc52c9a2d3da0bfc201da7a5 > c1658b76e9a4 I don't have much knowledge of GCC code, but your commi

Re: [PATCH v1|GCC-13] RISC-V: Bugfix for riscv-vsetvl pass.

2023-07-18 Thread Jeff Law via Gcc-patches
On 7/15/23 20:16, Pan Li via Gcc-patches wrote: From: Ju-Zhe Zhong This patch comes from part of below change, which locate one bug of rvv vsetvel pass when auto-vectorization. https://gcc.gnu.org/pipermail/gcc-patches/2023-July/624523.html Unforunately, It is not easy to reproduce this bu

[PATCH V5 2/2] Optimize '(X - N * M) / N' to 'X / N - M' if valid

2023-07-18 Thread Jiufu Guo via Gcc-patches
Hi, Integer expression "(X - N * M) / N" can be optimized to "X / N - M" if there is no wrap/overflow/underflow and "X - N * M" has the same sign with "X". Compare the previous version: https://gcc.gnu.org/pipermail/gcc-patches/2023-July/624067.html - APIs: overflow, nonnegative_p and nonpositi

RE: [PATCH v1|GCC-13] RISC-V: Bugfix for riscv-vsetvl pass.

2023-07-18 Thread Li, Pan2 via Gcc-patches
Committed to GCC 13, thanks Jeff. Pan -Original Message- From: Jeff Law Sent: Tuesday, July 18, 2023 9:57 PM To: Li, Pan2 ; gcc-patches@gcc.gnu.org Cc: juzhe.zh...@rivai.ai; kito.ch...@gmail.com Subject: Re: [PATCH v1|GCC-13] RISC-V: Bugfix for riscv-vsetvl pass. On 7/15/23 20:16, Pa

[PATCH V5 1/2] Add overflow API for plus minus mult on range

2023-07-18 Thread Jiufu Guo via Gcc-patches
Hi, As discussed in previous reviews, adding overflow APIs to range-op would be useful. Those APIs could help to check if overflow happens when operating between two 'range's, like: plus, minus, and mult. Previous discussions are here: https://gcc.gnu.org/pipermail/gcc-patches/2023-July/624067.ht

[PATCH releases/gcc-13 2/2] libgcc: Fix -Wint-conversion warning in find_fde_tail

2023-07-18 Thread Florian Weimer via Gcc-patches
Fixes commit r14-1614-g49310a99330849 ("libgcc: Fix eh_frame fast path in find_fde_tail"). libgcc/ PR libgcc/110179 * unwind-dw2-fde-dip.c (find_fde_tail): Add cast to avoid implicit conversion of pointer value to integer. (cherry picked from commit 104b09005229ef48a79a33

[PATCH releases/gcc-13 1/2] libgcc: Fix eh_frame fast path in find_fde_tail

2023-07-18 Thread Florian Weimer via Gcc-patches
The eh_frame value is only used by linear_search_fdes, not the binary search directly in find_fde_tail, so the bug is not immediately apparent with most programs. Fixes commit e724b0480bfa5ec04f39be8c7290330b495c59de ("libgcc: Special-case BFD ld unwind table encodings in find_fde_tail"). libgcc/

Re: [PATCH V2] RISC-V: Throw compilation error for unknown sub-extension or supervisor extension

2023-07-18 Thread Kito Cheng via Gcc-patches
LGTM, thanks :) On Thu, Jul 13, 2023 at 4:33 PM Lehua Ding wrote: > > Hi, > > This tiny patch add a check for extension starts with 'z' or 's' in `-march` > option. Currently this unknown extension will be passed to the assembler, > which > then reports an error. With this patch, the compiler wi

[PATCH]AArch64 fix regexp for live_1.c sve test

2023-07-18 Thread Tamar Christina via Gcc-patches
Hi All, The resulting predicate register of a whilelo is not restricted to the lower half of the predicate register file. As such these tests started failing after recent changes because the whilelo outside the loop is getting assigned p15. This widens the regexp. Tested on aarch64-none-linux-g

Re: vectorizer: Avoid an OOB access from vectorization

2023-07-18 Thread Matthew Malcomson via Gcc-patches
Tamar pointed out it would be good to have a `scan-tree-dump` in the testcase just to make sure that when something is currently vectorizing it stays vectorizing (and hence that the new code is still likely running). Attached patch has that change, also inlined for ease of reply.

[PATCH] tree-optimization/88540 - FP x > y ? x : y if-conversion without -ffast-math

2023-07-18 Thread Richard Biener via Gcc-patches
The following makes sure that FP x > y ? x : y style max/min operations are if-converted at the GIMPLE level. While we can neither match it to MAX_EXPR nor .FMAX as both have different semantics with IEEE than the ternary ?: operation we can make sure to maintain this form as a COND_EXPR so backen

Re: [PATCH releases/gcc-13 1/2] libgcc: Fix eh_frame fast path in find_fde_tail

2023-07-18 Thread Richard Biener via Gcc-patches
On Tue, Jul 18, 2023 at 4:19 PM Florian Weimer via Gcc-patches wrote: > > The eh_frame value is only used by linear_search_fdes, not the binary > search directly in find_fde_tail, so the bug is not immediately > apparent with most programs. > > Fixes commit e724b0480bfa5ec04f39be8c7290330b495c59de

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

2023-07-18 Thread Qing Zhao via Gcc-patches
> On Jul 17, 2023, at 7:40 PM, Kees Cook wrote: > > On Mon, Jul 17, 2023 at 09:17:48PM +, Qing Zhao wrote: >> >>> On Jul 13, 2023, at 4:31 PM, Kees Cook wrote: >>> >>> In the bug, the problem is that "p" isn't known to be allocated, if I'm >>> reading that correctly? >> >> I think that

Re: rs6000: Fix expected counts powerpc/p9-vec-length-full

2023-07-18 Thread Carl Love via Gcc-patches
Ping On Thu, 2023-06-01 at 16:11 -0700, Carl Love wrote: > GCC maintainers: > > The following patch updates the expected instruction counts in four > tests. The counts in all of the tests changed with commit > f574e2dfae79055f16d0c63cc12df24815d8ead6. > > The updated counts have been verified

[PATCH] c++: deducing empty type vs non-type argument pack

2023-07-18 Thread Patrick Palka via Gcc-patches
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? Also verified by way of gcc_assert that we never see TEMPLATE_PARM_INDEX here. -- >8 -- Within a template parameter list, a non-type template parameter pack is represented as a PARM_DECL. But in a couple of spots wh

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

2023-07-18 Thread Martin Uecker via Gcc-patches
Am Dienstag, dem 18.07.2023 um 15:37 + schrieb Qing Zhao: > > > > On Jul 17, 2023, at 7:40 PM, Kees Cook > > wrote: > > > > On Mon, Jul 17, 2023 at 09:17:48PM +, Qing Zhao wrote: > > > > > > > On Jul 13, 2023, at 4:31 PM, Kees Cook > > > > wrote: > > > > > > > > In the bug, the probl

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

2023-07-18 Thread Qing Zhao via Gcc-patches
> On Jul 18, 2023, at 12:03 PM, Martin Uecker wrote: > > Am Dienstag, dem 18.07.2023 um 15:37 + schrieb Qing Zhao: >> >> >>> On Jul 17, 2023, at 7:40 PM, Kees Cook >>> wrote: >>> >>> On Mon, Jul 17, 2023 at 09:17:48PM +, Qing Zhao wrote: > On Jul 13, 2023, at 4:31 PM, Kees

Re: [PATCH] c++: deducing empty type vs non-type argument pack

2023-07-18 Thread Jason Merrill via Gcc-patches
On 7/18/23 11:18, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? Also verified by way of gcc_assert that we never see TEMPLATE_PARM_INDEX here. OK. -- >8 -- Within a template parameter list, a non-type template parameter pack is represen

Re: [PATCH RFA (fold)] c++: constexpr bit_cast with empty field

2023-07-18 Thread Jason Merrill via Gcc-patches
On 7/18/23 07:31, Richard Biener wrote: On Mon, Jul 17, 2023 at 11:20 PM Jason Merrill via Gcc-patches wrote: Tested x86_64-pc-linux-gnu, OK for trunk? -- 8< -- The change to only cache constexpr calls that are reduced_constant_expression_p tripped on bit-cast3.C, which failed that predicate

[committed] dwarf2: Change return type of predicate functions from int to bool

2023-07-18 Thread Uros Bizjak via Gcc-patches
Also change some internal variables and function arguments from int to bool. gcc/ChangeLog: * dwarf2asm.cc: Change FALSE to false. * dwarf2cfi.cc (execute_dwarf2_frame): Change return type to void. * dwarf2out.cc (matches_main_base): Change return type from int to bool. Change "l

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

2023-07-18 Thread Martin Uecker via Gcc-patches
Am Dienstag, dem 18.07.2023 um 16:25 + schrieb Qing Zhao: > > > > On Jul 18, 2023, at 12:03 PM, Martin Uecker > > wrote: > > > > Am Dienstag, dem 18.07.2023 um 15:37 + schrieb Qing Zhao: > > > > > > > > > > On Jul 17, 2023, at 7:40 PM, Kees Cook > > > > wrote: > > > > > > > > On Mon

Re: [PATCH] c++: redundant targ coercion for var/alias tmpls

2023-07-18 Thread Jason Merrill via Gcc-patches
On 7/17/23 17:29, Patrick Palka wrote: On Fri, 14 Jul 2023, Jason Merrill wrote: On 7/14/23 14:07, Patrick Palka wrote: On Thu, 13 Jul 2023, Jason Merrill wrote: On 7/13/23 11:48, Patrick Palka wrote: On Wed, 28 Jun 2023, Patrick Palka wrote: On Wed, Jun 28, 2023 at 11:50 AM Jason Merrill

Re: [PATCH] testsuite: fix dwarf2/utf-1.C with DWARF4

2023-07-18 Thread Jason Merrill via Gcc-patches
On 7/5/23 17:51, Marek Polacek wrote: Running $ make check-c++ RUNTESTFLAGS='--target_board=unix\{-gdwarf-5,-gdwarf-4\} dwarf2.exp=utf-1.C' shows FAIL: g++.dg/debug/dwarf2/utf-1.C -std=gnu++20 scan-assembler-times DW_AT_encoding \\(0x10\\) 3 because with -gdwarf-4 the output is: .byte 0

Re: [PATCH v2 0/2] ifcvt: Allow if conversion of arithmetic in basic blocks with multiple sets

2023-07-18 Thread Manolis Tsamis
Hi Richard, Thanks for your insightful reply. On Tue, Jul 18, 2023 at 1:12 AM Richard Sandiford wrote: > > Manolis Tsamis writes: > > noce_convert_multiple_sets has been introduced and extended over time to > > handle > > if conversion for blocks with multiple sets. Currently this is focused o

Re: [PATCH v3] Implement new RTL optimizations pass: fold-mem-offsets.

2023-07-18 Thread Manolis Tsamis
On Fri, Jul 14, 2023 at 8:35 AM Jeff Law wrote: > > > > On 7/13/23 09:05, Manolis Tsamis wrote: > > In this version I have made f-m-o able to also eliminate constant > > moves in addition to the add constant instructions. > > This increases the number of simplified/eliminated instructions and is >

[pushed] c++: Add tests for P2621, no UB in lexer [PR110340]

2023-07-18 Thread Marek Polacek via Gcc-patches
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- C++26 P2621 removes UB in the lexer and either makes the construct valid or ill-formed. We're already handling this correctly so this patch only adds tests. PR c++/110340 gcc/testsuite/ChangeLog: * g++.dg/cpp/string-4.C:

Re: [PATCH] Read global value/mask in IPA.

2023-07-18 Thread Aldy Hernandez via Gcc-patches
On 7/17/23 15:14, Aldy Hernandez wrote: Instead of reading the known zero bits in IPA, read the value/mask pair which is available. There is a slight change of behavior here. I have removed the check for SSA_NAME, as the ranger can calculate the range and value/mask for INTEGER_CST. This sim

Re: [PATCH v3] Implement new RTL optimizations pass: fold-mem-offsets.

2023-07-18 Thread Jeff Law via Gcc-patches
On 7/18/23 11:15, Manolis Tsamis wrote: On Fri, Jul 14, 2023 at 8:35 AM Jeff Law wrote: On 7/13/23 09:05, Manolis Tsamis wrote: In this version I have made f-m-o able to also eliminate constant moves in addition to the add constant instructions. This increases the number of simplified/el

Re: [PATCH v2 0/2] ifcvt: Allow if conversion of arithmetic in basic blocks with multiple sets

2023-07-18 Thread Richard Sandiford via Gcc-patches
Manolis Tsamis writes: > On Tue, Jul 18, 2023 at 1:12 AM Richard Sandiford > wrote: >> >> Manolis Tsamis writes: >> > noce_convert_multiple_sets has been introduced and extended over time to >> > handle >> > if conversion for blocks with multiple sets. Currently this is focused on >> > register

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

2023-07-18 Thread Qing Zhao via Gcc-patches
> On Jul 18, 2023, at 11:37 AM, Qing Zhao via Gcc-patches > wrote: > > > >> On Jul 17, 2023, at 7:40 PM, Kees Cook wrote: >> >> On Mon, Jul 17, 2023 at 09:17:48PM +, Qing Zhao wrote: >>> On Jul 13, 2023, at 4:31 PM, Kees Cook wrote: In the bug, the problem is that "p"

[PATCH RESEND] c: add -Wmissing-variable-declarations [PR65213]

2023-07-18 Thread Hamza Mahfooz
Resolves: PR c/65213 - Extend -Wmissing-declarations to variables [i.e. add -Wmissing-variable-declarations] gcc/c-family/ChangeLog: PR c/65213 * c.opt (-Wmissing-variable-declarations): New option. gcc/c/ChangeLog: PR c/65213 * c-decl.cc (start_decl): Handle

Re: Fix profile update in scale_profile_for_vect_loop

2023-07-18 Thread Thiago Jung Bauermann via Gcc-patches
Hello, Jan Hubicka via Gcc-patches writes: > Hi, > when vectorizing 4 times, we sometimes do > for > <4x vectorized body> > for > <2x vectorized body> > for > <1x vectorized body> > > Here the second two fors handling epilogue never iterates. > Currently vecotrizer thinks tha

Re: [PATCH v2] libcpp: Handle extended characters in user-defined literal suffix [PR103902]

2023-07-18 Thread Jason Merrill via Gcc-patches
On 3/2/23 18:07, Lewis Hyatt wrote: The PR complains that we do not handle UTF-8 in the suffix for a user-defined literal, such as: bool operator ""_π (unsigned long long); In fact we don't handle any extended identifier characters there, whether UTF-8, UCNs, or the $ sign. We do handle it fine

Re: [PATCH v5 4/5] c++modules: report imported CMI files as dependencies

2023-07-18 Thread Jason Merrill via Gcc-patches
On 6/25/23 12:36, Ben Boeckel wrote: On Fri, Jun 23, 2023 at 08:12:41 -0400, Nathan Sidwell wrote: On 6/22/23 22:45, Ben Boeckel wrote: On Thu, Jun 22, 2023 at 17:21:42 -0400, Jason Merrill wrote: On 1/25/23 16:06, Ben Boeckel wrote: They affect the build, so report them via `-MF` mechanisms.

Re: [PATCH v5 4/5] c++modules: report imported CMI files as dependencies

2023-07-18 Thread Nathan Sidwell via Gcc-patches
On 7/18/23 16:52, Jason Merrill wrote: On 6/25/23 12:36, Ben Boeckel wrote: On Fri, Jun 23, 2023 at 08:12:41 -0400, Nathan Sidwell wrote: On 6/22/23 22:45, Ben Boeckel wrote: On Thu, Jun 22, 2023 at 17:21:42 -0400, Jason Merrill wrote: On 1/25/23 16:06, Ben Boeckel wrote: They affect the bui

[PATCH] c++: fix ICE with is_really_empty_class [PR110106]

2023-07-18 Thread Marek Polacek via Gcc-patches
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk and branches? -- >8 -- is_really_empty_class is liable to crash when it gets an incomplete or dependent type. Since r11-557, we pass the yet-uninstantiated class type S<0> of the PARM_DECL s to is_really_empty_class -- because of the po

[PATCH] libstdc++: Define _GLIBCXX_HAS_BUILTIN_TRAIT

2023-07-18 Thread Ken Matsui via Gcc-patches
This patch defines _GLIBCXX_HAS_BUILTIN_TRAIT, which will be used as a flag to toggle built-in traits in the type_traits header. Through this macro function and _GLIBCXX_NO_BUILTIN_TRAITS macro, we can switch the use of built-in traits without needing to modify the source code. libstdc++-v3/Change

[PATCH 0/8] Tweak predicate macros in tree

2023-07-18 Thread Ken Matsui via Gcc-patches
This patch series tweaks predicate macros in tree.h to make the code more readable. TYPE_REF_P is moved to tree.h and used for INDIRECT_TYPE_P and TYPE_REF_IS_LVALUE. TYPE_PTR_P is also moved to tree.h and used for INDIRECT_TYPE_P. POINTER_TYPE_P in tree.h is replaced with INDIRECT_TYPE_P since it

[PATCH 1/8] c++, tree: Move TYPE_REF_P to tree.h

2023-07-18 Thread Ken Matsui via Gcc-patches
This patch moves TYPE_REF_P from cp/cp-tree.h to tree.h to simplify the same code as it and to declare TYPE_REF_IS_LVALUE that determines if a type is a C++ lvalue reference. gcc/cp/ChangeLog: * cp-tree.h (TYPE_REF_P): Remove. gcc/ChangeLog: * tree.h (TYPE_REF_P): Define. Signe

[PATCH 2/8] gcc: Use TYPE_REF_P

2023-07-18 Thread Ken Matsui via Gcc-patches
gcc/ada/ChangeLog: * gcc-interface/trans.cc (return_slot_opt_for_pure_call_p): Use TYPE_REF_P. * gcc-interface/utils2.cc (build_unary_op): Likewise. gcc/ChangeLog: * alias.cc (get_alias_set): Use TYPE_REF_P. * config/gcn/gcn-tree.cc (gcn_goacc_get_worker_red_decl

[PATCH 3/8] c++, tree: Move TYPE_PTR_P to tree.h

2023-07-18 Thread Ken Matsui via Gcc-patches
This patch moves TYPE_PTR_P from cp/cp-tree.h to tree.h to unify POINTER_TYPE_P in tree.h to INDIRECT_TYPE_P in cp/cp-tree.h, which are equivalent. gcc/cp/ChangeLog: * cp-tree.h (TYPE_PTR_P): Remove. gcc/ChangeLog: * tree.h (TYPE_PTR_P): Define. Signed-off-by: Ken Matsui ---

[PATCH 4/8] c++, tree: Move INDIRECT_TYPE_P to tree.h

2023-07-18 Thread Ken Matsui via Gcc-patches
This patch moves INDIRECT_TYPE_P from cp/cp-tree.h to tree.h to unify POINTER_TYPE_P in tree.h to INDIRECT_TYPE_P, which are equivalent. gcc/cp/ChangeLog: * cp-tree.h (INDIRECT_TYPE_P): Remove. gcc/ChangeLog: * tree.h (INDIRECT_TYPE_P): Define. Signed-off-by: Ken Matsui --- g

Re: [PATCH v3] Implement new RTL optimizations pass: fold-mem-offsets.

2023-07-18 Thread Vineet Gupta
Hi Manolis, On 7/18/23 11:01, Jeff Law via Gcc-patches wrote: Vineet @ Rivos has indicated he stumbled across an ICE with the V3 code.  Hopefully he'll get a testcase for that extracted shortly. Yeah, I was trying to build SPEC2017 with this patch and ran into ICE for several of them with -O

[PATCH 6/8] tree: Remove POINTER_TYPE_P

2023-07-18 Thread Ken Matsui via Gcc-patches
Since POINTER_TYPE_P was completely replaced by INDIRECT_TYPE_P, it can be deleted. gcc/ChangeLog: * tree.h (POINTER_TYPE_P): Remove. Signed-off-by: Ken Matsui --- gcc/tree.h | 7 --- 1 file changed, 7 deletions(-) diff --git a/gcc/tree.h b/gcc/tree.h index d548dce63f7..347e676e73

[PATCH 7/8] tree: Define TYPE_REF_IS_LVALUE

2023-07-18 Thread Ken Matsui via Gcc-patches
This patch defines TYPE_REF_IS_LVALUE to determine if a type is a C++ lvalue reference. gcc/ChangeLog: * tree.h (TYPE_REF_IS_LVALUE): Define. Signed-off-by: Ken Matsui --- gcc/tree.h | 4 1 file changed, 4 insertions(+) diff --git a/gcc/tree.h b/gcc/tree.h index 347e676e737..0b2c

[PATCH 8/8] c++, lto: Use TYPE_REF_IS_LVALUE

2023-07-18 Thread Ken Matsui via Gcc-patches
gcc/cp/ChangeLog: * decl.cc (copy_fn_p): Use TYPE_REF_IS_LVALUE. * init.cc (maybe_warn_list_ctor): Likewise. * method.cc (early_check_defaulted_comparison): Likewise. * pt.cc (maybe_adjust_types_for_deduction): Likewise. (invalid_nontype_parm_type_p): Likewi

Re: [PATCH v5 4/5] c++modules: report imported CMI files as dependencies

2023-07-18 Thread Ben Boeckel via Gcc-patches
On Tue, Jul 18, 2023 at 16:52:44 -0400, Jason Merrill wrote: > On 6/25/23 12:36, Ben Boeckel wrote: > > On Fri, Jun 23, 2023 at 08:12:41 -0400, Nathan Sidwell wrote: > >> On 6/22/23 22:45, Ben Boeckel wrote: > >>> On Thu, Jun 22, 2023 at 17:21:42 -0400, Jason Merrill wrote: > On 1/25/23 16:06,

  1   2   >