[PATCH] tree-optimization/97098 - fix compile-time hog in SLP live

2020-09-18 Thread Richard Biener
This fixes a missed early-out in SLP live stmt marking when all scalar stmts were already visited (oops). Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. 2020-09-18 Richard Biener PR tree-optimization/97098 * tree-vect-slp.c (vect_bb_slp_mark_live_stmts): Do not

[PATCH 1/2] tree-optimization/97089 - fix bogus unsigned division replacement

2020-09-18 Thread Richard Biener
This fixes bogus replacing of an unsigned (-x)/y division by -(x/y). Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. Richard. 2020-09-18 Richard Biener PR tree-optimization/97089 * tree-ssa-sccvn.c (visit_nary_op): Do not replace unsigned divisions. ---

[PATCH] optabs: Don't reuse target for multi-word expansions if it overlaps operand(s) [PR97073]

2020-09-18 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase is miscompiled on i686-linux, because we try to expand a double-word bitwise logic operation with op0 being a (mem:DI u) and target (mem:DI u+4), i.e. partial overlap, and thus end up with: movl4(%esp), %eax andlu, %eax movl%eax, u+4 !

Re: [PATCH] Enable GCC support for AMX

2020-09-18 Thread Hongyu Wang via Gcc-patches
Hi Kirill, Very Appreciated for your review again I just update the patch with adding XSAVE dependency and use __builtin_cpu_supports for runtime test. Re-based on Sept. 15 trunk and tested with sde. Kindly PING. Hongyu Wang 于2020年9月12日周六 上午1:00写道: > Hi > > Thanks for your review, and sorry

[PATCH] tree-optimization/97095 - fix typo in vectorizable_live_operation

2020-09-18 Thread Richard Biener
This fixes a typo introduced with the last change and not noticed because those vectorizer access macros are not type safe ... Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. 2020-09-18 Richard Biener PR tree-optimization/97095 * tree-vect-loop.c (vectorizable_liv

[committed] amdgcn: Remove omp_gcn pass

2020-09-18 Thread Andrew Stubbs
This patch removes the amdgcn-specific "omp_gcn" pass that was responsible for tweaking the OpenMP middle-end IR for GCN. In the past there were a few things there to make it work for simple cases while real support was built out in the backend and libgomp, but those haven't been needed ever s

[PATCH] IBM Z: Try to make use of load-and-test instructions

2020-09-18 Thread Stefan Schulze Frielinghaus via Gcc-patches
This patch enables a peephole2 optimization which transforms a load of constant zero into a temporary register which is then finally used to compare against a floating-point register of interest into a single load and test instruction. However, the optimization is only applied if both registers ar

[PATCH] amdgcn, nvptx: Disable OMP barriers in nested teams

2020-09-18 Thread Andrew Stubbs
This patch fixes a problem in which nested OpenMP parallel regions cause errors if the number of inner teams is not balanced (i.e. the number of loop iterations is not divisible by the number of physical threads). A testcase is included. On NVPTX the symptom was a fatal error: libgomp: cuCtxS

[PATCH] tree-optimization/97081 - fix wrong-code with vectorized shift

2020-09-18 Thread Richard Biener
This corrects the mask for creation of x << s | x >> (-x & mask) from a rotate x < PR tree-optimization/97081 * tree-vect-patterns.c (vect_recog_rotate_pattern): Use the precision of the shifted operand to determine the mask. * gcc.dg/vect/pr97081.c: New testcase.

Re: [PATCH] tree-optimization/97081 - fix wrong-code with vectorized shift

2020-09-18 Thread Jakub Jelinek via Gcc-patches
On Fri, Sep 18, 2020 at 01:39:16PM +0200, Richard Biener wrote: > This corrects the mask for creation of x << s | x >> (-x & mask) > from a rotate x < > Bootstrap / regtest running on x86_64-unknown-linux-gnu. > > 2020-09-18 Richard Biener > > PR tree-optimization/97081 > * tree-v

Re: [PATCH] irange_pool class

2020-09-18 Thread David Malcolm via Gcc-patches
On Fri, 2020-09-18 at 07:49 +0200, Aldy Hernandez wrote: > > On 9/18/20 3:43 AM, David Malcolm wrote: > > On Thu, 2020-09-17 at 12:36 +0200, Aldy Hernandez via Gcc-patches > > wrote: > > > This is the irange storage class. It is used to allocate the > > > minimum > > > amount of storage needed fo

Re: [PATCH] libiberty/pex-win32.c: Initialize orig_err

2020-09-18 Thread Christophe Lyon via Gcc-patches
On Thu, 17 Sep 2020 at 23:33, Jeff Law wrote: > > > On 9/14/20 3:29 AM, Christophe Lyon via Gcc-patches wrote: > > Initializing orig_err avoids a warning: "may be used uninitialized". > > > > 2020-09-14 Torbjörn SVENSSON > > Christophe Lyon > > > > libiberty/ > > * pex-win32

Re: [PATCH] CSE negated multiplications and divisions

2020-09-18 Thread Christophe Lyon via Gcc-patches
On Thu, 17 Sep 2020 at 13:20, Richard Biener wrote: > > This adds the capability to look for available negated multiplications > and divisions, replacing them with cheaper negates. > > Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. > This patch caused a regression in fortran, I file

Re: [PATCH] aarch64: Add extend-as-extract-with-shift pattern [PR96998]

2020-09-18 Thread Alex Coplan
Hi Richard, Segher, On 17/09/2020 08:10, Richard Sandiford wrote: > Alex Coplan writes: > > Hi Richard, > > > > On 10/09/2020 19:18, Richard Sandiford wrote: > >> Alex Coplan writes: > >> > Hello, > >> > > >> > Since r11-2903-g6b3034eaba83935d9f6dfb20d2efbdb34b5b00bf introduced a > >> > canonica

Re: [PATCH] tree-optimization/97081 - fix wrong-code with vectorized shift

2020-09-18 Thread Jakub Jelinek via Gcc-patches
On Fri, Sep 18, 2020 at 01:39:16PM +0200, Richard Biener wrote: > --- a/gcc/tree-vect-patterns.c > +++ b/gcc/tree-vect-patterns.c > @@ -2456,7 +2456,6 @@ vect_recog_rotate_pattern (vec_info *vinfo, >append_pattern_def_seq (vinfo, stmt_vinfo, def_stmt); > } >stype = TREE_TYPE (def);

Re: [PATCH] irange_pool class

2020-09-18 Thread Aldy Hernandez via Gcc-patches
On 9/18/20 2:28 PM, David Malcolm wrote: On Fri, 2020-09-18 at 07:49 +0200, Aldy Hernandez wrote: On 9/18/20 3:43 AM, David Malcolm wrote: On Thu, 2020-09-17 at 12:36 +0200, Aldy Hernandez via Gcc-patches wrote: This is the irange storage class. It is used to allocate the minimum amount o

Re: [PATCH] bpf: use xBPF signed div, mod insns when available

2020-09-18 Thread Jose E. Marchesi via Gcc-patches
>> The 'mod' and 'div' operators in eBPF are unsigned, with no signed >> counterpart. xBPF adds two new ALU operations, sdiv and smod, for >> signed division and modulus, respectively. Update bpf.md with >> 'define_insn' blocks for signed div and mod to use them when targetting >> xBPF, and add n

Re: [PATCH] debug: Pass --gdwarf-N to assembler if fixed gas is detected during configure

2020-09-18 Thread Mark Wielaard
Hi, On Tue, 2020-09-15 at 20:40 +0200, Jakub Jelinek wrote: > Ok, here it is in patch form. > I've briefly tested it, with the older binutils I have around (no --gdwarf-N > support), with latest gas (--gdwarf-N that can be passed to as even when > compiling C/C++ etc. code and emitting .debug_line

Re: [PATCH] vect/test: Don't check for epilogue loop [PR97075]

2020-09-18 Thread Segher Boessenkool
On Fri, Sep 18, 2020 at 10:37:47AM +0800, Kewen.Lin wrote: > The commit r11-3230 brings a nice improvement to use full > vectors instead of partial vectors when available. But > it caused some vector with length test cases to fail on > Power. > > The failure on gcc.target/powerpc/p9-vec-length-ep

Re: [PATCH] aarch64: Don't generate invalid zero/sign-extend syntax

2020-09-18 Thread Alex Coplan
Hi Christophe, On 08/09/2020 10:14, Christophe Lyon wrote: > On Mon, 17 Aug 2020 at 11:00, Alex Coplan wrote: > > > > gcc/ChangeLog: > > > > * config/aarch64/aarch64.md > > (*adds__): Ensure extended operand > > agrees with width of extension specifier. > > (*subs_

Re: [PATCH] irange_pool class

2020-09-18 Thread Andrew MacLeod via Gcc-patches
On 9/18/20 8:28 AM, David Malcolm wrote:I think of a "pool allocator" as something that makes a small number of large allocation under the covers, and then uses that to serve large numbers of fixed sized small allocations and deallocations with O(1) using a free list. Ah, I didn't know pool had

Re: [PATCH] irange_pool class

2020-09-18 Thread Aldy Hernandez via Gcc-patches
On 9/18/20 6:42 PM, Andrew MacLeod wrote: On 9/18/20 8:28 AM, David Malcolm wrote:I think of a "pool allocator" as something that makes a small number of large allocation under the covers, and then uses that to serve large numbers of fixed sized small allocations and deallocations with O(1) usin

Re: [PATCH] irange_pool class

2020-09-18 Thread Martin Sebor via Gcc-patches
On 9/18/20 8:10 AM, Aldy Hernandez via Gcc-patches wrote: On 9/18/20 2:28 PM, David Malcolm wrote: On Fri, 2020-09-18 at 07:49 +0200, Aldy Hernandez wrote: On 9/18/20 3:43 AM, David Malcolm wrote: On Thu, 2020-09-17 at 12:36 +0200, Aldy Hernandez via Gcc-patches wrote: This is the irange s

Re: [PATCH] bpf: use xBPF signed div, mod insns when available

2020-09-18 Thread David Faust via Gcc-patches
> >>> The 'mod' and 'div' operators in eBPF are unsigned, with no signed >>> counterpart. xBPF adds two new ALU operations, sdiv and smod, for >>> signed division and modulus, respectively. Update bpf.md with >>> 'define_insn' blocks for signed div and mod to use them when targetting >>> xBPF, and

[GCC 10] [PATCH] IRA: Don't make a global register eliminable

2020-09-18 Thread H.J. Lu via Gcc-patches
On Thu, Sep 17, 2020 at 3:52 PM Jeff Law wrote: > > > On 9/16/20 8:46 AM, Richard Sandiford wrote: > > "H.J. Lu" writes: > > On Tue, Sep 15, 2020 at 7:44 AM Richard Sandiford > wrote: > > Thanks for looking at this. > > "H.J. Lu" writes: > > commit 1bcb4c4faa4bd6b1c917c75b100d618faf9e628c > Aut

Re: [PATCH v2] builtins: rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193]

2020-09-18 Thread Raoni Fassina Firmino via Gcc-patches
Ping.

Re: [PATCH] irange_pool class

2020-09-18 Thread Andrew MacLeod via Gcc-patches
On 9/18/20 1:07 PM, Martin Sebor wrote: On 9/18/20 8:10 AM, Aldy Hernandez via Gcc-patches wrote: On 9/18/20 2:28 PM, David Malcolm wrote: On Fri, 2020-09-18 at 07:49 +0200, Aldy Hernandez wrote: On 9/18/20 3:43 AM, David Malcolm wrote: On Thu, 2020-09-17 at 12:36 +0200, Aldy Hernandez via

Re: [OG10] Backporting + merge of GCC 10 into branch + pre-applying (OpenMP: Handle cpp_implicit_alias in declare-target discovery)

2020-09-18 Thread Tobias Burnus
On 9/17/20 7:04 PM, Tobias Burnus wrote: OG10 = devel/omp/gcc-10 Added additionally: 5e8af933d6f libgomp.c-c++-common/pr96390.c: XFAIL on nvptx. d759c5ff1a0 OpenMP: Fix declare-target discovery with aliasing Cheers, Tobias - Mentor Graphics (Deutschland) GmbH, Arnulfstraße

Re: [pushed] c++: Layout decls with newly-complete type.

2020-09-18 Thread H.J. Lu via Gcc-patches
On Thu, Sep 17, 2020 at 11:43 PM Richard Biener via Gcc-patches wrote: > > On Fri, Sep 18, 2020 at 5:20 AM Jason Merrill via Gcc-patches > wrote: > > > > Martin's -Wplacement-new patch ran into a problem with DECL_SIZE not being > > set on an extern variable for which the type was not complete un

Re: [RS6000] rs6000_rtx_costs reduce cost for SETs

2020-09-18 Thread Segher Boessenkool
On Fri, Sep 18, 2020 at 01:08:42PM +0930, Alan Modra wrote: > On Thu, Sep 17, 2020 at 12:51:25PM -0500, Segher Boessenkool wrote: > > > - if (CONST_INT_P (XEXP (x, 1)) > > > - && satisfies_constraint_I (XEXP (x, 1))) > > > + if (!speed) > > > + /* A little more than one insn so that not

Re: [PATCH] vect/test: Don't check for epilogue loop [PR97075]

2020-09-18 Thread Richard Sandiford
Thanks for looking at this. "Kewen.Lin" writes: > Hi, > > The commit r11-3230 brings a nice improvement to use full > vectors instead of partial vectors when available. But > it caused some vector with length test cases to fail on > Power. > > The failure on gcc.target/powerpc/p9-vec-length-epil

Re: [PATCH v2 1/2] IFN: Implement IFN_VEC_SET for ARRAY_REF with VIEW_CONVERT_EXPR

2020-09-18 Thread Segher Boessenkool
On Fri, Sep 18, 2020 at 01:17:40AM -0500, Xiong Hu Luo wrote: > This patch enables transformation from ARRAY_REF(VIEW_CONVERT_EXPR) to > VEC_SET internal function in gimple-isel pass if target supports > vec_set with variable index by checking can_vec_set_var_idx_p. > + tree_code code = TREE_

[PATCH] generalized range_query class for multiple contexts

2020-09-18 Thread Aldy Hernandez via Gcc-patches
As part of the ranger work, we have been trying to clean up and generalize interfaces whenever possible. This not only helps in reducing the maintenance burden going forward, but provides mechanisms for backwards compatibility between ranger and other providers/users of ranges throughout the c

Re: [PATCH] c++: std::is_constant_evaluated inside a constraint [PR97051]

2020-09-18 Thread Jason Merrill via Gcc-patches
On 9/17/20 12:36 PM, Patrick Palka wrote: According to [expr.const]/14, the result of substitution into an atomic constraint is manifestly constant-evaluated; this patch adjusts the call to maybe_constant_value in satisfy_atom to that effect. Tested on x86_64-pc-linux-gnu, and also tested on the

Re: [PATCH] c++: Fix P0846 (ADL and function templates) in template [PR97010]

2020-09-18 Thread Marek Polacek via Gcc-patches
Ping. On Thu, Sep 10, 2020 at 06:15:24PM -0400, Marek Polacek via Gcc-patches wrote: > To quickly recap, P0846 says that a name is also considered to refer to > a template if it is an unqualified-id followed by a < and name lookup > finds either one or more functions or finds nothing. > > In a te

[PATCH] c++: Fix self-mapping in map_arguments [PR96531, PR97103]

2020-09-18 Thread Patrick Palka via Gcc-patches
With r10-8077 we stopped passing the argified current_template_parms to normalize_constraint_expression from finish_nested_requirement, and instead tweaked map_arguments to perform a self-mapping of parameters when args is NULL. We're currently not handling parameter packs and BOUND_TEMPLATE_TEMPL

Re: [PATCH v2 2/2] rs6000: Expand vec_insert in expander instead of gimple [PR79251]

2020-09-18 Thread Segher Boessenkool
Hi! On Fri, Sep 18, 2020 at 01:17:41AM -0500, Xiong Hu Luo wrote: > vec_insert accepts 3 arguments, arg0 is input vector, arg1 is the value > to be insert, arg2 is the place to insert arg1 to arg0. Current expander > generates stxv+stwx+lxv if arg2 is variable instead of constant, which > causes

Re: [PATCH] c++: Fix self-mapping in map_arguments [PR96531, PR97103]

2020-09-18 Thread Jason Merrill via Gcc-patches
On 9/18/20 4:07 PM, Patrick Palka wrote: With r10-8077 we stopped passing the argified current_template_parms to normalize_constraint_expression from finish_nested_requirement, and instead tweaked map_arguments to perform a self-mapping of parameters when args is NULL. We're currently not handli

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-18 Thread Qing Zhao via Gcc-patches
Hi, Richard, During my implementation of the new version of the patch. I still feel that it’s not practical to add a default definition in the middle end to just use move patterns to zero each selected register. The major issues are: There are some target specific information on how to define

Re: [PATCH] irange_pool class

2020-09-18 Thread Martin Sebor via Gcc-patches
On 9/18/20 11:36 AM, Andrew MacLeod wrote: On 9/18/20 1:07 PM, Martin Sebor wrote: On 9/18/20 8:10 AM, Aldy Hernandez via Gcc-patches wrote: On 9/18/20 2:28 PM, David Malcolm wrote: On Fri, 2020-09-18 at 07:49 +0200, Aldy Hernandez wrote: On 9/18/20 3:43 AM, David Malcolm wrote: On Thu, 2

Re: [PATCH] generalized range_query class for multiple contexts

2020-09-18 Thread Aldy Hernandez via Gcc-patches
Forgot to include ChangeLog entries. Aldy >From 49246a5aa51aff0e1beb97b8415985ffdbd5d922 Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Thu, 17 Sep 2020 09:23:12 +0200 Subject: [PATCH 1/3] Initial implementation of value query class. gcc/ChangeLog: * Makefile.in: Add value-query.o

Re: [PATCH] c++: Fix self-mapping in map_arguments [PR96531, PR97103]

2020-09-18 Thread Patrick Palka via Gcc-patches
On Fri, 18 Sep 2020, Jason Merrill wrote: > On 9/18/20 4:07 PM, Patrick Palka wrote: > > With r10-8077 we stopped passing the argified current_template_parms to > > normalize_constraint_expression from finish_nested_requirement, and > > instead tweaked map_arguments to perform a self-mapping of pa

Re: [PATCH] irange_pool class

2020-09-18 Thread Andrew MacLeod via Gcc-patches
On 9/18/20 4:35 PM, Martin Sebor wrote: On 9/18/20 11:36 AM, Andrew MacLeod wrote: On it works exactly like one would expect a simple allocator to work.. as long as the allcoator is "live", its allocations are live.  once it is destructed, all the memory it manages is freed..    It purpose i

[committed] analyzer: handle strdup and strndup

2020-09-18 Thread David Malcolm via Gcc-patches
Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to master as c89956cba9d1a5fbf059f7880ff49418718a2965. gcc/analyzer/ChangeLog: * sm-malloc.cc (malloc_state_machine::on_stmt): Handle strdup and strndup as being malloc-like allocators. gcc/testsuite/ChangeLog:

[committed] analyzer: fix warning_event::get_desc for global state changes

2020-09-18 Thread David Malcolm via Gcc-patches
When experimenting the a new state_machine with global state I noticed that the fallback handling in warning_event::get_desc assumes we have per-value states, and ICEs on global states. Fixed thusly. Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu. Pushed to master as 1df487a5204462

Re: [PATCH] PR fortran/97036 - [F2018] Allow ELEMENTAL RECURSIVE procedure prefix

2020-09-18 Thread Jerry DeLisle via Gcc-patches
ok, thanks . On 9/15/20 1:35 PM, Harald Anlauf wrote: As stated in the PR, the Fortran 2018 standard removed the restriction prohibiting ELEMENTAL RECURSIVE procedures. Adjust the relevant check. Regtested on x86_64-pc-linux-gnu. OK for master? Thanks, Harald PR fortran/97036 - [F2018] All

Re: PING [Patch][Middle-end]Add -fzero-call-used-regs=[skip|used-gpr|all-gpr|used|all]

2020-09-18 Thread Segher Boessenkool
Hi! On Fri, Sep 18, 2020 at 03:31:12PM -0500, Qing Zhao wrote: > Let me know your opinion: > > A. Will not provide default definition in middle end to generate the zeroing > insn for selected registers. Move the generation work all to target; X86 > implementation will be provided; > > OR: >

Re: [PATCH] bpf: use xBPF signed div, mod insns when available

2020-09-18 Thread Segher Boessenkool
Hi! On Thu, Sep 17, 2020 at 10:15:30AM -0700, David Faust via Gcc-patches wrote: > The 'mod' and 'div' operators in eBPF are unsigned, with no signed > counterpart. xBPF adds two new ALU operations, sdiv and smod, for > signed division and modulus, respectively. Update bpf.md with > 'define_insn'

Re: [PATCH] CSE negated multiplications and divisions

2020-09-18 Thread Segher Boessenkool
Hi! On Thu, Sep 17, 2020 at 01:20:35PM +0200, Richard Biener wrote: > This adds the capability to look for available negated multiplications > and divisions, replacing them with cheaper negates. It is longer latency than the original insns. Combine will try to undo this, because of that (it depe

Re: [Patch 5/5] rs6000, Conversions between 128-bit integer and floating point values.

2020-09-18 Thread will schmidt via Gcc-patches
On Tue, 2020-08-11 at 12:23 -0700, Carl Love wrote: > Segher, Will: > > Patch 5 adds the 128-bit integer to/from 128-floating point > conversions. This patch has to invoke the routines to use the 128-bit > hardware instructions if on Power 10 or use software routines if > running on a pre Power 1

Re: [PATCH] c++: Fix self-mapping in map_arguments [PR96531, PR97103]

2020-09-18 Thread Patrick Palka via Gcc-patches
On Fri, 18 Sep 2020, Patrick Palka wrote: > On Fri, 18 Sep 2020, Jason Merrill wrote: > > > On 9/18/20 4:07 PM, Patrick Palka wrote: > > > With r10-8077 we stopped passing the argified current_template_parms to > > > normalize_constraint_expression from finish_nested_requirement, and > > > instea

[PATCH] libstdc++: Fix division by zero in std::sample

2020-09-18 Thread Patrick Palka via Gcc-patches
This fixes a division by zero in the selection-sampling std::__search overload when the input range is empty (and hence __unsampled_sz is 0). Tested on x86_64-pc-linux-gnu. libstdc++-v3/ChangeLog: * include/bits/stl_algo.h (__sample): Exit early when the input range is empty.

[PATCH] libstdc++: Mark some more algorithms constexpr for C++20

2020-09-18 Thread Patrick Palka via Gcc-patches
As per P0202. Tested on x86_64-pc-linux-gnu. libstdc++-v3/ChangeLog: * include/bits/stl_algo.h (for_each_n): Mark constexpr for C++20. (search): Likewise for the overload that takes a searcher. * testsuite/25_algorithms/for_each/constexpr.cc: Test constexpr std::f

Re: [PATCH] c++: Fix self-mapping in map_arguments [PR96531, PR97103]

2020-09-18 Thread Jason Merrill via Gcc-patches
On 9/18/20 8:42 PM, Patrick Palka wrote: On Fri, 18 Sep 2020, Patrick Palka wrote: On Fri, 18 Sep 2020, Jason Merrill wrote: On 9/18/20 4:07 PM, Patrick Palka wrote: With r10-8077 we stopped passing the argified current_template_parms to normalize_constraint_expression from finish_nested_req