[PATCH] [x86] Remove unused mmx_pinsrw.

2023-10-19 Thread liuhongt
When I'm working on enable more 32/64-bit vectorization for _Float16, I notice there's 1 redundant define_expand, the patch removed the expander. Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. Ok for trunk? gcc/ChangeLog: * config/i386/mmx.md (mmx_pinsrw): Removed. --- gcc/co

[PATCH] c: -Wint-conversion should cover pointer/integer mismatches in ?:

2023-10-19 Thread Florian Weimer
gcc/c/ PR c/109827 PR other/44209 * c-typeck.cc (build_conditional_expr): Use OPT_Wint_conversion for pointer/integer mismatch warnings. gcc/testsuite/ * gcc.dg/Wint-conversion-3.c: New. --- gcc/c/c-typeck.cc| 4 ++-- gcc/testsui

[PATCH v9 4/4] ree: Improve ree pass for rs6000 target using defined ABI interfaces

2023-10-19 Thread Ajit Agarwal
Hello All: This version 9 of the patch uses abi interfaces to remove zero and sign extension elimination. Bootstrapped and regtested on powerpc-linux-gnu. In this version (version 9) of the patch following review comments are incorporated. a) Removal of hard code zero_extend and sign_extend i

[PATCH v2] c: Add -Wreturn-mismatch warning, split from -Wreturn-type

2023-10-19 Thread Florian Weimer
The existing -Wreturn-type option covers both constraint violations (which are mandatory to diagnose) and warnings that have known false positives. The new -Wreturn-mismatch warning is only about the constraint violations (missing or extra return expressions), and should eventually be turned into

Re: [PATCH] rename make_eh_edges to make_eh_edge (was: return edge in make_eh_edges)

2023-10-19 Thread Richard Biener
On Fri, Oct 20, 2023 at 8:09 AM Alexandre Oliva wrote: > > On Oct 19, 2023, Richard Biener wrote: > > > Maybe time to do s/make_eh_edges/make_eh_edge/ though. > > How about this? Regstrapped on x86_64-linux-gnu and ppc64le-linux-gnu, > on top of the patches for strub, hardbool, and hardcfr that

Re: [PATCH] Avoid compile time hog on vect_peel_nonlinear_iv_init for nonlinear induction vec_step_op_mul when iteration count is too big.

2023-10-19 Thread Richard Biener
On Fri, Oct 20, 2023 at 4:21 AM liuhongt wrote: > > >So with pow being available this limit shouldn't be necessary any more and > >the testcase adjustment can be avoided? > I tries, compile time still hogs on mpz_powm(3, INT_MAX), so i'll just > keep this. Doh :/ Maybe it's possible to limit the

RE: [PATCH] i386: Prevent splitting to xmm16+ when !TARGET_AVX512VL

2023-10-19 Thread Liu, Hongtao
> -Original Message- > From: Jiang, Haochen > Sent: Friday, October 20, 2023 2:21 PM > To: gcc-patches@gcc.gnu.org > Cc: ubiz...@gmail.com; Liu, Hongtao > Subject: [PATCH] i386: Prevent splitting to xmm16+ when !TARGET_AVX512VL > > Hi all, > > Currently, there will be a chance in spl

[PATCH] i386: Prevent splitting to xmm16+ when !TARGET_AVX512VL

2023-10-19 Thread Haochen Jiang
Hi all, Currently, there will be a chance in split to use x/ymm16+ w/o AVX512VL, which finally leads to an ICE as pr111753 does. This patch aims to fix that. Regtested on x86_64-pc-linux-gnu. Ok for trunk? Thx, Haochen gcc/ChangeLog: PR target/111753 * config/i386/i386.cc (ix8

[PATCH] rename make_eh_edges to make_eh_edge (was: return edge in make_eh_edges)

2023-10-19 Thread Alexandre Oliva
On Oct 19, 2023, Richard Biener wrote: > Maybe time to do s/make_eh_edges/make_eh_edge/ though. How about this? Regstrapped on x86_64-linux-gnu and ppc64le-linux-gnu, on top of the patches for strub, hardbool, and hardcfr that I've just posted. Ok to install? Since make_eh_edges creates

[PATCH v4] Introduce hardbool attribute for C

2023-10-19 Thread Alexandre Oliva
Here's a refreshed and retested version of the patch for hardened booleans in C. It is unchanged aside from some conflict resolution, compared with the previous version posted back in June. https://gcc.gnu.org/pipermail/gcc-patches/2023-June/622668.html Regstrapped on x86_64-linux-gnu and ppc64le

Re: [PATCH] move the (a-b) CMP 0 ? (a-b) : (b-a) optimization from fold_cond_expr_with_comparison to match

2023-10-19 Thread Andrew Pinski
On Mon, Jul 12, 2021 at 4:47 AM Richard Biener via Gcc-patches wrote: > > On Sun, Jul 11, 2021 at 4:12 AM apinski--- via Gcc-patches > wrote: > > > > From: Andrew Pinski > > > > This patch moves the (a-b) CMP 0 ? (a-b) : (b-a) optimization > > from fold_cond_expr_with_comparison to match. > > So

Re: [PATCH v3 1/2] c++: Initial support for P0847R7 (Deducing This) [PR102609]

2023-10-19 Thread waffl3x
> > > > Based on what you've said, I assume that OFFSET_REF handles static > > member functions that are overloaded. But as I've said this seems to > > contradict the comments I'm reading, so I'm not sure that I'm > > understanding you correctly. > > > That's right. For instance, > > struct A {

Re: Enable top-level recursive 'autoreconf'

2023-10-19 Thread Alexandre Oliva
On Oct 19, 2023, Thomas Schwinge wrote: > On 2023-10-18T15:42:18+0100, R jd <3246251196r...@gmail.com> wrote: >> I guess I can ask, why there is not a recursive approach for configuring >> GCC. e.g. AC_SUBDIRS in the top level? > ('AC_CONFIG_SUBDIRS' you mean.) You know, often it just takes som

Re: [PATCH V2] RISC-V: Fix failed hoist in LICM of vmv.v.x instruction

2023-10-19 Thread Lehua Ding
Committed after the commited of the vsetvl pass refactor patch, thanks Robin. On 2023/10/19 16:43, Robin Dapp wrote: Hi Juzhe, as discussed off-list this approach generally makes sense to me so the patch LGTM once the vsetvl rework is upstream and settled. Independently, we still need to unde

Re: [PATCH V3 00/11] Refactor and cleanup vsetvl pass

2023-10-19 Thread Lehua Ding
Committed, thanks Patrick and Juzhe. On 2023/10/20 2:04, Patrick O'Neill wrote: I tested it this morning on my machine and it passed! Tested against: 04d6c74564b7eb51660a00b35353aeab706b5a50 Using targets: glibc rv32gcv qemu glibc rv64gcv qemu This patch series does not introduce any new fail

Re: [PATCH 2/2] tree-optimization/111131 - SLP for non-IFN gathers

2023-10-19 Thread Lehua Ding
Hi Richard, I'm hitting a couple of testcase ICEs for RISC-V while testing with the latest trunk code, it looks like these two patches are causing it, can you help me look at it? ICE log like bellow: ➜ vsetvl git:(tintin-dev) ~/open-source/riscv-gnu-toolchain-golden/build/dev-rv64gcv_zfh-lp

Re: [PATCH] return edge in make_eh_edges

2023-10-19 Thread Alexandre Oliva
On Oct 19, 2023, Richard Biener wrote: > OK. Maybe time to do s/make_eh_edges/make_eh_edge/ though. Thanks, will do, ideally on top of the already-tested refreshed patches that I'm going to post shortly. -- Alexandre Oliva, happy hackerhttps://FSFLA.org/blogs/lxo/ Free Software

Re: [PATCH v2] c++: Improve diagnostics for constexpr cast from void*

2023-10-19 Thread Jason Merrill
On 10/11/23 11:41, Marek Polacek wrote: On Wed, Oct 11, 2023 at 10:57:06AM +1100, Nathaniel Shead wrote: On Mon, Oct 09, 2023 at 04:10:20PM -0400, Jason Merrill wrote: On 10/9/23 06:03, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu with GXX_TESTSUITE_STDS=98,11,14,17

Re: [PATCH v6] c++: Check for indirect change of active union member in constexpr [PR101631,PR102286]

2023-10-19 Thread Jason Merrill
On 10/12/23 18:05, Nathaniel Shead wrote: On Thu, Oct 12, 2023 at 04:24:00PM -0400, Jason Merrill wrote: On 10/12/23 04:53, Nathaniel Shead wrote: On Wed, Oct 11, 2023 at 12:48:12AM +1100, Nathaniel Shead wrote: On Mon, Oct 09, 2023 at 04:46:46PM -0400, Jason Merrill wrote: On 10/8/23 21:03,

[PATCH] testsuite: check for and use -mno-strict-align where needed

2023-10-19 Thread Alexandre Oliva
On Mar 10, 2021, Alexandre Oliva wrote: > ppc configurations that have -mstrict-align enabled by default fail > gcc.dg/strlenopt-80.c, because some memcpy calls don't get turned into > MEM_REFs, which defeats the tested-for strlen optimization. I've combined this patch with other patches that ad

Re: [PATCH v3 1/2] c++: Initial support for P0847R7 (Deducing This) [PR102609]

2023-10-19 Thread Jason Merrill
On 10/19/23 19:35, waffl3x wrote: (waffl3x (me)) At a glance it seems like all I need to do then is disable the PTRMEM_OK_P flag then. I'm just now realizing that I'm almost certainly wrong about this. It still needs PTRMEM_OK_P set if there are any implicit-object member functions in the overl

[PATCH] Avoid compile time hog on vect_peel_nonlinear_iv_init for nonlinear induction vec_step_op_mul when iteration count is too big.

2023-10-19 Thread liuhongt
>So with pow being available this limit shouldn't be necessary any more and >the testcase adjustment can be avoided? I tries, compile time still hogs on mpz_powm(3, INT_MAX), so i'll just keep this. >and to avoid undefined behavior with too large shift just go the gmp >way unconditionally. Changed

Re: [PATCH V3 00/11] Refactor and cleanup vsetvl pass

2023-10-19 Thread Lehua Ding
Hi Patrick, Thanks a lot for helping to test these patchs! On 2023/10/20 2:04, Patrick O'Neill wrote: I tested it this morning on my machine and it passed! Tested against: 04d6c74564b7eb51660a00b35353aeab706b5a50 Using targets: glibc rv32gcv qemu glibc rv64gcv qemu This patch series does not

Re: [PATCH] c++: print source code in print_instantiation_partial_context_line

2023-10-19 Thread Patrick Palka
On Tue, 3 Oct 2023, David Malcolm wrote: > As mentioned in my Cauldron talk, this patch adds a call to > diagnostic_show_locus to the "required from here" messages > in print_instantiation_partial_context_line, so that e.g., rather > than the rather mystifying: > > In file included from ../x86_64

Re: [PATCH v3 1/2] c++: Initial support for P0847R7 (Deducing This) [PR102609]

2023-10-19 Thread waffl3x
> (waffl3x (me)) > At a glance it seems like all I need to do then is disable the > PTRMEM_OK_P flag then. I'm just now realizing that I'm almost certainly wrong about this. It still needs PTRMEM_OK_P set if there are any implicit-object member functions in the overload set. That is, if OFFSET_REF

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

2023-10-19 Thread Kees Cook
On Wed, Oct 18, 2023 at 09:11:43PM +, Qing Zhao wrote: > As I replied to Martin in another email, I plan to do the following to > resolve this issue: > > 1. No specification for signed or unsigned for counted_by field. > 2. Add a sanitizer option -fsanitize=counted-by-bound to catch the cases

Re: [PATCH] c: Add -Wreturn-mismatch warning, split from -Wreturn-type

2023-10-19 Thread Eric Gallager
On Thu, Oct 19, 2023 at 5:08 PM Florian Weimer wrote: > > The existing -Wreturn-type option covers both constraint violations > (which are mandatory to diagnose) and warnings that have known > false positives. The new -Wreturn-mismatch warning is only about > the constraint violations (missing or

Re: Improve -Wflex-array-member-not-at-end changes.html wording |Plus: and warning bug? (was: [V2][PATCH] gcc-14/changes.html: Deprecate a GCC C extension on flexible array members.)

2023-10-19 Thread Kees Cook
On Thu, Oct 19, 2023 at 08:49:00PM +, Qing Zhao wrote: > > On Sep 25, 2023, at 2:24 PM, Tobias Burnus wrote: > > Secondly, if this is deprecated, shouldn't then the warning enabled by, > > e.g., -Wall or made > > otherwise more prominent? (-std=?) - Currently, one either has to find the > >

Re: Enable top-level recursive 'autoreconf'

2023-10-19 Thread Eric Gallager
On Thu, Oct 19, 2023 at 6:43 AM Thomas Schwinge wrote: > > Hi! > > On 2023-10-19T11:57:33+0200, Andreas Schwab wrote: > > On Okt 19 2023, Thomas Schwinge wrote: > >> On 2023-10-18T15:42:18+0100, R jd <3246251196r...@gmail.com> wrote: > >>> I guess I can ask, why there is not a recursive approach

Re: [PATCH v3 1/2] c++: Initial support for P0847R7 (Deducing This) [PR102609]

2023-10-19 Thread waffl3x
> A BASELINK expresses the result of name lookup for a member function, > since we need to pass information about the name lookup context along to > after overload resolution. > > An OFFSET_REF (with PTRMEM_OK_P) is used to express that we saw the > &A::f syntax, so we could build a pointer to m

Re: [PATCH V5] VECT: Enhance SLP of MASK_LEN_GATHER_LOAD[PR111721]

2023-10-19 Thread Richard Sandiford
"juzhe.zh...@rivai.ai" writes: > Hi, this patch fix V4 issue: > > Previously as Richard S commented: > https://gcc.gnu.org/pipermail/gcc-patches/2023-October/633178.html > > slp_op and mask_vectype are only initialised when mask_index >= 0. > Shouldn't this code be under mask_index >= 0 too? > Al

Re: [PATCH v3 1/2] c++: Initial support for P0847R7 (Deducing This) [PR102609]

2023-10-19 Thread Jason Merrill
On 10/19/23 17:05, waffl3x wrote: Also, I'm not sure what %qs is, should I be using that instead of %s for strings? The q prefix means quoted, with ' or other quotation marks, depending on the locale. On another topic, I have been trying to fix taking pointers to explicit object member func

Re: [PATCH] vect: Cost adjacent vector loads/stores together [PR111784]

2023-10-19 Thread Richard Sandiford
"Kewen.Lin" writes: > Hi, > > As comments[1][2], this patch is to change the costing way > on some adjacent vector loads/stores from costing one by > one to costing them together with the total number once. > > It helps to fix the exposed regression PR111784 on aarch64, > as aarch64 specific costi

Re: [PATCH v3 1/2] c++: Initial support for P0847R7 (Deducing This) [PR102609]

2023-10-19 Thread Jakub Jelinek
On Thu, Oct 19, 2023 at 09:31:06PM +, waffl3x wrote: > Ah alright, I see what you're saying, I see what the difference is now. > It's a shame we can't have the translated string insert a %s and format > into that :^). Ah well, I guess this code is just doomed to look poor > then, what can you d

Re: [PATCH 2/2] c++: remove NON_DEPENDENT_EXPR, part 2

2023-10-19 Thread Jason Merrill
On 9/25/23 16:43, Patrick Palka wrote: This much more mechanical patch removes build_non_dependent_expr (and make_args_non_dependent) and adjusts callers accordingly, no functional change. These two patches are OK either separately or squashed, whichever you prefer. gcc/cp/ChangeLog:

Re: [PATCH 2/1] c++: rename tsubst_copy_and_build and tsubst_expr

2023-10-19 Thread Jason Merrill
On 10/4/23 15:23, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? OK. -- >8 -- After the previous patch, we currently have two tsubst entry points for expression trees: tsubst_copy_and_build and tsubst_expr. But the latter is just a super

Re: [PATCH] c++: merge tsubst_copy into tsubst_copy_and_build

2023-10-19 Thread Jason Merrill
On 10/4/23 12:08, Patrick Palka wrote: On Tue, 3 Oct 2023, Jason Merrill wrote: On 10/3/23 08:41, Patrick Palka wrote: On Mon, 2 Oct 2023, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- The relationship between tsubst_copy_and_

Re: [PATCH] c: Add -Wreturn-mismatch warning, split from -Wreturn-type

2023-10-19 Thread Joseph Myers
On Thu, 19 Oct 2023, Florian Weimer wrote: > diff --git a/gcc/c/c-typeck.cc b/gcc/c/c-typeck.cc > index 6e044b4afbc..1da622160a3 100644 > --- a/gcc/c/c-typeck.cc > +++ b/gcc/c/c-typeck.cc > @@ -11281,17 +11281,10 @@ c_finish_return (location_t loc, tree retval, tree > origtype) >if ((warn

Re: [PATCH v3 1/2] c++: Initial support for P0847R7 (Deducing This) [PR102609]

2023-10-19 Thread waffl3x
> No, that wouldn't be appropriate for translation. > None of non-member, static member and explicit object member are > something that should be printed verbatim untranslated. > "%s function %qD cannot have cv-qualifier", _("non-member") > etc. is still inappropriate, some language might need to r

Re: [PATCH]AArch64 Add SVE implementation for cond_copysign.

2023-10-19 Thread Richard Sandiford
Tamar Christina writes: > Hi All, > > This adds an implementation for masked copysign along with an optimized > pattern for masked copysign (x, -1). > > Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. > > Ok for master? > > Thanks, > Tamar > > gcc/ChangeLog: > > PR tree-optim

Re: [PATCH]AArch64 Handle copysign (x, -1) expansion efficiently

2023-10-19 Thread Richard Sandiford
Tamar Christina writes: > Hi All, > > copysign (x, -1) is effectively fneg (abs (x)) which on AArch64 can be > most efficiently done by doing an OR of the signbit. > > The middle-end will optimize fneg (abs (x)) now to copysign as the > canonical form and so this optimizes the expansion. > > If th

Re: [PATCH v3 1/2] c++: Initial support for P0847R7 (Deducing This) [PR102609]

2023-10-19 Thread Jakub Jelinek
On Thu, Oct 19, 2023 at 09:05:38PM +, waffl3x wrote: > Okay so taking what you guys are saying here it sounds like it would be > appropriate to refactor the code I was reluctant to refactor. The code > (in grokfndecl) conditionally selects one of the two (now three with my > changes) following

[PATCH] c: Add -Wreturn-mismatch warning, split from -Wreturn-type

2023-10-19 Thread Florian Weimer
The existing -Wreturn-type option covers both constraint violations (which are mandatory to diagnose) and warnings that have known false positives. The new -Wreturn-mismatch warning is only about the constraint violations (missing or extra return expressions), and should eventually be turned into

Re: [PATCH v3 1/2] c++: Initial support for P0847R7 (Deducing This) [PR102609]

2023-10-19 Thread waffl3x
> (Jakub) > There are different kinds of format strings in GCC, the most common > are the gcc-internal-format strings. If you call a function which > is expected to take such translatable format string (in particular > a function which takes a gmsgid named argument like error, error_at, > pedwarn,

Re: Improve -Wflex-array-member-not-at-end changes.html wording |Plus: and warning bug? (was: [V2][PATCH] gcc-14/changes.html: Deprecate a GCC C extension on flexible array members.)

2023-10-19 Thread Qing Zhao
Hi, Tobias, Sorry for the late reply (just came back from a long vacation after Cauldron). And thank you for reporting this issue. Please see my reply embedded below: > On Sep 25, 2023, at 2:24 PM, Tobias Burnus wrote: > > Hi all, > > I stumbled over this as I found the wording in the releas

[pushed] doc: Update contrib.texi

2023-10-19 Thread Marek Polacek
I noticed that Patrick is missing here. gcc/ChangeLog: * doc/contrib.texi: Add entry for Patrick Palka. --- gcc/doc/contrib.texi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/doc/contrib.texi b/gcc/doc/contrib.texi index 031c4ec44ce..0fe4a874616 100644 --- a/gcc/doc/contrib.

Re: [PATCH v3] c++: Fix compile-time-hog in cp_fold_immediate_r [PR111660]

2023-10-19 Thread Jason Merrill
On 10/19/23 14:45, Marek Polacek wrote: On Thu, Oct 19, 2023 at 01:02:33PM -0400, Jason Merrill wrote: On 10/19/23 12:55, Marek Polacek wrote: On Thu, Oct 19, 2023 at 12:32:49PM -0400, Jason Merrill wrote: On 10/19/23 10:14, Marek Polacek wrote: On Thu, Oct 19, 2023 at 10:06:01AM -0400, Jason

Re: [PATCH] ifcvt/vect: Emit COND_ADD for conditional scalar reduction.

2023-10-19 Thread Robin Dapp
Ugh, I didn't push yet because with a rebased trunk I am seeing different behavior for some riscv testcases. A reduction is not recognized because there is yet another "double use" occurrence in check_reduction_path. I guess it's reasonable to loosen the restriction for conditional operations her

[Patch] omp_lib.f90.in: Deprecate omp_lock_hint_* for OpenMP 5.0

2023-10-19 Thread Tobias Burnus
I noticed that we only tagged half of the 5.0 deprecations in the omp_lib module; this added the other half. (omp_lock_hint_* was renamed to omp_sync_hint_*.) Currently, this patch has has no visible effect - but once we bump the OpenMP version from 4.5 to 5.0, there will warnings of the those.

Re: [PATCH v3 2/4] ifcvt: Allow more operations in multiple set if conversion

2023-10-19 Thread Richard Sandiford
Manolis Tsamis writes: > Currently the operations allowed for if conversion of a basic block with > multiple sets are few, namely REG, SUBREG and CONST_INT (as controlled by > bb_ok_for_noce_convert_multiple_sets). > > This commit allows more operations (arithmetic, compare, etc) to participate >

Re: [PATCH v3 1/4] ifcvt: handle sequences that clobber flags in noce_convert_multiple_sets

2023-10-19 Thread Richard Sandiford
Manolis Tsamis writes: > This is an extension of what was done in PR106590. > > Currently if a sequence generated in noce_convert_multiple_sets clobbers the > condition rtx (cc_cmp or rev_cc_cmp) then only seq1 is used afterwards > (sequences that emit the comparison itself). Since this applies on

Re: [PATCH v3] c++: Fix compile-time-hog in cp_fold_immediate_r [PR111660]

2023-10-19 Thread Marek Polacek
On Thu, Oct 19, 2023 at 01:02:33PM -0400, Jason Merrill wrote: > On 10/19/23 12:55, Marek Polacek wrote: > > On Thu, Oct 19, 2023 at 12:32:49PM -0400, Jason Merrill wrote: > > > On 10/19/23 10:14, Marek Polacek wrote: > > > > On Thu, Oct 19, 2023 at 10:06:01AM -0400, Jason Merrill wrote: > > > > >

Re: [PATCH v2] gcc: Introduce -fhardened

2023-10-19 Thread Marek Polacek
On Thu, Oct 19, 2023 at 01:33:51PM +0100, Sam James wrote: > > Richard Biener writes: > > > On Wed, Oct 11, 2023 at 10:48 PM Marek Polacek wrote: > >> > >> On Tue, Sep 19, 2023 at 10:58:19AM -0400, Marek Polacek wrote: > >> > On Mon, Sep 18, 2023 at 08:57:39AM +0200, Richard Biener wrote: > >>

Re: [PATCH v2] gcc: Introduce -fhardened

2023-10-19 Thread Marek Polacek
On Wed, Oct 18, 2023 at 08:12:37PM +, Qing Zhao wrote: > Marek, > > Sorry for the late comment (I was just back from a long vacation immediate > after Cauldron). No worries. > One question: > > Is the option “-fhandened” for production build or for development build? I intend -fhardene

Re: [PATCH V3 00/11] Refactor and cleanup vsetvl pass

2023-10-19 Thread Patrick O'Neill
I tested it this morning on my machine and it passed! Tested against: 04d6c74564b7eb51660a00b35353aeab706b5a50 Using targets: glibc rv32gcv qemu glibc rv64gcv qemu This patch series does not introduce any new failures. Here's a list of *resolved* failures by this patch series: rv64gcv: FAIL: g

Re: [PATCH 06/11] haifa-sched: Allow for NOTE_INSN_DELETED at start of epilogue

2023-10-19 Thread Alex Coplan
Hi Jeff, On 19/10/2023 08:54, Jeff Law wrote: > > > On 10/17/23 14:48, Alex Coplan wrote: > > haifa-sched.cc:remove_notes asserts that it lands on a real (non-note) > > insn after advancing past NOTE_INSN_EPILOGUE_BEG, but with the upcoming > > post-RA aarch64 load pair pass enabled, we can land

Re: [RFC] Add function attribute: null_terminated_string_arg(PARAM_IDX)

2023-10-19 Thread David Malcolm
On Thu, 2023-10-19 at 16:13 +0200, Andreas Schwab wrote: > On Okt 19 2023, David Malcolm wrote: [...] > > +   /* First, check for a null-terminated string *without* > > +  emitting emitting warnings (via a null context), to > > -emitting > Thanks; I've fixed this in my working copy

Re: [PATCH][_Hashtable] Fix merge

2023-10-19 Thread François Dumont
Committed with the advised changes. Ok, I'll backport next week. Thanks On 19/10/2023 10:05, Jonathan Wakely wrote: On Thursday, 19 October 2023, François Dumont wrote: > libstdc++: [_Hashtable] Do not reuse untrusted cached hash code > > On merge reuse merged node cached hash code only i

Re: [PATCH v3] c++: Fix compile-time-hog in cp_fold_immediate_r [PR111660]

2023-10-19 Thread Jason Merrill
On 10/19/23 12:55, Marek Polacek wrote: On Thu, Oct 19, 2023 at 12:32:49PM -0400, Jason Merrill wrote: On 10/19/23 10:14, Marek Polacek wrote: On Thu, Oct 19, 2023 at 10:06:01AM -0400, Jason Merrill wrote: On 10/19/23 09:39, Patrick Palka wrote: On Tue, 17 Oct 2023, Marek Polacek wrote: On

Re: [x86 PATCH] PR target/110511: Fix reg allocation for widening multiplications.

2023-10-19 Thread Uros Bizjak
On Tue, Oct 17, 2023 at 9:05 PM Roger Sayle wrote: > > > This patch contains clean-ups of the widening multiplication patterns in > i386.md, and provides variants of the existing highpart multiplication > peephole2 transformations (that tidy up register allocation after > reload), and thereby fixe

Re: [PATCH v3] c++: Fix compile-time-hog in cp_fold_immediate_r [PR111660]

2023-10-19 Thread Marek Polacek
On Thu, Oct 19, 2023 at 12:32:49PM -0400, Jason Merrill wrote: > On 10/19/23 10:14, Marek Polacek wrote: > > On Thu, Oct 19, 2023 at 10:06:01AM -0400, Jason Merrill wrote: > > > On 10/19/23 09:39, Patrick Palka wrote: > > > > On Tue, 17 Oct 2023, Marek Polacek wrote: > > > > > > > > > On Tue, Oct

Re: [PING] [PATCH] Harmonize headers between both dg-extract-results scripts

2023-10-19 Thread Jeff Law
On 10/18/23 03:35, Thomas Schwinge wrote: Is this (case variants) maybe something that has changed in DejaGnu at some point in time? (I have not checked.) No idea :-) I suggest that we adapt all remaining upper-case instances in GCC, similar to your change. And/or, as applicable, recogn

Re: [PATCH v3] c++: Fix compile-time-hog in cp_fold_immediate_r [PR111660]

2023-10-19 Thread Jason Merrill
On 10/19/23 10:14, Marek Polacek wrote: On Thu, Oct 19, 2023 at 10:06:01AM -0400, Jason Merrill wrote: On 10/19/23 09:39, Patrick Palka wrote: On Tue, 17 Oct 2023, Marek Polacek wrote: On Tue, Oct 17, 2023 at 04:49:52PM -0400, Jason Merrill wrote: On 10/16/23 20:39, Marek Polacek wrote: On

Re: [PATCH] ABOUT-GCC-NLS: add usage guidance

2023-10-19 Thread Jakub Jelinek
On Thu, Oct 19, 2023 at 12:13:55PM -0400, Jason Merrill wrote: > How about this? > > In general, use no markup for strings that are the immediate format string > argument of a diagnostic function. Use G_("str") for strings that will be > used as the format string for a diagnostic but are e.g.

Re: [PATCH] ABOUT-GCC-NLS: add usage guidance

2023-10-19 Thread Jason Merrill
On 10/19/23 11:21, Jakub Jelinek wrote: On Thu, Oct 19, 2023 at 11:11:30AM -0400, Jason Merrill wrote: A recent question led me to look at this file again, and it occurred to me that it could use to offer more guidance. OK for trunk? -- 8< -- gcc/ChangeLog: * ABOUT-GCC-NLS: Add usage

Re: [1/3] Add support for target_version attribute

2023-10-19 Thread Andrew Carlotti
On Thu, Oct 19, 2023 at 07:04:09AM +, Richard Biener wrote: > On Wed, 18 Oct 2023, Andrew Carlotti wrote: > > > This patch adds support for the "target_version" attribute to the middle > > end and the C++ frontend, which will be used to implement function > > multiversioning in the aarch64 bac

[patch,libgcc,contrib]: Add some auto-generated files deps to gcc_update.

2023-10-19 Thread Georg-Johann Lay
This patch adds two deps to gcc_update files_and_dependencies for two auto-generated headers from avr libgcc. Ok for master? Johann -- Add dependencies for some auto-generated files from avr-libgcc. / * contrib/gcc_update (files_and_dependencies): Add dependencies for: libgcc/

Re: [PATCH] c: [PR100532] Fix ICE when an agrgument was an error mark

2023-10-19 Thread Marek Polacek
On Thu, Oct 19, 2023 at 03:38:57PM +, Andrew Pinski wrote: > In the case of convert_argument, we would return the same expression > back rather than error_mark_node after the error message about > trying to convert to an incomplete type. This causes issues in > the gimplfier trying to see if an

Re: [PATCH RFA] diagnostic: rename new permerror overloads

2023-10-19 Thread Jakub Jelinek
On Thu, Oct 19, 2023 at 11:45:01AM -0400, Jason Merrill wrote: > OK for trunk? > > -- 8< -- > > While checking another change, I noticed that the new permerror overloads > break gettext with "permerror used incompatibly as both > --keyword=permerror:2 --flag=permerror:2:gcc-internal-format and >

[PATCH RFA] diagnostic: rename new permerror overloads

2023-10-19 Thread Jason Merrill
OK for trunk? -- 8< -- While checking another change, I noticed that the new permerror overloads break gettext with "permerror used incompatibly as both --keyword=permerror:2 --flag=permerror:2:gcc-internal-format and --keyword=permerror:3 --flag=permerror:3:gcc-internal-format". So let's chan

Re: [PATCH] c: [PR104822] Don't warn about converting NULL to different sso endian

2023-10-19 Thread Marek Polacek
On Thu, Oct 19, 2023 at 08:37:31AM -0700, Andrew Pinski wrote: > In a similar way we don't warn about NULL pointer constant conversion to > a different named address we should not warn to a different sso endian > either. > This adds the simple check. > > Bootstrapped and tested on x86_64-linux-gnu

Re: [pushed] c++: use G_ instead of _

2023-10-19 Thread Jakub Jelinek
On Thu, Oct 19, 2023 at 11:31:58AM -0400, Jason Merrill wrote: > --- a/gcc/cp/decl.cc > +++ b/gcc/cp/decl.cc > @@ -3607,8 +3607,8 @@ identify_goto (tree decl, location_t loc, const > location_t *locus, > { >bool complained > = emit_diagnostic (diag_kind, loc, 0, > -de

[PATCH] c: [PR100532] Fix ICE when an agrgument was an error mark

2023-10-19 Thread Andrew Pinski
In the case of convert_argument, we would return the same expression back rather than error_mark_node after the error message about trying to convert to an incomplete type. This causes issues in the gimplfier trying to see if another conversion is needed. The code here dates back to before the rev

[PATCH] c: [PR104822] Don't warn about converting NULL to different sso endian

2023-10-19 Thread Andrew Pinski
In a similar way we don't warn about NULL pointer constant conversion to a different named address we should not warn to a different sso endian either. This adds the simple check. Bootstrapped and tested on x86_64-linux-gnu with no regressions. PR c/104822 gcc/c/ChangeLog: * c-t

[pushed] c++: use G_ instead of _

2023-10-19 Thread Jason Merrill
Tested with make po/gcc.pot to see that the strings are still there (though in a different place, now with the gcc-internal-format tag). Applying to trunk. -- 8< -- Since these strings are passed to error_at, they should be marked for translation with G_, like other diagnostic messages, rather t

Re: [PATCH] genemit: Split insn-emit.cc into ten files.

2023-10-19 Thread Jeff Law
On 10/17/23 01:04, Robin Dapp wrote: Natively, things seem fine, but for cross, I get failures on a few targets (hppa2.0-unknown-linux-gnu, hppa64-unknown-linux-gnu). With ./configure --host=x86_64-pc-linux-gnu --target=hppa2.0-unknown-linux-gnu --build=x86_64-pc-linux-gnu && make -j$(nproc),

Re: [PATCH] ABOUT-GCC-NLS: add usage guidance

2023-10-19 Thread Jakub Jelinek
On Thu, Oct 19, 2023 at 11:11:30AM -0400, Jason Merrill wrote: > A recent question led me to look at this file again, and it occurred to me > that > it could use to offer more guidance. OK for trunk? > > -- 8< -- > > gcc/ChangeLog: > > * ABOUT-GCC-NLS: Add usage guidance. > --- > gcc/AB

Re: [PATCH] PR 91865: Avoid ZERO_EXTEND of ZERO_EXTEND in make_compound_operation.

2023-10-19 Thread Jeff Law
On 10/14/23 16:14, Roger Sayle wrote: This patch is my proposed solution to PR rtl-optimization/91865. Normally RTX simplification canonicalizes a ZERO_EXTEND of a ZERO_EXTEND to a single ZERO_EXTEND, but as shown in this PR it is possible for combine's make_compound_operation to unintentiona

Re: [PATCH 02/11] Handle epilogues that contain jumps

2023-10-19 Thread Jeff Law
On 10/17/23 03:19, Richard Biener wrote: On Thu, Oct 12, 2023 at 10:15 AM Richard Sandiford wrote: Richard Biener writes: On Tue, Aug 22, 2023 at 12:42 PM Szabolcs Nagy via Gcc-patches wrote: From: Richard Sandiford The prologue/epilogue pass allows the prologue sequence to contain j

[PATCH] ABOUT-GCC-NLS: add usage guidance

2023-10-19 Thread Jason Merrill
A recent question led me to look at this file again, and it occurred to me that it could use to offer more guidance. OK for trunk? -- 8< -- gcc/ChangeLog: * ABOUT-GCC-NLS: Add usage guidance. --- gcc/ABOUT-GCC-NLS | 13 + 1 file changed, 13 insertions(+) diff --git a/gcc/A

Re: [PATCH 2/1] c++: more non-static memfn call dependence cleanup [PR106086]

2023-10-19 Thread Patrick Palka
On Thu, 19 Oct 2023, Jason Merrill wrote: > On 10/12/23 14:49, Patrick Palka wrote: > > On Tue, 26 Sep 2023, Patrick Palka wrote: > > > > > Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK > > > for trunk? > > > > > > -- >8 -- > > > > > > This follow-up patch removes some mo

[PATCH v2 11/11] aarch64: Add new load/store pair fusion pass

2023-10-19 Thread Alex Coplan
Hi, This v2 fixes a significant compile-time hog in the original patch for the pass posted here: https://gcc.gnu.org/pipermail/gcc-patches/2023-October/633355.html Having seen a large compile-time regression when turning on the early ldp pass, compiling 502.gcc_r from SPEC CPU 2017, I found that

Re: [PATCH 06/11] haifa-sched: Allow for NOTE_INSN_DELETED at start of epilogue

2023-10-19 Thread Jeff Law
On 10/17/23 14:48, Alex Coplan wrote: haifa-sched.cc:remove_notes asserts that it lands on a real (non-note) insn after advancing past NOTE_INSN_EPILOGUE_BEG, but with the upcoming post-RA aarch64 load pair pass enabled, we can land on NOTE_INSN_DELETED. This patch adjusts remove_notes to rem

[COMMITTED] ada: Refactor code to remove GNATcheck violation

2023-10-19 Thread Marc Poulhiès
From: Sheri Bernstein Rewrite for loop containing an exit (which violates GNATcheck rule Exits_From_Conditional_Loops), to use a while loop which contains the exit criteria in its condition. Also, move special case of first time through loop, to come before loop. gcc/ada/ * libgnat/s-im

[COMMITTED] ada: Add pragma Annotate for GNATcheck exemptions

2023-10-19 Thread Marc Poulhiès
From: Sheri Bernstein Exempt the GNATcheck rule "Unassigned_OUT_Parameters" with the rationale "the OUT parameter is assigned by component". gcc/ada/ * libgnat/s-imguti.adb (Set_Decimal_Digits): Add pragma to exempt Unassigned_OUT_Parameters. (Set_Floating_Invalid_Value)

[COMMITTED] ada: Document gnatbind -Q switch

2023-10-19 Thread Marc Poulhiès
From: Patrick Bernardi Add documentation for the -Q gnatbind switch in GNAT User's Guide and improve gnatbind's help output for the switch to emphasize that it adds the requested number of stacks to the secondary stack pool generated by the binder. gcc/ada/ * bindusg.adb (Display): Make

[COMMITTED] ada: Seize opportunity to reuse List_Length

2023-10-19 Thread Marc Poulhiès
From: Ronan Desplanques This patch is intended as a readability improvement. It doesn't change the behavior of the compiler. gcc/ada/ * sem_ch3.adb (Constrain_Array): Replace manual list length computation by call to List_Length. Tested on x86_64-pc-linux-gnu, committed on mast

[COMMITTED] ada: Simplify "not Present" with "No"

2023-10-19 Thread Marc Poulhiès
From: Piotr Trojanek gcc/ada/ * exp_aggr.adb (Expand_Container_Aggregate): Simplify with "No". Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/ada/exp_aggr.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb i

Re: [PATCH 2/1] c++: more non-static memfn call dependence cleanup [PR106086]

2023-10-19 Thread Jason Merrill
On 10/12/23 14:49, Patrick Palka wrote: On Tue, 26 Sep 2023, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- This follow-up patch removes some more repetition of the type-dependent On second thought there's no good reason to spli

Re: [PATCH v3] c++: Fix compile-time-hog in cp_fold_immediate_r [PR111660]

2023-10-19 Thread Marek Polacek
On Thu, Oct 19, 2023 at 10:06:01AM -0400, Jason Merrill wrote: > On 10/19/23 09:39, Patrick Palka wrote: > > On Tue, 17 Oct 2023, Marek Polacek wrote: > > > > > On Tue, Oct 17, 2023 at 04:49:52PM -0400, Jason Merrill wrote: > > > > On 10/16/23 20:39, Marek Polacek wrote: > > > > > On Sat, Oct 14,

Re: [RFC] Add function attribute: null_terminated_string_arg(PARAM_IDX)

2023-10-19 Thread Andreas Schwab
On Okt 19 2023, David Malcolm wrote: > +void > +region_model:: > +check_one_function_attr_null_terminated_string_arg (const gcall *call, > + tree callee_fndecl, > + region_model_context *ctxt, > +

Re: [PATCH v3] c++: Fix compile-time-hog in cp_fold_immediate_r [PR111660]

2023-10-19 Thread Marek Polacek
On Thu, Oct 19, 2023 at 09:39:27AM -0400, Patrick Palka wrote: > On Tue, 17 Oct 2023, Marek Polacek wrote: > > > On Tue, Oct 17, 2023 at 04:49:52PM -0400, Jason Merrill wrote: > > > On 10/16/23 20:39, Marek Polacek wrote: > > > > - if (cxx_dialect > cxx17) > > > > -cp_fold_immediate_r (stmt_p

Re: [PATCH v3] c++: Fix compile-time-hog in cp_fold_immediate_r [PR111660]

2023-10-19 Thread Jason Merrill
On 10/19/23 09:39, Patrick Palka wrote: On Tue, 17 Oct 2023, Marek Polacek wrote: On Tue, Oct 17, 2023 at 04:49:52PM -0400, Jason Merrill wrote: On 10/16/23 20:39, Marek Polacek wrote: On Sat, Oct 14, 2023 at 01:13:22AM -0400, Jason Merrill wrote: On 10/13/23 14:53, Marek Polacek wrote: On

[PATCH 4/5] LoongArch: Use explicit relocs for addresses only used for one load or store with -mexplicit-relocs=auto and -mcmodel={normal, medium}

2023-10-19 Thread Xi Ruoyao
In these cases, if we use explicit relocs, we end up with 2 instructions: pcalau12it0, %pc_hi20(x) ld.d t0, t0, %pc_lo12(x) If we use la.local pseudo-op, in the best scenario (x is in +/- 2MiB range) we still have 2 instructions: pcaddi t0, %pcrel_20(x) ld.d

[PATCH 2/5] LoongArch: Use explicit relocs for GOT access when -mexplicit-relocs=auto and LTO during a final link with linker plugin

2023-10-19 Thread Xi Ruoyao
If we are performing LTO for a final link and linker plugin is enabled, then we are sure any GOT access may resolve to a symbol out of the link unit (otherwise the linker plugin will tell us the symbol should be resolved locally and we'll use PC-relative access instead). Produce machine instructio

[PATCH 0/5] LoongArch: Better balance between relaxation and scheduling

2023-10-19 Thread Xi Ruoyao
For relaxation we are now generating assembler macros for symbolic addresses everywhere, but this is limiting scheduling and there are known situations where the relaxation cannot improve the code. 1. When we are performing LTO during a final link and the linker plugin is used, la.global won't be

[PATCH 5/5] LoongArch: Document -mexplicit-relocs={auto,none,always}

2023-10-19 Thread Xi Ruoyao
gcc/ChangeLog: * doc/invoke.texi (-mexplicit-relocs=style): Document. (-mexplicit-relocs): Document as an alias of -mexplicit-relocs=always. (-mno-explicit-relocs): Document as an alias of -mexplicit-relocs=none. (-mcmodel=extreme): Mention -mexplici

[PATCH 3/5] LoongArch: Use explicit relocs for TLS access with -mexplicit-relocs=auto

2023-10-19 Thread Xi Ruoyao
The linker does not know how to relax TLS access for LoongArch, so let's emit machine instructions with explicit relocs for TLS. gcc/ChangeLog: * config/loongarch/loongarch.cc (loongarch_explicit_relocs_p): Return true for TLS symbol types if -mexplicit-relocs=auto. (loong

[PATCH 1/5] LoongArch: Add enum-style -mexplicit-relocs= option

2023-10-19 Thread Xi Ruoyao
To take a better balance between scheduling and relaxation when -flto is enabled, add three-way -mexplicit-relocs={auto,none,always} options. The old -mexplicit-relocs and -mno-explicit-relocs options are still supported, they are mapped to -mexplicit-relocs=always and -mexplicit-relocs=none. The

[RFC] Add function attribute: null_terminated_string_arg(PARAM_IDX)

2023-10-19 Thread David Malcolm
This patch adds a new function attribute to GCC for marking that an argument is expected to be a null-terminated string. For example, consider: void test_a (const char *p) __attribute__((null_terminated_string_arg (1))); which would indicate to humans and compilers that argument 1 of "test

  1   2   >