RE: [PATCH 5/21]middle-end: update vectorizer's control update to support picking an exit other than loop latch

2023-11-14 Thread Tamar Christina
> -Original Message- > From: Richard Biener > Sent: Tuesday, November 14, 2023 7:56 AM > To: Tamar Christina > Cc: gcc-patches@gcc.gnu.org; nd ; j...@ventanamicro.com > Subject: RE: [PATCH 5/21]middle-end: update vectorizer's control update to > support picking an exit other than loop lat

Re: [PATCH] tree: Handle BITINT_TYPE in type_contains_placeholder_1 [PR112511]

2023-11-14 Thread Richard Biener
On Tue, 14 Nov 2023, Jakub Jelinek wrote: > Hi! > > The following testcase ICEs because BITINT_TYPE isn't handled in > type_contains_placeholder_1. Given that Ada doesn't emit it, it doesn't > matter that much where exactly we handle it as right now it should never > contain a placeholder; I've

Re: [PATCH] tree: Handle BITINT_TYPE in type_contains_placeholder_1 [PR112511]

2023-11-14 Thread Jakub Jelinek
On Tue, Nov 14, 2023 at 08:10:21AM +, Richard Biener wrote: > > The following testcase ICEs because BITINT_TYPE isn't handled in > > type_contains_placeholder_1. Given that Ada doesn't emit it, it doesn't > > matter that much where exactly we handle it as right now it should never > > contain

Re: [PATCH V3 1/7] df: Add DF_LIVE_SUBREG problem

2023-11-14 Thread Richard Biener
On Mon, Nov 13, 2023 at 11:39 PM Vladimir Makarov wrote: > > > On 11/12/23 07:08, Lehua Ding wrote: > > This patch adds a live_subreg problem to extend the original live_reg to > > track the liveness of subreg. We will only try to trace speudo registers > > who's mode size is a multiple of nature

Pushed: [PATCH v2] LoongArch: Use finer-grained DBAR hints

2023-11-14 Thread Xi Ruoyao
On Tue, 2023-11-14 at 10:26 +0800, chenglulu wrote: > Hi, >   > >  * Before calling this template, the function get_memmodel is called to > process memmodel, which has a piece of code: >   >    /* Workaround for Bugzilla 59448. GCC doesn't track consume properly, > so > be conservati

Re: [PATCH] Fix ICE in vectorizable_nonlinear_induction with bitfield.

2023-11-14 Thread Richard Biener
On Tue, Nov 14, 2023 at 1:56 AM liuhongt wrote: > > if (TREE_CODE (init_expr) == INTEGER_CST) > init_expr = fold_convert (TREE_TYPE (vectype), init_expr); > else > gcc_assert (tree_nop_conversion_p (TREE_TYPE (vectype), >TREE_TYPE (init_expr))); >

Re: [PATCH V3 1/7] df: Add DF_LIVE_SUBREG problem

2023-11-14 Thread Lehua Ding
On 2023/11/14 16:14, Richard Biener wrote: On Mon, Nov 13, 2023 at 11:39 PM Vladimir Makarov wrote: On 11/12/23 07:08, Lehua Ding wrote: This patch adds a live_subreg problem to extend the original live_reg to track the liveness of subreg. We will only try to trace speudo registers who's

Re: Pushed: [PATCH v2] LoongArch: Use finer-grained DBAR hints

2023-11-14 Thread chenglulu
在 2023/11/14 下午4:34, Xi Ruoyao 写道: On Tue, 2023-11-14 at 10:26 +0800, chenglulu wrote: Hi,  * Before calling this template, the function get_memmodel is called to process memmodel, which has a piece of code:    /* Workaround for Bugzilla 59448. GCC doesn't track consume properly,

Re: [PATCH] LoongArch: Disable relaxation if the assembler don't support conditional branch relaxation [PR112330]

2023-11-14 Thread Xi Ruoyao
Ping. I've tested this with Binutils 2.41 and 2.41.50.202311xx several times so it should be OK. On Mon, 2023-11-06 at 15:50 +0800, Xi Ruoyao wrote: /* snip */ > Bootstrapped and regtested on loongarch64-linux-gnu twice: once with > Binutils 2.41, another with Binutils 2.41.50.20231105.  With B

Re: [PATCH] LoongArch: Disable relaxation if the assembler don't support conditional branch relaxation [PR112330]

2023-11-14 Thread chenglulu
在 2023/11/14 下午4:50, Xi Ruoyao 写道: Ping. I've tested this with Binutils 2.41 and 2.41.50.202311xx several times so it should be OK. On Mon, 2023-11-06 at 15:50 +0800, Xi Ruoyao wrote: /* snip */ Bootstrapped and regtested on loongarch64-linux-gnu twice: once with Binutils 2.41, another wit

[PATCH] x86: Make testcase apx-spill_to_egprs-1.c more robust

2023-11-14 Thread Lehua Ding
Hi, This little patch adjust the assert in apx-spill_to_egprs-1.c testcase. The -mapxf compilation option allows more registers to be used, which in turn eliminates the need for local variables to be stored in stack memory. Therefore, the assertion is changed to detects no memory loaded through th

Re: [PATCH V3 1/7] df: Add DF_LIVE_SUBREG problem

2023-11-14 Thread Richard Biener
On Tue, Nov 14, 2023 at 9:38 AM Lehua Ding wrote: > > > > On 2023/11/14 16:14, Richard Biener wrote: > > On Mon, Nov 13, 2023 at 11:39 PM Vladimir Makarov > > wrote: > >> > >> > >> On 11/12/23 07:08, Lehua Ding wrote: > >>> This patch adds a live_subreg problem to extend the original live_reg to

[PATCH v1] LoongArch: Added code generation support for call36 function calls.

2023-11-14 Thread Lulu Cheng
When compiling with '-mcmodel=medium', the function call is made through 'pcaddu18i+jirl' if binutils supports call36, otherwise the native implementation 'pcalau12i+jirl' is used. gcc/ChangeLog: * config.in: Regenerate. * config/loongarch/loongarch-opts.h (HAVE_AS_SUPPORT_CALL36)

Re: [PATCH v1] LoongArch: Added code generation support for call36 function calls.

2023-11-14 Thread Xi Ruoyao
On Tue, 2023-11-14 at 17:45 +0800, Lulu Cheng wrote: > +  /* When function calls are made through call36, t0 register will be > + implicitly modified, so '-fno-ipa-ra' needs to be set here.  */ >    case CMODEL_MEDIUM: > + if (HAVE_AS_SUPPORT_CALL36) > +   opts->x_flag_ipa_ra =

[PATCH] Only allow (copysign x, NEG_CONST) -> (fneg (fabs x)) simplification for constant folding [PR112483]

2023-11-14 Thread Xi Ruoyao
From: Andrew Pinski On targets with native copysign instructions, (copysign x, -1) is usually more efficient than (fneg (fabs x)). Since r14-5284, in the middle end we always optimize (fneg (fabs x)) to (copysign x, -1), not vice versa. If the target does not support native fcopysign, expand_CO

[avr,committed] Libf7: Use paper-pencil algorithm for sqrt

2023-11-14 Thread Georg-Johann Lay
This uses the paper-pencil method to compute IEEE square root. It is faster than previous 3 * Newton-Raphson, slightly more precise, and has almost exact same code size. Johann -- LibF7: Use paper-pencil method for sqrt instead of Newton-Raphson iteration. libgcc/config/avr/libf7/ * l

Re: [PATCH] x86: Make testcase apx-spill_to_egprs-1.c more robust

2023-11-14 Thread Hongtao Liu
On Tue, Nov 14, 2023 at 5:01 PM Lehua Ding wrote: > > Hi, > > This little patch adjust the assert in apx-spill_to_egprs-1.c testcase. > The -mapxf compilation option allows more registers to be used, which in > turn eliminates the need for local variables to be stored in stack memory. > Therefore,

Re: [PATCH v7 2/5] OpenMP/OpenACC: Rework clause expansion and nested struct handling

2023-11-14 Thread Tobias Burnus
Hi Julian, first round of comments - I think I need a second pass as the patch is long and complex. The depth of review also was decreasing, hence, I assume I will spot things in later parts of the compiler. In any case, I think the patch is a huge leap forward and very useful! Contrary to prev

Re: [PATCH] Only allow (copysign x, NEG_CONST) -> (fneg (fabs x)) simplification for constant folding [PR112483]

2023-11-14 Thread Richard Biener
On Tue, Nov 14, 2023 at 11:04 AM Xi Ruoyao wrote: > > From: Andrew Pinski > > On targets with native copysign instructions, (copysign x, -1) is > usually more efficient than (fneg (fabs x)). Since r14-5284, in the > middle end we always optimize (fneg (fabs x)) to (copysign x, -1), not > vice ve

[Committed] IBM Z: Fix ICE with overloading and checking enabled

2023-11-14 Thread Andreas Krebbel
s390_resolve_overloaded_builtin, when called on NON_DEPENDENT_EXPR, ICEs when using the type from it which ends up as error_mark_node. This particular instance of the problem does not occur anymore since NON_DEPENDENT_EXPR has been removed. Nevertheless that case needs to be handled here. Bootst

[Committed] IBM Z: Add GTY marker to builtin data structures

2023-11-14 Thread Andreas Krebbel
This adds GTY markers to s390_builtin_types, s390_builtin_fn_types, and s390_builtin_decls. These were missing causing problems in particular when using builtins after including a precompiled header. Unfortunately the declaration of these data structures use enum values from s390-builtins.h. This

Re: [PATCH] x86: Make testcase apx-spill_to_egprs-1.c more robust

2023-11-14 Thread Lehua Ding
Committed, thanks Hongtao. On 2023/11/14 18:24, Hongtao Liu wrote: On Tue, Nov 14, 2023 at 5:01 PM Lehua Ding wrote: Hi, This little patch adjust the assert in apx-spill_to_egprs-1.c testcase. The -mapxf compilation option allows more registers to be used, which in turn eliminates the need f

[PATCH] s390: Fix vec_scatter_element for vectors of floats

2023-11-14 Thread Stefan Schulze Frielinghaus
The offset for vec_scatter_element of floats should be a vector of type UV4SI instead of V4SF. Note, this is an incompatibility change. Bootstrapped on s390. Ok for mainline? gcc/ChangeLog: * config/s390/s390-builtin-types.def: Add/remove types. * config/s390/s390-builtins.def

[PATCH] tree-optimization/112281 - loop distribution and zero dependence distances

2023-11-14 Thread Richard Biener
We currently distribute for (c = 2; c; c--) for (e = 0; e < 2; e++) { d[c] = b = d[c + 1]; d[c + 1].a = 0; } in a wrong way where the inner loop zero dependence distance should make us preserve stmt execution order. We fail to do so since we only look for a fully zero dista

[PATCH] Loop distribution fix for SCC detection

2023-11-14 Thread Richard Biener
The following adjusts data_dep_in_cycle_p to properly consider the whole loop nest when looking for data dep cycles and exempting zero-distance DDRs instead of just the outermost loop. Bootstrap & regtest running on x86_64-unknown-linux-gnu. * tree-loop-distribution.cc (loop_distribution:

[PATCH] i386: Fix up 3_doubleword_lowpart [PR112523]

2023-11-14 Thread Jakub Jelinek
Hi! On Sun, Nov 12, 2023 at 09:03:42PM -, Roger Sayle wrote: > This patch improves register pressure during reload, inspired by PR 97756. > Normally, a double-word right-shift by a constant produces a double-word > result, the highpart of which is dead when followed by a truncation. > The dead

Re: [PATCH] i386: Fix up 3_doubleword_lowpart [PR112523]

2023-11-14 Thread Uros Bizjak
On Tue, Nov 14, 2023 at 1:07 PM Jakub Jelinek wrote: > > Hi! > > On Sun, Nov 12, 2023 at 09:03:42PM -, Roger Sayle wrote: > > This patch improves register pressure during reload, inspired by PR 97756. > > Normally, a double-word right-shift by a constant produces a double-word > > result, the

Re: Re: [PATCH v1] RISC-V: Support vec_init for trailing same element

2023-11-14 Thread Jakub Jelinek
On Fri, Nov 10, 2023 at 04:11:44PM +0800, juzhe.zh...@rivai.ai wrote: > And I have revert this patch since we can disscuss more about this pattern > optimization. Unfortunately this broke the ChangeLog generation for several days. The commit message says: Revert "RISC-V: Support vec_init for trai

RE: Re: [PATCH v1] RISC-V: Support vec_init for trailing same element

2023-11-14 Thread Li, Pan2
Sorry for the unexpected impact, good to know the rule about git revert, will pay more attention for it. Pan -Original Message- From: Jakub Jelinek Sent: Tuesday, November 14, 2023 8:28 PM To: juzhe.zh...@rivai.ai Cc: Richard Biener ; Li, Pan2 ; gcc-patches ; Wang, Yanzhang ; kito.ch

Re: [PATCH v1] LoongArch: Added code generation support for call36 function calls.

2023-11-14 Thread chenglulu
在 2023/11/14 下午5:55, Xi Ruoyao 写道: On Tue, 2023-11-14 at 17:45 +0800, Lulu Cheng wrote: +  /* When function calls are made through call36, t0 register will be +implicitly modified, so '-fno-ipa-ra' needs to be set here.  */    case CMODEL_MEDIUM: + if (HAVE_AS_SUPPORT_CA

Re: [PATCH] i386: Fix up 3_doubleword_lowpart [PR112523]

2023-11-14 Thread Richard Biener
On Tue, Nov 14, 2023 at 1:07 PM Jakub Jelinek wrote: > > Hi! > > On Sun, Nov 12, 2023 at 09:03:42PM -, Roger Sayle wrote: > > This patch improves register pressure during reload, inspired by PR 97756. > > Normally, a double-word right-shift by a constant produces a double-word > > result, the

Re: [PATCH] libcpp, contrib: Update to Unicode 15.1

2023-11-14 Thread Jason Merrill
On 11/14/23 02:33, Jakub Jelinek wrote: Hi! On Tue, Nov 14, 2023 at 08:23:27AM +0100, Jakub Jelinek wrote: The following patch (in plaintext just a pseudo-patch where I've left out the too big parts of either wget downloaded or regenerated files out with ..., full patch attached compressed) upd

Re: [PATCH] c++, v2: Implement C++26 P1854R4 - Making non-encodable string literals ill-formed [PR110341]

2023-11-14 Thread Jason Merrill
On 11/3/23 14:58, Jakub Jelinek wrote: On Thu, Nov 02, 2023 at 10:23:27PM -0400, Jason Merrill wrote: Under the existing diagnostic I'd like to distinguish the different cases more, e.g. "multicharacter literal with %d characters exceeds 'int' size of %d bytes" "multicharacter literal cannot ha

[PATCH] tree-optimization/111233 - loop splitting miscompile

2023-11-14 Thread Richard Biener
The change in r14-2852-gf5fb9ff2396fd4 failed to update patch_loop_exit to compensate for rewriting of a NE/EQ_EXPR to a new code. Fixed with the following. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. PR tree-optimization/111233 PR tree-optimization/111652

[PATCH] RISC-V: Save/restore ra register correctly [PR112478]

2023-11-14 Thread Kito Cheng
We set ra to fixed register now, but we still need to save/restore that at prologue/epilogue if that has used. gcc/ChangeLog: PR target/112478 * config/riscv/riscv.cc (riscv_save_return_addr_reg_p): Check ra is ever lived. gcc/testsuite/gcc/ChangeLog: PR target/1

[PATCH v2] RISC-V: Implement target attribute

2023-11-14 Thread Kito Cheng
The target attribute which proposed in [1], target attribute allow user to specify a local setting per-function basis. The syntax of target attribute is `__attribute__((target("")))`. and the syntax of `` describes below: ``` ATTR-STRING := ATTR-STRING ';' ATTR | ATTR ATTR:=

Re: [PATCH v2] RISC-V: Implement target attribute

2023-11-14 Thread Kito Cheng
Oh damm, I found it should be v3, but anyway it's the latest version for the target attribute support...

RE: [PATCH] Add a REG_P check for inc and dec for Arm MVE

2023-11-14 Thread Kyrylo Tkachov
Hi Saurabh, > -Original Message- > From: Saurabh Jha > Sent: Thursday, November 9, 2023 10:12 AM > To: gcc-patches@gcc.gnu.org; Richard Earnshaw > ; Richard Sandiford > > Subject: [PATCH] Add a REG_P check for inc and dec for Arm MVE > > Hey, > > This patch tightens mve_vector_mem_oper

Re: [PATCH V3 1/7] df: Add DF_LIVE_SUBREG problem

2023-11-14 Thread Vladimir Makarov
On 11/14/23 04:03, Richard Biener wrote: I suggest you farm bugzilla for the compile-time-hog / memory-hog testcases. I do have a set of "large" testcases. Scanning results points at PRs 36262, 37448, 39326, 69609 all having RA in the 20% area at -O0 -g. It's also a good idea to take say cc1

Re: [PATCH] s390: Fix vec_scatter_element for vectors of floats

2023-11-14 Thread Andreas Krebbel
On 11/14/23 12:44, Stefan Schulze Frielinghaus wrote: > The offset for vec_scatter_element of floats should be a vector of type > UV4SI instead of V4SF. Note, this is an incompatibility change. > > Bootstrapped on s390. Ok for mainline? > > gcc/ChangeLog: > > * config/s390/s390-builtin-t

[PATCH] s390: Fix builtins floating-point convert to/from fixed

2023-11-14 Thread Stefan Schulze Frielinghaus
Remove flags for non-existing operands 2 and 3. Bootstrapped on s390. Ok for mainline? gcc/ChangeLog: * config/s390/s390-builtins.def (s390_vcefb,s390_vcdgb,s390_vcelfb,s390_vcdlgb,s390_vcfeb,s390_vcgdb, s390_vclfeb,s390_vclgdb): Remove flags for non-existing operands

[COMMITTED] PR tree-optimization/112509 - Use case label type to create case range.

2023-11-14 Thread Andrew MacLeod
We should create a range from the case labels directly, and then cast it to the type we care about rather than trying to convert it to the switch index type and then the type we care about. Bootstraps on x86_64-pc-linux-gnu  with no regressions.   Pushed. Andrew From 4553a0496458a712dfd2f04b98

Re: [PATCH] c++: non-dependent .* folding [PR112427]

2023-11-14 Thread Patrick Palka
On Fri, 10 Nov 2023, Jason Merrill wrote: > On 11/10/23 10:28, Patrick Palka wrote: > > On Fri, 10 Nov 2023, Patrick Palka wrote: > > > > > On Thu, 9 Nov 2023, Jason Merrill wrote: > > > > > > > On 11/8/23 16:59, Patrick Palka wrote: > > > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, d

[committed] libstdc++: Fix std::deque::size() Xmethod [PR112491]

2023-11-14 Thread Jonathan Wakely
Tested x86_64-linux. Pushed to trunk. Backports to follow. -- >8 -- The Xmethod for std::deque::size() assumed that the first element would be at the start of the first node. That's only true if elements are only added at the back. If an element is inserted at the front, or removed from the front

Re: [PATCH v2] c++: fix parsing with auto(x) [PR112410]

2023-11-14 Thread Marek Polacek
On Mon, Nov 13, 2023 at 09:26:41PM -0500, Jason Merrill wrote: > On 11/10/23 20:13, Marek Polacek wrote: > > On Thu, Nov 09, 2023 at 07:07:03PM -0500, Jason Merrill wrote: > > > On 11/9/23 14:58, Marek Polacek wrote: > > > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > > > > >

Re: [PATCH v4] gcc: Introduce -fhardened

2023-11-14 Thread Marek Polacek
On Tue, Nov 14, 2023 at 08:46:16AM +0100, Richard Biener wrote: > On Fri, Nov 3, 2023 at 11:51 PM Marek Polacek wrote: > > > > On Thu, Oct 26, 2023 at 05:55:56PM +0200, Richard Biener wrote: > > > > > > > > > > Am 24.10.2023 um 21:09 schrieb Marek Polacek : > > > > > > > > On Tue, Oct 24, 2023 at

Re: [PATCH] bpf: Corrected condition in core_mark_as_access_index.

2023-11-14 Thread David Faust
On 11/13/23 14:36, Cupertino Miranda wrote: > gcc/ChangeLog: > * config/bpf/core-builtins.cc (core_mark_as_access_index): > Corrected check. OK, thanks. > --- > gcc/config/bpf/core-builtins.cc | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gcc/config/bpf

[PATCH] c++: decltype of (non-captured variable) [PR83167]

2023-11-14 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- For decltype((x)) within a lambda where x is not captured, we dubiously require that the lambda has a capture default, unlike for decltype(x). This patch fixes this inconsistency; I couldn't find a justificat

Re: [PATCH v2] AArch64: Cleanup memset expansion

2023-11-14 Thread Wilco Dijkstra
Hi, >>> I checked codesize on SPECINT2017, and 96 had practically identical size. >>> Using 128 would also be a reasonable Os value with a very slight size >>> increase, >>> and 384 looks good for O2 - however I didn't want to tune these values >>> as this >>> is a cleanup patch. >>> >>> Cheers, >

Re: [PATCH] Fixed problem with BTF defining smaller enums.

2023-11-14 Thread David Faust
Hi Cupertino, A couple of comments inline. On 11/13/23 14:37, Cupertino Miranda wrote: > This patch fixes a BTF, which would become invalid when having > smaller then 4 byte definitions of enums. > For example, when using the __attribute__((mode(byte))) in the enum > definition. Please add a tes

[pushed] json: reduce use of naked new in json-building code

2023-11-14 Thread David Malcolm
No functional change intended. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r14-5451-g070944fdd6394c gcc/ChangeLog: * diagnostic-format-json.cc: Use type-specific "set_*" functions of json::object to avoid naked new of json value subclasses.

[pushed] input.h: eliminate implicit users of global_dc's file_cache

2023-11-14 Thread David Malcolm
This patch eliminates the following functions that implicitly used global_dc's file cache: extern char_span location_get_source_line (const char *file_path, int line); extern char_span get_source_file_content (const char *file_path); extern bool location_missing_trailing_newline (const char

[PATCH] c++: direct enum init from type-dep elt [PR112515]

2023-11-14 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- The NON_DEPENDENT_EXPR removal exposed that is_direct_enum_init may end up checking convertibility of a type-dependent argument. PR c++/112515 gcc/cp/ChangeLog: * decl.cc (is_direct_enum_in

Re: [PATCH v2] AArch64: Cleanup memset expansion

2023-11-14 Thread Richard Earnshaw
On 14/11/2023 16:23, Wilco Dijkstra wrote: Hi, I checked codesize on SPECINT2017, and 96 had practically identical size. Using 128 would also be a reasonable Os value with a very slight size increase, and 384 looks good for O2 - however I didn't want to tune these values as this is a cleanup

Re: [PATCH 3/3] diagnostics: use the .opt.urls files to urlify quoted text

2023-11-14 Thread Arthur Cohen
Hi David, ACK for the Rust patches. Thanks a lot for working on this :) Kindly, Arthur On 11/10/23 22:42, David Malcolm wrote: This patch adds machinery for using the .opt.urls files linking to the documentation of our options in gcc_urlifier. For every enabled .opt file, the corresponding .

Re: [PATCH] bpf: Delayed the removal of the parser enum plugin handler.

2023-11-14 Thread David Faust
On 11/13/23 14:35, Cupertino Miranda wrote: > The parser plugin handler that is responsible for collecting enum values > information was being removed way too early. > bpf_resolve_overloaded_core_builtin is called by the parser. > It was moved to the function execute_lower_bpf_core. > OK, than

Re: [PATCH v2] AArch64: Cleanup memset expansion

2023-11-14 Thread Wilco Dijkstra
Hi Richard, > +/* Maximum bytes set for an inline memset expansion.  With -Os use 3 STP > +   and 1 MOVI/DUP (same size as a call).  */ > +#define MAX_SET_SIZE(speed) (speed ? 256 : 96) > So it looks like this assumes we have AdvSIMD.  What about > -mgeneral-regs-only? After my strictalign bugf

Re: [committed 01/22] arm: testsuite: correctly detect armv6t2 hardware for acle execution tests

2023-11-14 Thread Christophe Lyon
Hi, On 11/13/23 15:26, Richard Earnshaw wrote: diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 1a7bea96c1e..d414cddf4dc 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -5590,6 +5590,24 @@ proc che

Re: [PATCH V3 1/7] df: Add DF_LIVE_SUBREG problem

2023-11-14 Thread Vladimir Makarov
On 11/14/23 03:38, Lehua Ding wrote: This is perfectly fine, the code inside the live_subreg problem has a branch that goes through similar logic to live_reg if it finds no subreg inside the program. Then when the optimization level is less than 2, it doesn't track the subreg. By the way,

Re: [committed 01/22] arm: testsuite: correctly detect armv6t2 hardware for acle execution tests

2023-11-14 Thread Richard Earnshaw
On 14/11/2023 17:01, Christophe Lyon wrote: Hi, On 11/13/23 15:26, Richard Earnshaw wrote: diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 1a7bea96c1e..d414cddf4dc 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/tar

[committed] i386: Generate strict_low_part QImode insn with high input register

2023-11-14 Thread Uros Bizjak
Following testcase: struct S1 { unsigned char val; unsigned char pad1; unsigned short pad2; }; struct S2 { unsigned char pad1; unsigned char val; unsigned short pad2; }; struct S1 test_and (struct S1 a, struct S2 b) { a.val &= b.val; return a; } compiles with -O2 to: movl

[PATCH] c++, v2: Implement C++26 P2864R2 - Remove Deprecated Arithmetic Conversion on Enumerations From C++26

2023-11-14 Thread Jakub Jelinek
On Mon, Nov 13, 2023 at 10:59:52PM -0500, Jason Merrill wrote: > On 11/13/23 06:50, Jakub Jelinek wrote: > > The following patch implements C++26 P2864R2 by emitting pedwarn enabled by > > the same options as the C++20 and later warnings (i.e. -Wenum-compare, > > -Wdeprecated-enum-enum-conversion a

[PATCH v2 0/8] Turn some C warnings into errors by default

2023-11-14 Thread Florian Weimer
This new series covers: -Wint-conversion -Wimplicit-function-declaration -Wimplicit-int -Wreturn-mismatch -Wincompatible-pointer-types -Wdeclaration-missing-parameter-type (new) There are now gcc.dg/permerror-*.c tests which track the graduation of warnings to errors. It turns out th

[PATCH v2 1/8] Add tests for validating future C permerrors

2023-11-14 Thread Florian Weimer
The dg-error directives for gcc.dg/permerror-system.c can be generated using (for the most part at least): perl -ne 'print if s,.*(/\* \{ dg-error .*) } \*/$,$1 "" { target *-*-* } $. } */,' \ < gcc/testsuite/gcc.dg/permerror-default.c gcc/testsuite/ * gcc.dg/permerror-default.c: New

[PATCH v2 2/8] c: Turn int-conversion warnings into permerrors

2023-11-14 Thread Florian Weimer
gcc/ * doc/invoke.texi (Warning Options): Document changes. gcc/c/ PR c/96284 PR c/106416 * c-typeck.cc (build_conditional_expr): Use permerror_opt for pointer/integer type mismatches, based on -Wint-conversion. (pedwarn_permerror_init, permerror_i

[PATCH v2 3/8] c: Turn -Wimplicit-function-declaration into a permerror

2023-11-14 Thread Florian Weimer
In the future, it may make sense to avoid cascading errors from the implicit declaration, especially its assumed int return type. This change here only changes the kind of the diagnostic, not its wording or consequences. gcc/ * doc/invoke.texi (Warning Options): Document changes. gcc/c/

[PATCH v2 6/8] c: Turn -Wreturn-mismatch into a permerror

2023-11-14 Thread Florian Weimer
gcc/ * doc/invoke.texi (Warning Options): Document changes. gcc/c/ PR c/96284 * c-typeck.cc (c_finish_return): Use permerrors for OPT_Wreturn_mismatch diagnostics. gcc/testsuite/ * gcc.dg/permerror-default.c (return_mismatch_1) (return_mismatch_2

[PATCH v2 4/8] c: Turn -Wimplicit-int into a permerror

2023-11-14 Thread Florian Weimer
Most of these new permerrors are currently not diagnosed in system headers. gcc/ PR c/91093 PR c/96284 * doc/invoke.texi (Warning Options): Document changes. gcc/c/ * c-decl.cc (warn_defaults_to): Remove. (grok_declarator, start_function): Call permerror_

[PATCH v2 7/8] c: Turn -Wincompatible-pointer-types into a permerror

2023-11-14 Thread Florian Weimer
The change to build_conditional_expr drops the downgrade from a pedwarn to warning for builtins. gcc/ * doc/invoke.texi (Warning Options): Document changes. gcc/c/ PR c/96284 * c-typeck.cc (build_conditional_expr): Upgrade most pointer type mismatches to a permer

Re: [committed] i386: Return CCmode from ix86_cc_mode for unknown RTX code [PR112494]

2023-11-14 Thread Jakub Jelinek
On Mon, Nov 13, 2023 at 10:49:23PM +0100, Uros Bizjak wrote: > Combine wants to combine following instructions into an insn that can > perform both an (arithmetic) operation and set the condition code. During > the conversion a new RTX is created, and combine passes the RTX code of the > innermost

[PATCH v2 5/8] c: Do not ignore some forms of -Wimplicit-int in system headers

2023-11-14 Thread Florian Weimer
Most -Wimplicit-int warnings were unconditionally disabled for system headers. Only missing types for parameters in old-style function definitions resulted in warnings. This is inconsistent with the treatment of other permerrors, which are active in system headers. gcc/c/ * c-decl.cc (g

[PATCH v2 8/8] c: Add new -Wdeclaration-missing-parameter-type permerror

2023-11-14 Thread Florian Weimer
This used to be a warning, enabled by default, without its own option. A subsequent change could improve diagnostics and provide spelling hints for declarations like “void function (int32t);”. gcc/c-family/ * c.opt (Wdeclaration-missing-parameter-type): New. gcc/c/ChangeLog: PR

Re: [PATCH V3 1/7] df: Add DF_LIVE_SUBREG problem

2023-11-14 Thread Vladimir Makarov
On 11/14/23 12:18, Vladimir Makarov wrote: On 11/14/23 03:38, Lehua Ding wrote: This is perfectly fine, the code inside the live_subreg problem has a branch that goes through similar logic to live_reg if it finds no subreg inside the program. Then when the optimization level is less than

[pushed] diagnostics: convert diagnostic_ready_p to an inline function

2023-11-14 Thread David Malcolm
No functional change intended. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r14-5457-gd0bfd6ba3ba77f. gcc/ChangeLog: * diagnostic.h (diagnostic_ready_p): Convert from macro to inline function. --- gcc/diagnostic.h | 6 +- 1 file changed, 5

[pushed] diagnostics: make m_text_callbacks private

2023-11-14 Thread David Malcolm
No functional change intended. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r14-5458-g07e568d77f364e. gcc/ChangeLog: * diagnostic-show-locus.cc (diagnostic_context::show_locus): Update for renaming of text callbacks fields. * diagnostic

[pushed] diagnostics: make option-handling callbacks private

2023-11-14 Thread David Malcolm
No functional change intended. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to trunk as r14-5459-g353f146cebbf22. gcc/c-family/ChangeLog: * c-warn.cc (conversion_warning): Update call to global_dc->m_option_enabled to use option_enabled_p. gcc/cp/ChangeLo

[committed] testsuite: Ignore warning for unsupported option

2023-11-14 Thread Dimitar Dimitrov
The -w option was used in gcc.dg/20020206-1.c to ignore warnings if the '-fprefetch-loop-arrays' option is not supported by target. When commit r14-5380-g5c432b0efab54e removed the -w option, some targets (arm-none-eabi, pru and possibly others) started failing the test: cc1: warning: '-fprefet

Re: [committed] testsuite: Ignore warning for unsupported option

2023-11-14 Thread Hans-Peter Nilsson
> From: Dimitar Dimitrov > Date: Tue, 14 Nov 2023 22:00:14 +0200 > The -w option was used in gcc.dg/20020206-1.c to ignore warnings if the > '-fprefetch-loop-arrays' option is not supported by target. > > When commit r14-5380-g5c432b0efab54e removed the -w option, some targets > (arm-none-eabi,

Re: [PATCH V3 2/7] ira: Switch to live_subreg data

2023-11-14 Thread Vladimir Makarov
On 11/12/23 07:08, Lehua Ding wrote: This patch switch the use of live_reg data to live_subreg data. gcc/ChangeLog: * ira-build.cc (create_bb_allocnos): Switch. Switch to what? Although from the patch itself someone can figure it out, you should write it in the changelog entry.

Re: [PATCH v1] LoongArch: Added code generation support for call36 function calls.

2023-11-14 Thread Xi Ruoyao
On Tue, 2023-11-14 at 20:46 +0800, chenglulu wrote: > > 在 2023/11/14 下午5:55, Xi Ruoyao 写道: > > On Tue, 2023-11-14 at 17:45 +0800, Lulu Cheng wrote: > > > +  /* When function calls are made through call36, t0 register > > > will be > > > + implicitly modified, so '-fno-ipa-ra' needs to be set

Re: [PATCH v2 8/8] c: Add new -Wdeclaration-missing-parameter-type permerror

2023-11-14 Thread Marek Polacek
On Tue, Nov 14, 2023 at 06:50:58PM +0100, Florian Weimer wrote: > --- a/gcc/c-family/c.opt > +++ b/gcc/c-family/c.opt > @@ -591,6 +591,10 @@ Wdeclaration-after-statement > C ObjC Var(warn_declaration_after_statement) Init(-1) Warning > Warn when a declaration is found after a statement. > > +Wd

Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext

2023-11-14 Thread David Edelsohn
Arsen, Unfortunately this broke bootstrap on AIX. I had not seen this series of patches. David

Re: [PATCH V3 3/7] ira: Support subreg live range track

2023-11-14 Thread Vladimir Makarov
On 11/12/23 07:08, Lehua Ding wrote: gcc/ChangeLog: * hard-reg-set.h (struct HARD_REG_SET): New shift operator. * ira-build.cc (ira_create_object): Adjust. (find_object): New. (find_object_anyway): New. (ira_create_allocno): Adjust. (get_range):

Re: [PATCH 1/4] c-family: Add handling for clang-style attributes [PR109877].

2023-11-14 Thread Jason Merrill
On 11/13/23 01:02, Iain Sandoe wrote: The clang compiler supports essentially arbitrary, per-attribute, syntax and token forms for attribute arguments. This extends to the case where token forms are required to be accepted that are not part of the valid set for standard C or C++. A motivating

Re: [PATCH v1] LoongArch: Added code generation support for call36 function calls.

2023-11-14 Thread Xi Ruoyao
On Wed, 2023-11-15 at 04:26 +0800, Xi Ruoyao wrote: > On Tue, 2023-11-14 at 20:46 +0800, chenglulu wrote: > > > > 在 2023/11/14 下午5:55, Xi Ruoyao 写道: > > > On Tue, 2023-11-14 at 17:45 +0800, Lulu Cheng wrote: > > > > +  /* When function calls are made through call36, t0 register > > > > will be

Re: [PATCH v1] LoongArch: Added code generation support for call36 function calls.

2023-11-14 Thread Xi Ruoyao
On Wed, 2023-11-15 at 04:42 +0800, Xi Ruoyao wrote: > > There seems a better solution as suggested by the GCC internal doc. > > Section 18.9.16 mentions -fipa-ra: > > > >  -- Target Hook: bool TARGET_CALL_FUSAGE_CONTAINS_NON_CALLEE_CLOBBERS > > Set to true if each call that binds to a local

[pushed] analyzer: enable taint state machine by default [PR103533]

2023-11-14 Thread David Malcolm
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Integration testing of analyzer shows no significant differences. Pushed to trunk as r14-5464-gcfaaa8b11b8429. gcc/analyzer/ChangeLog: PR analyzer/103533 * sm-taint.cc: Remove "experimental" from comment. * sm.c

Re: [PATCH 3/4] c-family, C++: Handle clang attributes [PR109877].

2023-11-14 Thread Marek Polacek
On Sun, Nov 12, 2023 at 08:02:43PM -1000, Iain Sandoe wrote: > This adds the ability to defer the validation of numeric attribute > arguments until the sequence is parsed if the attribute being > handled is one known to be 'clang form'. > > We do this by considering the arguments to be strings reg

[PATCH] c++: partially inst requires-expr in noexcept-spec [PR101043]

2023-11-14 Thread Patrick Palka
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- Here we're ICEing from strip_typedefs for the partially instantiated requires-expression when walking its REQUIRES_EXPR_EXTRA_ARGS since it's a TREE_LIST with non-empty TREE_PURPOSE (to hold the captured loca

Re: [committed] testsuite: Ignore warning for unsupported option

2023-11-14 Thread Florian Weimer
* Dimitar Dimitrov: > The -w option was used in gcc.dg/20020206-1.c to ignore warnings if the > '-fprefetch-loop-arrays' option is not supported by target. > > When commit r14-5380-g5c432b0efab54e removed the -w option, some targets > (arm-none-eabi, pru and possibly others) started failing the te

Re: [PATCH] Only allow (copysign x, NEG_CONST) -> (fneg (fabs x)) simplification for constant folding [PR112483]

2023-11-14 Thread Xi Ruoyao
On Tue, 2023-11-14 at 11:44 +0100, Richard Biener wrote: > > diff --git a/gcc/simplify-rtx.cc b/gcc/simplify-rtx.cc > > index 2d2e5a3c1ca..f3745d86aea 100644 > > --- a/gcc/simplify-rtx.cc > > +++ b/gcc/simplify-rtx.cc > > @@ -4392,7 +4392,7 @@ simplify_ashift: > >    real_convert (&f1, mode

Re: [PATCH] rs6000: Disable PCREL for unsupported targets [PR111045]

2023-11-14 Thread Peter Bergner
On 11/13/23 8:33 PM, Kewen.Lin wrote: >> if (PCREL_SUPPORTED_BY_OS) > >> + else >> +{ >> + if (TARGET_PCREL >> + && (rs6000_isa_flags_explicit & OPTION_MASK_PCREL) != 0) >> +error ("use of %qs is invalid for this target", "-mpcrel"); >>rs6000_isa_flags &= ~OPTION_MAS

[PATCH v2] LoongArch: Remove redundant barrier instructions before LL-SC loops

2023-11-14 Thread Xi Ruoyao
This is isomorphic to the LLVM changes [1-2]. On LoongArch, the LL and SC instructions has memory barrier semantics: - LL: + - SC: + But the compare and swap operation is allowed to fail, and if it fails the SC instruction is not executed, thus the guarantee of acquiring semantics cannot be

Re: [PATCH] c++, v2: Implement C++26 P2864R2 - Remove Deprecated Arithmetic Conversion on Enumerations From C++26

2023-11-14 Thread Jason Merrill
On 11/14/23 12:38, Jakub Jelinek wrote: On Mon, Nov 13, 2023 at 10:59:52PM -0500, Jason Merrill wrote: On 11/13/23 06:50, Jakub Jelinek wrote: The following patch implements C++26 P2864R2 by emitting pedwarn enabled by the same options as the C++20 and later warnings (i.e. -Wenum-compare, -Wdep

[PATCH 0/4] gcov: Improve -fprofile-update=atomic

2023-11-14 Thread Sebastian Huber
Sebastian Huber (4): gcov: Remove TARGET_GCOV_TYPE_SIZE target hook Add TARGET_HAVE_LIBATOMIC gcov: Add gen_counter_update() gcov: Improve -fprofile-update=atomic gcc/c-family/c-cppbuiltin.cc | 4 +- gcc/config/rtems.h | 2 + gcc/config/sparc/rtemself.h | 2 - gcc/config/

[PATCH 2/4] Add TARGET_HAVE_LIBATOMIC

2023-11-14 Thread Sebastian Huber
Add target data to indicate if libatomic is available. gcc/ChangeLog: * config/rtems.h (TARGET_HAVE_LIBATOMIC): Define. * doc/tm.texi: Regenerate. * doc/tm.texi.in (TARGET_HAVE_LIBATOMIC): Add. * target.def (have_libatomic): New. --- gcc/config/rtems.h | 2 ++ gcc

[PATCH 3/4] gcov: Add gen_counter_update()

2023-11-14 Thread Sebastian Huber
Move the counter update to the new gen_counter_update() helper function. Use it in gimple_gen_edge_profiler() and gimple_gen_time_profiler(). The resulting gimple instructions should be identical with the exception of the removed unshare_expr() call. The unshare_expr() call was used in gimple_ge

[PATCH 1/4] gcov: Remove TARGET_GCOV_TYPE_SIZE target hook

2023-11-14 Thread Sebastian Huber
This reverts commit 8cdcea51c0fd753e6a652c9b236e91b3a6e0911c. gcc/c-family/ChangeLog: * c-cppbuiltin.cc (c_cpp_builtins): Do not define __LIBGCC_GCOV_TYPE_SIZE. gcc/ChangeLog: * config/sparc/rtemself.h (SPARC_GCOV_TYPE_SIZE): Remove. * config/sparc/sparc.cc (spar

[PATCH 4/4] gcov: Improve -fprofile-update=atomic

2023-11-14 Thread Sebastian Huber
The code coverage support uses counters to determine which edges in the control flow graph were executed. If a counter overflows, then the code coverage information is invalid. Therefore the counter type should be a 64-bit integer. In multi-threaded applications, it is important that the counter

Re: [PATCH v2] c++: fix parsing with auto(x) [PR112410]

2023-11-14 Thread Jason Merrill
On 11/14/23 10:58, Marek Polacek wrote: On Mon, Nov 13, 2023 at 09:26:41PM -0500, Jason Merrill wrote: On 11/10/23 20:13, Marek Polacek wrote: On Thu, Nov 09, 2023 at 07:07:03PM -0500, Jason Merrill wrote: On 11/9/23 14:58, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, o

  1   2   >