[committed] – was: [Patch] OpenMP: Fix folding with simd's linear clause [PR106492]

2022-08-08 Thread Tobias Burnus
On 04.08.22 09:32, Tobias Burnus wrote: Rather obvious fix and similar to PR106449. OK for mainline and backporting (how far?). I would like to backport it at least to GCC 12. Now committed as obvious: https://gcc.gnu.org/g:r13-1997-g8a16b9f983824b6b9a25275cd23b6bba8c98b800 I intent to backpo

[PATCH] rs6000: Remove stale rs6000_global_entry_point_needed_p

2022-08-08 Thread Kewen.Lin via Gcc-patches
Hi, r10-631 had renamed rs6000_global_entry_point_needed_p to rs6000_global_entry_point_prologue_needed_p. This is to remove the stale function declaration. Bootstrapped and regtested on powerpc64-linux-gnu P8 and powerpc64le-linux-gnu P9 and P10. I'll push this soon. BR, Kewen - gcc/Chang

[PATCH] rs6000: Simplify some code with rs6000_builtin_is_supported

2022-08-08 Thread Kewen.Lin via Gcc-patches
Hi, In function rs6000_init_builtins, there is a oversight that in one target debugging hunk with TARGET_DEBUG_BUILTIN we missed to handle enum bif_enable ENB_CELL. It's easy to fix it by adding another if case. But considering the long term maintainability, this patch updates it with the existi

[PATCH] rs6000: Rework ELFv2 support for -fpatchable-function-entry* [PR99888]

2022-08-08 Thread Kewen.Lin via Gcc-patches
Hi, As PR99888 and its related show, the current support for -fpatchable-function-entry on powerpc ELFv2 doesn't work well with global entry existence. For example, with one command line option -fpatchable-function-entry=3,2, it got below w/o this patch: .LPFE1: nop nop

Re: [PATCH v2, rs6000] Add multiply-add expand pattern [PR103109]

2022-08-08 Thread Kewen.Lin via Gcc-patches
Hi Haochen, Thanks for the patch. on 2022/8/8 14:04, HAO CHEN GUI wrote: > Hi, > This patch adds an expand and several insns for multiply-add with three > 64bit operands. > > Compared with last version, the main changes are: > 1 The "maddld" pattern is reused for the low-part generation. > 2

Re: [PATCH] rs6000: Fix incorrect RTL for Power LE when removing the UNSPECS [PR106069]

2022-08-08 Thread Kewen.Lin via Gcc-patches
Hi Xionghu, Thanks for the fix. on 2022/8/8 11:42, Xionghu Luo wrote: > The native RTL expression for vec_mrghw should be same for BE and LE as > they are register and endian-independent. So both BE and LE need > generate exactly same RTL with index [0 4 1 5] when expanding vec_mrghw > with vec_

Re: [PATCH][_GLIBCXX_DEBUG] Refine singular iterator state

2022-08-08 Thread Jonathan Wakely via Gcc-patches
On Mon, 8 Aug 2022, 19:15 François Dumont via Libstdc++, < libstd...@gcc.gnu.org> wrote: > On 08/08/22 15:19, Jonathan Wakely wrote: > > On Mon, 8 Aug 2022 at 06:07, François Dumont via Libstdc++ > > wrote: > >> Another version of this patch with just a new test case showing what > >> wrong code

[COMMITTED] PR tree-optimization/106556 - Evaluate condition arguments with the correct type.

2022-08-08 Thread Andrew MacLeod via Gcc-patches
when evaluating a COND_EXPR, we need to evaluate both operands. With the recent changes to floating point, we missed that we are accidentally using the LHS range type for the operands.. that was fine when everything was an irange... but no so any more. This patch simply uses the right range ty

[PATCH v2] c++: Extend -Wredundant-move for const-qual objects [PR90428]

2022-08-08 Thread Marek Polacek via Gcc-patches
On Sat, Aug 06, 2022 at 03:58:13PM -0800, Jason Merrill wrote: > On 8/6/22 11:13, Marek Polacek wrote: > > In this PR, Jon suggested extending the -Wredundant-move warning > > to warn when the user is moving a const object as in: > > > >struct T { }; > > > >T f(const T& t) > >{ > >

Re: [PATCH v4 2/2] preprocessor/106426: Treat u8 character literals as unsigned in char8_t modes.

2022-08-08 Thread Joseph Myers
On Mon, 8 Aug 2022, Tom Honermann via Gcc-patches wrote: > On 8/2/22 6:14 PM, Joseph Myers wrote: > > On Tue, 2 Aug 2022, Tom Honermann via Gcc-patches wrote: > > > > > This patch corrects handling of UTF-8 character literals in preprocessing > > > directives so that they are treated as unsigned

[PATCH v2] c++: Tweak for -Wpessimizing-move in templates [PR89780]

2022-08-08 Thread Marek Polacek via Gcc-patches
On Sat, Aug 06, 2022 at 04:02:13PM -0700, Jason Merrill wrote: > On 8/4/22 11:46, Marek Polacek wrote: > > In my previous patches I've been extending our std::move warnings, > > but this tweak actually dials it down a little bit. As reported in > > bug 89780, it's questionable to warn about expres

Re: [PATCH] [PR83782] i386 PIE: avoid @GOTOFF for ifuncs and their aliases

2022-08-08 Thread Alexandre Oliva via Gcc-patches
On Aug 1, 2022, "H.J. Lu" wrote: > On Thu, Jul 28, 2022 at 9:31 AM H.J. Lu wrote: >> > You may also need to do something like this bit for mvc10.c on ia32 PIE. >> > Because the ifunc is called through an alias, AFAICT we don't even >> > notice that the call target is (an alias to) an ifunc. G

[PATCH v2] c++: Extend -Wpessimizing-move for class prvalues [PR106276]

2022-08-08 Thread Marek Polacek via Gcc-patches
On Sat, Aug 06, 2022 at 04:07:54PM -0700, Jason Merrill wrote: > On 8/6/22 15:49, Jason Merrill wrote: > > On 7/27/22 17:14, Marek Polacek wrote: > > > We already have a warning that warns about pessimizing std::move > > > in a return statement, when it prevents the NRVO: > > > > > >    T fn() > >

[PATCH v2] c-family: Honor -Wno-init-self for cv-qual vars [PR102633]

2022-08-08 Thread Marek Polacek via Gcc-patches
On Sat, Aug 06, 2022 at 03:29:05PM -0700, Jason Merrill wrote: > On 7/26/22 14:31, Marek Polacek wrote: > > On Tue, Jul 26, 2022 at 04:24:18PM -0400, Jason Merrill wrote: > > > On 7/26/22 15:03, Marek Polacek wrote: > > > > Since r11-5188-g32934a4f45a721, we drop qualifiers during l-to-r > > > > co

[committed] d: Fix ICE in in add_stack_var, at cfgexpand.cc:476 (PR106555)

2022-08-08 Thread Iain Buclaw via Gcc-patches
Hi, This patch fixes the ICE reported in PR d/106555. The type that triggers the ICE never got completed by the semantic analysis pass. Checking for size forces it to be done, or issue a compile-time error. Bootstrapped and regression tested on x86_64-linux-gnu/-m32/-mx32, committed to mainline

Re: [PATCH][_GLIBCXX_DEBUG] Refine singular iterator state

2022-08-08 Thread François Dumont via Gcc-patches
On 08/08/22 15:19, Jonathan Wakely wrote: On Mon, 8 Aug 2022 at 06:07, François Dumont via Libstdc++ wrote: Another version of this patch with just a new test case showing what wrong code was unnoticed previously by the _GLIBCXX_DEBUG mode. On 04/08/22 22:56, François Dumont wrote: This an ol

Re: [PATCH] Add warning options -W[no-]compare-distinct-pointer-types

2022-08-08 Thread Joseph Myers
On Fri, 5 Aug 2022, Jose E. Marchesi via Gcc-patches wrote: > +Wcompare-distinct-pointer-types > +C C++ Var(warn_compare_distinct_pointer_types) Warning Init(1) > +Warn if pointers of distinct types are compared without a cast. There's no implementation for C++ in this patch, so the option should

[PATCH] Teach vectorizer to deal with bitfield accesses (was: [RFC] Teach vectorizer to deal with bitfield reads)

2022-08-08 Thread Andre Vieira (lists) via Gcc-patches
Hi, So I've changed the approach from the RFC as suggested, moving the bitfield lowering to the if-convert pass. So to reiterate, ifcvt will lower COMPONENT_REF's with DECL_BIT_FIELD field's to either BIT_FIELD_REF if they are reads or BIT_INSERT_EXPR if they are writes, using loads and writ

Re: [PATCH v4 2/2] preprocessor/106426: Treat u8 character literals as unsigned in char8_t modes.

2022-08-08 Thread Tom Honermann via Gcc-patches
On 8/2/22 6:14 PM, Joseph Myers wrote: On Tue, 2 Aug 2022, Tom Honermann via Gcc-patches wrote: This patch corrects handling of UTF-8 character literals in preprocessing directives so that they are treated as unsigned types in char8_t enabled C++ modes (C++17 with -fchar8_t or C++20 without -fn

Re: [PATCH] Add _GLIBCXX_DEBUG backtrace generation

2022-08-08 Thread Jonathan Wakely via Gcc-patches
On Wed, 13 Jul 2022 at 18:28, François Dumont via Libstdc++ wrote: > > libstdc++: [_GLIBCXX_DEBUG] Add backtrace generation on demand > >Add _GLIBCXX_DEBUG_BACKTRACE macro to activate backtrace generation > on _GLIBCXX_DEBUG assertions. Prerequisite is to have configure the lib > with: > >

Re: [PATCH][_GLIBCXX_DEBUG] Refine singular iterator state

2022-08-08 Thread Jonathan Wakely via Gcc-patches
On Mon, 8 Aug 2022 at 06:07, François Dumont via Libstdc++ wrote: > > Another version of this patch with just a new test case showing what > wrong code was unnoticed previously by the _GLIBCXX_DEBUG mode. > > On 04/08/22 22:56, François Dumont wrote: > > This an old patch I had prepared a long tim

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

2022-08-08 Thread Kyrylo Tkachov via Gcc-patches
> -Original Message- > From: Tamar Christina > Sent: Wednesday, June 8, 2022 3:50 PM > To: gcc-patches@gcc.gnu.org > Cc: nd ; Ramana Radhakrishnan > ; Richard Earnshaw > ; ni...@redhat.com; Kyrylo Tkachov > > Subject: [PATCH 2/2][AArch32] Fix 128-bit sequential consistency atomic > oper

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

2022-08-08 Thread Kyrylo Tkachov via Gcc-patches
> -Original Message- > From: Tamar Christina > Sent: Monday, August 8, 2022 10:28 AM > To: Kyrylo Tkachov ; gcc-patches@gcc.gnu.org > Cc: nd ; Richard Earnshaw ; > Marcus Shawcroft ; Richard Sandiford > > Subject: RE: [PATCH 1/2]AArch64 Fix 128-bit sequential consistency atomic > operat

Re: [PATCH 4/4][RFC] VLA Constructor

2022-08-08 Thread Richard Biener via Gcc-patches
On Fri, Aug 5, 2022 at 2:59 PM Andre Vieira (lists) via Gcc-patches wrote: > > This isn't really a 'PATCH' yet, it's something I was working on but had > to put on hold. Feel free to re-use any bits or trash all of it if you'd > like. @@ -10264,6 +10264,44 @@ expand_expr_real_2 (sepops ops, rtx t

Re: [PATCH] PR tree-optimization/64992: (B << 2) != 0 is B when B is Boolean.

2022-08-08 Thread Richard Biener via Gcc-patches
On Mon, Aug 8, 2022 at 11:06 AM Roger Sayle wrote: > > > This patch resolves both PR tree-optimization/64992 and PR > tree-optimization/98956 which are missed optimization enhancement > request, for which Andrew Pinski already has a proposed solution > (related to a fix for PR tree-optimization/98

Re: [PATCH] PR tree-optimization/71343: Optimize (X<

2022-08-08 Thread Richard Biener via Gcc-patches
On Mon, Aug 8, 2022 at 10:07 AM Roger Sayle wrote: > > > This patch resolves PR tree-optimization/71343, a missed-optimization > enhancement request where GCC fails to see that (a<<2)+(b<<2) == a*4+b*4. > This requires two related (sets of) optimizations to be added to match.pd. > > The first is t

Re: [PATCH] middle-end: Optimize ((X >> C1) & C2) != C3 for more cases.

2022-08-08 Thread Richard Biener via Gcc-patches
On Sun, Aug 7, 2022 at 9:08 PM Roger Sayle wrote: > > > Following my middle-end patch for PR tree-optimization/94026, I'd promised > Jeff Law that I'd clean up the dead-code in fold-const.cc now that these > optimizations are handled in match.pd. Alas, I discovered things aren't > quite that simp

Re: [PATCH 10/12 V2] arm: Implement cortex-M return signing address codegen

2022-08-08 Thread Andrea Corallo via Gcc-patches
Richard Earnshaw writes: [...] > +(define_insn "pac_nop" > + [(set (reg:SI IP_REGNUM) > + (unspec:SI [(reg:SI SP_REGNUM) (reg:SI LR_REGNUM)] > + UNSPEC_PAC_NOP))] > + "TARGET_THUMB2" > + "pac\t%|ip, %|lr, %|sp" > + [(set_attr "length" "2")]) > > This pattern is missing

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

2022-08-08 Thread Tamar Christina via Gcc-patches
> -Original Message- > From: Kyrylo Tkachov > Sent: Tuesday, July 12, 2022 2:46 PM > To: Tamar Christina ; gcc-patches@gcc.gnu.org > Cc: nd ; Richard Earnshaw ; > Marcus Shawcroft ; Richard Sandiford > > Subject: RE: [PATCH 1/2]AArch64 Fix 128-bit sequential consistency atomic > operatio

[PATCH] lto/106540 - fix LTO tree input wrt dwarf2out_register_external_die

2022-08-08 Thread Richard Biener via Gcc-patches
I've revisited the earlier two workarounds for dwarf2out_register_external_die getting duplicate entries. It turns out that r11-525-g03d90a20a1afcb added dref_queue pruning to lto_input_tree but decl reading uses that to stream in DECL_INITIAL even when in the middle of SCC streaming. When that SC

[PATCH] PR tree-optimization/64992: (B << 2) != 0 is B when B is Boolean.

2022-08-08 Thread Roger Sayle
This patch resolves both PR tree-optimization/64992 and PR tree-optimization/98956 which are missed optimization enhancement request, for which Andrew Pinski already has a proposed solution (related to a fix for PR tree-optimization/98954). Yesterday, I proposed an alternate improved patch for PR

Re: ICE after folding svld1rq to vec_perm_expr duing forwprop

2022-08-08 Thread Richard Biener via Gcc-patches
On Mon, Aug 1, 2022 at 5:17 AM Prathamesh Kulkarni wrote: > > On Thu, 21 Jul 2022 at 12:21, Richard Biener > wrote: > > > > On Wed, Jul 20, 2022 at 5:36 PM Prathamesh Kulkarni > > wrote: > > > > > > On Mon, 18 Jul 2022 at 11:57, Richard Biener > > > wrote: > > > > > > > > On Fri, Jul 15, 2022

[PATCH] PR tree-optimization/71343: Optimize (X<

2022-08-08 Thread Roger Sayle
This patch resolves PR tree-optimization/71343, a missed-optimization enhancement request where GCC fails to see that (a<<2)+(b<<2) == a*4+b*4. This requires two related (sets of) optimizations to be added to match.pd. The first is that (X< 4*X" will always evaluate to false. This patch has been

Re: [PATCH] Fix middle-end/103645: empty struct store not removed when using compound literal

2022-08-08 Thread Richard Biener via Gcc-patches
On Mon, Aug 8, 2022 at 5:38 AM apinski--- via Gcc-patches wrote: > > From: Andrew Pinski > > For compound literals empty struct stores are not removed as they go down a > different path of the gimplifier; trying to optimize the init constructor. > This fixes the problem by not adding the gimple a

Re: [x86 PATCH] Move V1TI shift/rotate lowering from expand to pre-reload split.

2022-08-08 Thread Uros Bizjak via Gcc-patches
On Fri, Aug 5, 2022 at 8:36 PM Roger Sayle wrote: > > > This patch moves the lowering of 128-bit V1TImode shifts and rotations by > constant bit counts to sequences of SSE operations from the RTL expansion > pass to the pre-reload split pass. Postponing this splitting of shifts > and rotates enab

Re: [x86 PATCH take #2] Add peephole2 to reduce double word register shuffling

2022-08-08 Thread Uros Bizjak via Gcc-patches
On Sun, Aug 7, 2022 at 7:04 PM Roger Sayle wrote: > > > This is a resubmission of my patch from June to fix some forms of > inefficient > register allocation using an additional peephole2 in i386.md. > https://gcc.gnu.org/pipermail/gcc-patches/2022-June/596064.html > > Since the original, a number