[PATCH] middle-end/90648 fend off builtin calls with not enough arguments from match

2020-02-05 Thread Richard Biener
This adds guards to genmatch generated code before accessing call expression or stmt arguments that might be out of bounds when the user provided bogus prototypes for what we consider builtins. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. Richard. 2020-02-05 Richard Biener

[PATCH] testsuite/92177 fix for SLP build changes

2020-02-05 Thread Richard Biener
We're now consistently building SLP operations with only scalar defs from scalars which makes the testcase no longer testing multiplication vectorization. The following smuggles in a constant making the vector variant profitable for SLP build. Tested on x86_64-linux, pushed. 2020-02-05 Ri

Re: [PATCH] avoid issuing -Wrestrict from folder (PR 93519)

2020-02-06 Thread Richard Biener
On Wed, Feb 5, 2020 at 4:55 PM Martin Sebor wrote: > > On 2/5/20 1:19 AM, Richard Biener wrote: > > On Tue, Feb 4, 2020 at 11:02 PM Martin Sebor wrote: > >> > >> On 2/4/20 2:31 PM, Jeff Law wrote: > >>> On Tue, 2020-02-04 at 13:08 -0700, Martin Sebor

Re: [PATCH] avoid issuing -Wrestrict from folder (PR 93519)

2020-02-06 Thread Richard Biener
On Thu, Feb 6, 2020 at 11:06 AM Richard Biener wrote: > > On Wed, Feb 5, 2020 at 4:55 PM Martin Sebor wrote: > > > > On 2/5/20 1:19 AM, Richard Biener wrote: > > > On Tue, Feb 4, 2020 at 11:02 PM Martin Sebor wrote: > > >> > > >> On 2/4/20 2:3

Re: [PATCH] avoid issuing -Wrestrict from folder (PR 93519)

2020-02-06 Thread Richard Biener
On Thu, Feb 6, 2020 at 11:33 AM Richard Biener wrote: > > On Thu, Feb 6, 2020 at 11:06 AM Richard Biener > wrote: > > > > On Wed, Feb 5, 2020 at 4:55 PM Martin Sebor wrote: > > > > > > On 2/5/20 1:19 AM, Richard Biener wrote: > > > >

Re: [PATCH 0/4] Fix various minor issues seen with cppcheck

2020-02-06 Thread Richard Biener
On Thu, Feb 6, 2020 at 12:07 PM Martin Liska wrote: > > Hi. > > The series is about small issues that were spotted with cppcheck > and where David Binderman suggested a patch. > > It's probably a stage1 material? Yes. > Martin > > Martin Liska (4): > Remove 2 dead variables in bid_internal.h.

Re: [PATCH] avoid issuing -Wrestrict from folder (PR 93519)

2020-02-06 Thread Richard Biener
On Thu, Feb 6, 2020 at 12:14 PM Richard Biener wrote: > > On Thu, Feb 6, 2020 at 11:33 AM Richard Biener > wrote: > > > > On Thu, Feb 6, 2020 at 11:06 AM Richard Biener > > wrote: > > > > > > On Wed, Feb 5, 2020 at 4:55 PM Martin Sebor wrote: >

Re: [PATCH] c++: Handle CONSTRUCTORs without indexes in find_array_ctor_elt [PR93549]

2020-02-06 Thread Richard Biener
relies that it has one. > constructor_elt *cep = NULL; > if (code == ARRAY_TYPE) > { > HOST_WIDE_INT i > = find_array_ctor_elt (*valp, index, /*insert*/true); > gcc_assert (i >= 0); > cep = CONSTRUCTOR_ELT (*valp,

Re: [PR47785] COLLECT_AS_OPTIONS

2020-02-06 Thread Richard Biener
On Thu, Feb 6, 2020 at 1:48 PM Prathamesh Kulkarni wrote: > > On Tue, 4 Feb 2020 at 19:44, Richard Biener > wrote: > > > > On Mon, Feb 3, 2020 at 12:37 PM Prathamesh Kulkarni > > wrote: > > > > > > On Thu, 30 Jan 2020 at 19:10, Richard Biener >

Re: [PATCH] avoid issuing -Wrestrict from folder (PR 93519)

2020-02-06 Thread Richard Biener
On Thu, Feb 6, 2020 at 2:00 PM Jeff Law wrote: > > On Wed, 2020-02-05 at 09:19 +0100, Richard Biener wrote: > > On Tue, Feb 4, 2020 at 11:02 PM Martin Sebor wrote: > > > On 2/4/20 2:31 PM, Jeff Law wrote: > > > > On Tue, 2020-02-04 at 13:08 -0700, Martin Sebor wr

[PATCH] middle-end/93519 - avoid folding stmts in obviously unreachable code

2020-02-06 Thread Richard Biener
The inliner folds stmts delayed, the following arranges things so to not fold stmts that are obviously not reachable to avoid warnings from those code regions. Bootstrapped and tested on x86_64-unknown-linux-gnu. OK? Thanks, Richard. 2020-02-06 Richard Biener PR middle-end/93519

Re: [PATCH] avoid issuing -Wrestrict from folder (PR 93519)

2020-02-07 Thread Richard Biener
On Fri, Feb 7, 2020 at 12:08 AM Martin Sebor wrote: > > On 2/6/20 6:16 AM, Richard Biener wrote: > > On Thu, Feb 6, 2020 at 2:00 PM Jeff Law wrote: > >> > >> On Wed, 2020-02-05 at 09:19 +0100, Richard Biener wrote: > >>> On Tue, Feb 4, 2020 at 11:02 PM

Re: [PATCH] middle-end/93519 - avoid folding stmts in obviously unreachable code

2020-02-07 Thread Richard Biener
On Thu, 6 Feb 2020, Martin Sebor wrote: > On 2/6/20 7:52 AM, Richard Biener wrote: > > The inliner folds stmts delayed, the following arranges things so > > to not fold stmts that are obviously not reachable to avoid warnings > > from those code regions. > > > >

Re: [PATCH] i386: Fix -mavx -mno-mavx2 ICE with VEC_COND_EXPR [PR93637]

2020-02-10 Thread Richard Biener
On Mon, Feb 10, 2020 at 3:33 PM Jakub Jelinek wrote: > > Hi! > > As mentioned in the PR, for -mavx -mno-avx2 the backend does support > vcondv4div4df and vcondv8siv8sf optabs (while generally 32-byte vectors > aren't much supported in that case, it is performed using > vandps/vandnps/vorps). The

Re: [PATCH 0/4 GCC11] IVOPTs consider step cost for different forms when unrolling

2020-02-10 Thread Richard Biener
On Mon, 10 Feb 2020, Segher Boessenkool wrote: > Hi! > > On Mon, Feb 10, 2020 at 02:17:04PM +0800, Kewen.Lin wrote: > > on 2020/1/20 下午8:33, Segher Boessenkool wrote: > > > On Thu, Jan 16, 2020 at 05:36:52PM +0800, Kewen.Lin wrote: > > >> As we discussed in the thread > > >> https://gcc.gnu.org/m

Re: [PATCH 0/4 GCC11] IVOPTs consider step cost for different forms when unrolling

2020-02-11 Thread Richard Biener
On Tue, 11 Feb 2020, Segher Boessenkool wrote: > On Tue, Feb 11, 2020 at 08:34:15AM +0100, Richard Biener wrote: > > On Mon, 10 Feb 2020, Segher Boessenkool wrote: > > > Yes, we should decide how often we want to unroll things somewhere before > > > ivopts already,

[PATCH] tree-optimization/93661 properly guard tree_to_poly_int64

2020-02-11 Thread Richard Biener
Bootstrapped / tested on x86_64-unknown-linux-gnu, pushed. Richard. 2020-02-11 Richard Biener PR tree-optimization/93661 PR tree-optimization/93662 * tree-ssa-sccvn.c (vn_reference_lookup_3): Properly guard tree_to_poly_int64. * tree-sra.c

Re: [PATCH 0/4 GCC11] IVOPTs consider step cost for different forms when unrolling

2020-02-11 Thread Richard Biener
On Tue, 11 Feb 2020, Roman Zhuykov wrote: > 11.02.2020 11:01, Richard Biener wrote: > > On Tue, 11 Feb 2020, Segher Boessenkool wrote: > > > >> On Tue, Feb 11, 2020 at 08:34:15AM +0100, Richard Biener wrote: > >>> On Mon, 10 Feb 2020, Segher Boessenkool wro

Re: [PATCH 0/4 GCC11] IVOPTs consider step cost for different forms when unrolling

2020-02-12 Thread Richard Biener
On Tue, 11 Feb 2020, Segher Boessenkool wrote: > On Tue, Feb 11, 2020 at 02:58:47PM +0100, Richard Biener wrote: > > On Tue, 11 Feb 2020, Roman Zhuykov wrote: > > > 11.02.2020 11:01, Richard Biener wrote: > > > Sound good, but IMHO modulo scheduler is not the best c

Re: [PATCH 0/4 GCC11] IVOPTs consider step cost for different forms when unrolling

2020-02-12 Thread Richard Biener
On Tue, 11 Feb 2020, Segher Boessenkool wrote: > Hi! > > On Tue, Feb 11, 2020 at 03:46:05PM +0300, Roman Zhuykov wrote: > > Hmm, even when trying to move it just few passes earlier many years ago, > > got another opinion: > > https://gcc.gnu.org/ml/gcc-patches/2011-10/msg01526.html > > Although w

Re: [RFC] [c-family] PR92867 - Add returns_arg attribute

2020-02-12 Thread Richard Biener
> > > wrote: > > > > > > > > On Thu, 30 Jan 2020 at 19:17, Richard Biener > > > > wrote: > > > > > > > > > > On Thu, Jan 30, 2020 at 11:49 AM Prathamesh Kulkarni > > > > > wrote: > > > >

[PATCH] testsuite/93697 fix inconsistent warning in testcase

2020-02-12 Thread Richard Biener
The warning was emitted inconsistently on targets, so disable it since the testcase was for an ICE. 2020-02-12 Richard Biener PR testsuite/93697 * gcc.dg/pr93661.c: Pass -w, remove dg-warning. --- gcc/testsuite/gcc.dg/pr93661.c | 4 ++-- 1 file changed, 2 insertions(+), 2

Re: [PATCH 0/4 GCC11] IVOPTs consider step cost for different forms when unrolling

2020-02-12 Thread Richard Biener
On Wed, 12 Feb 2020, Segher Boessenkool wrote: > On Wed, Feb 12, 2020 at 09:12:58AM +0100, Richard Biener wrote: > > On Tue, 11 Feb 2020, Segher Boessenkool wrote: > > > Basic block partitioning has wildly disproportionate fallout in all > > > later passes, both in t

Re: [PATCH 0/4 GCC11] IVOPTs consider step cost for different forms when unrolling

2020-02-12 Thread Richard Biener
On Wed, 12 Feb 2020, Segher Boessenkool wrote: > On Wed, Feb 12, 2020 at 11:53:22AM +0100, Richard Biener wrote: > > On Wed, 12 Feb 2020, Segher Boessenkool wrote: > > > On Wed, Feb 12, 2020 at 09:12:58AM +0100, Richard Biener wrote: > > > > On Tue, 11 Feb

[PATCH] testsuite/93717 fix up gcc.dg/optimize-bswapsi-2.c for BE

2020-02-13 Thread Richard Biener
Pushed. 2020-02-13 Richard Biener PR testsuite/93717 * gcc.dg/optimize-bswapsi-2.c: Add BE case. --- gcc/testsuite/gcc.dg/optimize-bswapsi-2.c | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/gcc/testsuite/gcc.dg/optimize-bswapsi-2.c

Re: [PATCH] sccvn: Handle bitfields in vn_reference_lookup_3 [PR93582]

2020-02-13 Thread Richard Biener
ssign_rhs1 (def_stmt); > --- gcc/testsuite/gcc.dg/tree-ssa/pr93582-1.c.jj 2020-02-12 > 18:23:02.522285857 +0100 > +++ gcc/testsuite/gcc.dg/tree-ssa/pr93582-1.c 2020-02-12 18:24:51.284661882 > +0100 > @@ -0,0 +1,17 @@ > +/* PR tree-optimization/93582 */ > +/* { dg-do compile { target int32 } } */ > +/* { dg-options "-O2 -fdump-tree-fre1" } */ > +/* { dg-final { scan-tree-dump "return 1;" "fre1" } } */ > + > +union U { > + struct S { int a : 1, b : 4, c : 27; } s; > + struct T { int d : 2; int e : 2; int f : 28; } t; > +}; > + > +int > +foo (void) > +{ > + union U u; > + u.s.b = 10; > + return u.t.e; > +} > --- gcc/testsuite/gcc.dg/tree-ssa/pr93582-2.c.jj 2020-02-12 > 18:23:05.608239781 +0100 > +++ gcc/testsuite/gcc.dg/tree-ssa/pr93582-2.c 2020-02-12 18:31:12.443970643 > +0100 > @@ -0,0 +1,17 @@ > +/* PR tree-optimization/93582 */ > +/* { dg-do compile { target int32 } } */ > +/* { dg-options "-O2 -fdump-tree-fre1" } */ > +/* { dg-final { scan-tree-dump "return 593;" "fre1" } } */ > + > +union U { > + struct S { int a : 1, b : 14, c : 17; } s; > + struct T { int d : 2; int e : 12; int f : 18; } t; > +}; > + > +int > +foo (void) > +{ > + union U u; > + u.s.b = -7005; > + return u.t.e; > +} > --- gcc/testsuite/gcc.dg/tree-ssa/pr93582-3.c.jj 2020-02-12 > 18:30:55.372225545 +0100 > +++ gcc/testsuite/gcc.dg/tree-ssa/pr93582-3.c 2020-02-12 18:31:20.136855767 > +0100 > @@ -0,0 +1,18 @@ > +/* PR tree-optimization/93582 */ > +/* { dg-do compile { target int32 } } */ > +/* { dg-options "-O2 -fdump-tree-fre1" } */ > +/* { dg-final { scan-tree-dump "return 1;" "fre1" { target be } } } */ > +/* { dg-final { scan-tree-dump "return 2;" "fre1" { target le } } } */ > + > +union U { > + struct S { int a : 1, b : 14, c : 17; } s; > + struct T { int d : 10; int e : 4; int f : 18; } t; > +}; > + > +int > +foo (void) > +{ > + union U u; > + u.s.b = -7005; > + return u.t.e; > +} > > Jakub > > -- Richard Biener SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany; GF: Felix Imendörffer; HRB 36809 (AG Nuernberg)

Re: [PING^3][PATCH] optimize costly division in rtx_cost

2020-02-13 Thread Richard Biener
On Thu, Feb 13, 2020 at 2:46 PM Alexander Monakov wrote: > > Ping^3. OK. > On Sun, 5 Jan 2020, Alexander Monakov wrote: > > > Hi, > > > > I noticed there's a costly signed 64-bit division in rtx_cost on x86 as > > well as > > any other target where UNITS_PER_WORD is implemented like TARGET_64BI

Re: [PATCH] sra: Avoid verification failure (PR 93516)

2020-02-14 Thread Richard Biener
, new_acc); > + /* Because get_ref_base_and_extent always includes padding in size for > + accesses to DECLs but not necessarily for COMPONENT_REFs of the same > + type, we might be actually attempting to here to create a child of the > + same type as the parent. *

[PATCH] c/86134 avoid errors for unrecognized -Wno- options

2020-02-14 Thread Richard Biener
This makes sure to not promote diagnostics about unrecognized -Wno- options to errors and make the intent of the diagnostic clearer. Bootstrapped and tested on x86_64-unknown-linux-gnu, OK for trunk? Thanks, Richard. 2020-02-14 Richard Biener PR c/86134 * opts-global.c

Re: [PATCH] match.pd: Disallow side-effects in GENERIC for non-COND_EXPR to COND_EXPR simplifications [PR93744]

2020-02-15 Thread Richard Biener
On February 15, 2020 7:09:51 AM GMT+01:00, Jakub Jelinek wrote: >Hi! > >As the following testcases show (the first one reported, last two >found by code inspection), we need to disallow side-effects >in simplifications that turn some unconditional expression into >conditional >one. From my littl

Re: [PATCH] Fix PR66552, Missed optimization when shift amount is result of signed modulus

2020-02-17 Thread Richard Biener
/* { dg-do compile } */ > +/* { dg-options "-O2 -fdump-tree-lower" } */ > + > +unsigned a(unsigned x, int n) > +{ > + return x >> (n % 32); > +} > + > +unsigned b(unsigned x, int n) > +{ > + return x << (n % 32); > +} > + > +/* { dg-final { scan-tree-dump-not " % " "lower" } } */ > -- Richard Biener SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany; GF: Felix Imendörffer; HRB 36809 (AG Nuernberg)

Re: [PATCH] Fix PR66552, Missed optimization when shift amount is result of signed modulus

2020-02-17 Thread Richard Biener
On Mon, 17 Feb 2020, Jakub Jelinek wrote: > On Mon, Feb 17, 2020 at 09:01:13AM +0100, Richard Biener wrote: > > On Mon, 17 Feb 2020, Li Jia He wrote: > > > This patch wants to fix PR66552 on gimple and optimizes (x shift (n mod > > > C)) > > > to (x sh

Re: [PATCH] c/86134 avoid errors for unrecognized -Wno- options

2020-02-17 Thread Richard Biener
On Fri, 14 Feb 2020, Joseph Myers wrote: > On Fri, 14 Feb 2020, Richard Biener wrote: > > > diff --git a/gcc/opts-global.c b/gcc/opts-global.c > > index d5e308bf800..52ea083a6d5 100644 > > --- a/gcc/opts-global.c > > +++ b/gcc/opts-global.c > > @@ -139,8 +1

Re: [PATCH 2/4] Use const for some function arguments.

2020-02-17 Thread Richard Biener
On Mon, Feb 17, 2020 at 11:05 AM Martin Liška wrote: > > On 2/7/20 6:21 PM, Segher Boessenkool wrote: > > On Tue, Feb 04, 2020 at 02:55:14PM +0100, Martin Liska wrote: > >> > >> gcc/ChangeLog: > >> > >> 2020-02-04 Martin Liska > >> > >> PR c/92472. > > > > That trailing dot should not be t

[PATCH] 2nd try for firefox VN ICE fix

2019-12-04 Thread Richard Biener
Bootstrap / regtest running on x86_64-unknown-linux-gnu. Richard. 2019-12-04 Richard Biener * tree-ssa-sccvn.c (vn_reference_lookup_3): Properly guard empty CTOR and memset partial-def registering. Take advantage of fancy offset analysis in memset handling. Index

[PATCH] Handle non-constants in VN partial-def support

2019-12-04 Thread Richard Biener
This improves on the existing partial-def support by allowing shadowed non-constant partial defs. Step 1 to really support non-constant partial-defs which would help Skia. Bootstrapped and tested on x86_64-unknown-linux-gnu, applied. Richard. 2019-12-04 Richard Biener * tree-ssa

Re: [PATCH 00/49] RFC: Add a static analysis framework to GCC

2019-12-04 Thread Richard Biener
On Tue, Dec 3, 2019 at 5:52 PM David Malcolm wrote: > > On Wed, 2019-11-20 at 11:18 +0100, Richard Biener wrote: > > On Tue, Nov 19, 2019 at 11:02 PM David Malcolm > > wrote: > > > > > The checker is implemented as a GCC plugin. > > > > > &

Re: Fix VIEW_CONVERT_EXPRs for VECTOR_BOOLEAN_TYPE_Ps

2019-12-04 Thread Richard Biener
On Wed, Dec 4, 2019 at 11:48 AM Richard Sandiford wrote: > > In r278410 I added code to handle VIEW_CONVERT_EXPRs between > variable-length vectors. This included support for decoding > a VECTOR_BOOLEAN_TYPE_P with subbyte elements. > > However, it turns out that we were already mishandling such

[PATCH] Enable ICE-after-error with -fchecking

2019-12-04 Thread Richard Biener
g - change CHECKING_P to flag_checking. Any objections? Bootstrap & regtest running on x86_64-unkown-linux-gnu. Richard. 2019-12-05 Richard Biener * diagnostic.c: Include options.h. (diagnostic_report_diagnostic): Enable ICEs after errors with -fchecking. Index: gc

Re: [PATCH] Enable ICE-after-error with -fchecking

2019-12-05 Thread Richard Biener
On Wed, 4 Dec 2019, Jakub Jelinek wrote: > On Wed, Dec 04, 2019 at 03:20:59PM +0100, Richard Biener wrote: > > Currently IL verification errors trigger "confused by earlier errors" > > messages with a release compiler but compiling with -fchecking. > > That is b

[PATCH] Fix PR92803

2019-12-05 Thread Richard Biener
The following patch fixes invariant vector construction in vector CTOR optimization. Bootstrapped and tested on x86_64-unknown-linux-gnu, applied. Richard. 2019-12-05 Richard Biener PR tree-optimization/92803 * tree-ssa-forwprop.c (simplify_vector_constructor): Fix

[PATCH] Fix PR92818

2019-12-05 Thread Richard Biener
Richard Biener PR middle-end/92818 * tree-ssa-forwprop.c (simplify_vector_constructor): Improve heuristics on what don't care element to choose. * match.pd (VEC_PERM_EXPR -> BIT_INSERT_EXPR): Fix typo. * gcc.target/i386/pr92818.c: New testcase. Index:

Re: [PATCH] Revert to uniform vector CTOR canonicalization

2019-12-05 Thread Richard Biener
On Thu, 5 Dec 2019, Christophe Lyon wrote: > Hi, > > > On Tue, 3 Dec 2019 at 15:46, Richard Biener wrote: > > > > > > The PR shows I added the bail-out prematurely. > > > > Bootstrapped and tested on x86_64-unknown-linux-gnu, applied. > >

Re: Add -fpartial-profile-training

2019-12-05 Thread Richard Biener
On Wed, Dec 4, 2019 at 10:52 PM Jan Hubicka wrote: > > Hi, > with recent fixes to proile updating I noticed that we get more regressions > compared to gcc 9 at Firefox testing. This is because Firefox train run is > not covering all the benchmarks and gcc 9, thanks to updating bugs sometimes > opt

Re: Check for bitwise identity when encoding VECTOR_CSTs (PR 92768)

2019-12-05 Thread Richard Biener
On Thu, Dec 5, 2019 at 11:26 AM Richard Sandiford wrote: > > This PR shows that we weren't checking for bitwise-identical values > when trying to encode a VECTOR_CST, so -0.0 was treated the same as > 0.0 for -fno-signed-zeros. The patch adds a new OEP flag to select > that behaviour. > > Tested

Re: Add -fpartial-profile-training

2019-12-05 Thread Richard Biener
On Thu, Dec 5, 2019 at 1:41 PM Martin Liška wrote: > > On 12/5/19 1:30 PM, Richard Biener wrote: > > I wonder if the behavior shouldn't be the default? The only thing we lose > > is failing to notice really cold calls (error paths) in programs? > > I would also cons

Re: [SVE] PR89007 - Implement generic vector average expansion

2019-12-05 Thread Richard Biener
On Thu, 5 Dec 2019, Prathamesh Kulkarni wrote: > On Fri, 29 Nov 2019 at 15:41, Richard Biener > wrote: > > > > On Fri, Nov 22, 2019 at 12:40 PM Prathamesh Kulkarni > > wrote: > > > > > > On Wed, 20 Nov 2019 at 16:54, Richard Biener wrote: > > &g

Re: [PATCH] Come up with constructors of symtab_node, cgraph_node and varpool_node.

2019-12-05 Thread Richard Biener
On Thu, Dec 5, 2019 at 1:50 PM Martin Liška wrote: > > Hi. > > As mentioned in the PR, there are classes in cgraph.h that are > not PODs and are initialized with ggc_alloc_cleared. So that I'm suggesting > to use proper constructors. I added ggc_new function that can be used > at different locatio

[PATCH] Improve PR92819

2019-12-05 Thread Richard Biener
After the PR92818 commit there's one function in the testcase below remaining not using bit-inserts. The following fixes this. Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. Richard. 2019-12-05 Richard Biener PR tree-optimization/92819 * mat

Re: [PATCH] Come up with constructors of symtab_node, cgraph_node and varpool_node.

2019-12-05 Thread Richard Biener
On December 5, 2019 2:03:58 PM GMT+01:00, "Martin Liška" wrote: >On 12/5/19 1:59 PM, Richard Biener wrote: >> Isn't there ggc_alloc for this? Also ggc_alloc_no_dtor in >case you >> want to handle finalization yourself. > >No, if I see correctly it

Re: [PATCH] Come up with constructors of symtab_node, cgraph_node and varpool_node.

2019-12-05 Thread Richard Biener
On December 5, 2019 3:09:40 PM GMT+01:00, "Martin Liška" wrote: >On 12/5/19 2:53 PM, Richard Biener wrote: >> On December 5, 2019 2:03:58 PM GMT+01:00, "Martin Liška" > wrote: >>> On 12/5/19 1:59 PM, Richard Biener wrote: >>>> Isn't ther

Re: [PATCH] Come up with constructors of symtab_node, cgraph_node and varpool_node.

2019-12-05 Thread Richard Biener
On December 5, 2019 3:35:17 PM GMT+01:00, Tom Tromey wrote: >> "Martin" == Martin Liška writes: > >Martin> + /* Default constructor. */ >Martin> + symtab_node (symtab_type t) > >FWIW, in gdb, we normally make single-argument constructors "explicit". >This helps avoid surprises with implici

Re: [PATCH] Some further match.pd optimizations with nop_convert (PR tree-optimization/92734)

2019-12-05 Thread Richard Biener
On December 5, 2019 2:03:24 PM GMT+01:00, Marc Glisse wrote: >On Wed, 4 Dec 2019, Jakub Jelinek wrote: > >> --- gcc/match.pd.jj 2019-12-03 10:20:00.244913801 +0100 >> +++ gcc/match.pd 2019-12-03 13:36:01.084435697 +0100 >> @@ -2159,20 +2159,26 @@ (define_operator_list COND_TERNARY >> /* A

Re: [PATCH] Come up with constructors of symtab_node, cgraph_node and varpool_node.

2019-12-05 Thread Richard Biener
On December 5, 2019 5:31:59 PM GMT+01:00, Michael Matz wrote: >Hi, > >On Thu, 5 Dec 2019, Richard Biener wrote: > >> On December 5, 2019 3:35:17 PM GMT+01:00, Tom Tromey >wrote: >> >>>>>> "Martin" == Martin Liška writes: >> > >&

Re: [PATCH] Improve PR92819

2019-12-05 Thread Richard Biener
On Thu, 5 Dec 2019, Richard Biener wrote: > > After the PR92818 commit there's one function in the testcase below > remaining not using bit-inserts. The following fixes this. > > Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. Committed with the follo

[PATCH] Improve *-match.c debugging

2019-12-06 Thread Richard Biener
contain enough information here. Bootstrapped on x86_64-unknown-linux-gnu, applied. Richard. 2019-12-06 Richard Biener * genmatch.c (c_expr::gen_transform): Emit newlines from line number changes rather than after every semicolon. Index:

Re: [PATCH] Some further match.pd optimizations with nop_convert (PR tree-optimization/92734)

2019-12-06 Thread Richard Biener
On Thu, Dec 5, 2019 at 4:16 PM Richard Biener wrote: > > On December 5, 2019 2:03:24 PM GMT+01:00, Marc Glisse > wrote: > >On Wed, 4 Dec 2019, Jakub Jelinek wrote: > > > >> --- gcc/match.pd.jj 2019-12-03 10:20:00.244913801 +0100 > >> +++ gcc/match.pd

Re: [PATCH] Some further match.pd optimizations with nop_convert (PR tree-optimization/92734)

2019-12-06 Thread Richard Biener
On Fri, 6 Dec 2019, Richard Biener wrote: > On Thu, Dec 5, 2019 at 4:16 PM Richard Biener wrote: > > > > On December 5, 2019 2:03:24 PM GMT+01:00, Marc Glisse > > wrote: > > >On Wed, 4 Dec 2019, Jakub Jelinek wrote: > > > > > >> --- g

Re: Avoid quadratic behaviour in prune_runtime_alias_test_list

2019-12-06 Thread Richard Biener
On Fri, Dec 6, 2019 at 9:36 AM Richard Sandiford wrote: > > prune_runtime_alias_test_list used ordered_remove to remove a merged > alias pair, which made the function quadratic when many aliases could > be removed. > > I had a testcase in which these memmoves accounted for an impressive > 85% of c

Re: [PATCH] Some further match.pd optimizations with nop_convert (PR tree-optimization/92734)

2019-12-06 Thread Richard Biener
On Fri, 6 Dec 2019, Marc Glisse wrote: > On Fri, 6 Dec 2019, Richard Biener wrote: > > >>> nop_convert sees that 'a' comes from a conversion, and only returns d > >>> (unlike 'convert?' which would try both a and d). > > Maybe I should

Re: [PATCH] Some further match.pd optimizations with nop_convert (PR tree-optimization/92734)

2019-12-06 Thread Richard Biener
On Fri, 6 Dec 2019, Richard Biener wrote: > On Fri, 6 Dec 2019, Marc Glisse wrote: > > > On Fri, 6 Dec 2019, Richard Biener wrote: > > > > >>> nop_convert sees that 'a' comes from a conversion, and only returns d > > >>> (unlike 'c

Re: [PATCH 09/49] gimple const-correctness fixes

2019-12-06 Thread Richard Biener
On Sat, Nov 16, 2019 at 2:20 AM David Malcolm wrote: > > This patch converts various "gimple *" to "const gimple *" and similar > fixes for gimple subclasses, adding is_a_helper for gimple subclasses > to support the const form of as_a, and adding a few "const" overloads > of accessors. > > This i

Re: [PATCH] Enable ICE-after-error with -fchecking

2019-12-08 Thread Richard Biener
On Fri, 6 Dec 2019, Segher Boessenkool wrote: > On Wed, Dec 04, 2019 at 05:26:25PM +0100, Jakub Jelinek wrote: > > I'd fear people will use -fchecking and feel error-recovery bugs are then > > more important because they no longer get the more user friendly message. > > Can't we arrange for the em

Re: [PATCH] Allow entry point markers without debug support in accelerator compiler

2019-12-09 Thread Richard Biener
On Fri, Dec 6, 2019 at 6:27 PM Kwok Cheung Yeung wrote: > > Hello > > A number of the libgomp tests running with AMD GCN offloading fail with > the following internal compiler error: > > during RTL pass: final > /scratch/ci-cs/amdtest/upstream-offload/src/gcc-mainline/libgomp/testsuite/libgomp.for

Re: [PATCH 00/49] RFC: Add a static analysis framework to GCC

2019-12-09 Thread Richard Biener
On Fri, Dec 6, 2019 at 11:31 PM Jeff Law wrote: > > On Wed, 2019-12-04 at 12:55 -0700, Martin Sebor wrote: > > On 11/15/19 6:22 PM, David Malcolm wrote: > > > This patch kit introduces a static analysis pass for GCC that can > > > diagnose > > > various kinds of problems in C code at compile-time

Re: [patch, fortran] Introduce -finline-pack

2019-12-09 Thread Richard Biener
On Sat, Dec 7, 2019 at 2:53 PM Thomas Koenig wrote: > > Hello world, > > the attached patch introduces a new option, -finline-pack. > > Since the fix for PR88821, we now do inline packing of > arguments (if required) via the scalarizer, instead of > using _gfortran_internal_[un]pack when optimizin

Re: [PATCH 09/49] gimple const-correctness fixes

2019-12-09 Thread Richard Biener
On Sat, Dec 7, 2019 at 3:28 PM Jeff Law wrote: > > On Fri, 2019-11-15 at 20:22 -0500, David Malcolm wrote: > > This patch converts various "gimple *" to "const gimple *" and > > similar > > fixes for gimple subclasses, adding is_a_helper for gimple subclasses > > to support the const form of as_a,

Re: [PATCH 09/49] gimple const-correctness fixes

2019-12-09 Thread Richard Biener
On Fri, Dec 6, 2019 at 6:47 PM David Malcolm wrote: > > On Fri, 2019-12-06 at 11:52 +0100, Richard Biener wrote: > > On Sat, Nov 16, 2019 at 2:20 AM David Malcolm > > wrote: > > > This patch converts various "gimple *" to "const gimple *" and

Re: [PATCH] Canonicalize fancy ways of expressing blend operation into COND_EXPR (PR tree-optimization/92834)

2019-12-09 Thread Richard Biener
long > +smax4 (long long a, long long b) > +{ > + return a + ((b - a) & -(a <= b)); > +} > + > +static inline long long > +smin4 (long long a, long long b) > +{ > + return a + ((b - a) & -(a >= b)); > +} > + > +void > +test (unsigned *x, int *y, unsigned long long *z, long long *w) > +{ > + x[2] = umax1 (x[0], x[1]); > + x[5] = umin1 (x[2], x[3]); > + y[2] = smax1 (y[0], y[1]); > + y[5] = smin1 (y[2], y[3]); > + z[2] = umax2 (z[0], z[1]); > + z[5] = umin2 (z[2], z[3]); > + w[2] = smax2 (w[0], w[1]); > + w[5] = smin2 (w[2], w[3]); > + x[8] = umax3 (x[6], x[7]); > + x[11] = umin3 (x[9], x[10]); > + y[8] = smax3 (y[6], y[7]); > + y[11] = smin3 (y[9], y[10]); > + z[8] = umax4 (z[6], z[7]); > + z[11] = umin4 (z[9], z[10]); > + w[8] = smax4 (w[6], w[7]); > + w[11] = smin4 (w[9], w[10]); > +} > > Jakub > > -- Richard Biener SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany; GF: Felix Imendörffer; HRB 36809 (AG Nuernberg)

Re: introduce -fcallgraph-info option

2019-12-09 Thread Richard Biener
T_BIT_BUCKET) != 0) > - /* AUX_BASE_NAME is set and is not the bit bucket. If it > -contains a directory component, prepend those directories. > -Typically this places things in the same directory as the > -object file. */ > - { > - const char *aux_base; &

Re: [patch] Fix ICE on VLA in LTO mode

2019-12-09 Thread Richard Biener
On Mon, Dec 9, 2019 at 1:23 PM Eric Botcazou wrote: > > Hi, > > this is a regression present on the mainline and 9 branch: the compiler gives > an ICE for the attached Ada testcase on the following assertion: > > if (DECL_P (ref)) > { > /* We shouldn't have true variables h

Re: Add missing conversion in vect_create_epilog_for_reduction

2019-12-10 Thread Richard Biener
On December 10, 2019 12:39:53 PM GMT+01:00, Richard Sandiford wrote: >The direct_slp_reduc code in vect_create_epilog_for_reduction was >still assuming that all types involved in a reduction are the same >(up to types_compatible_p), whereas we now support differences in >sign. This was causing a

Re: Fix EXTRACT_LAST_REDUCTION handling of pattern stmts

2019-12-10 Thread Richard Biener
On December 10, 2019 12:28:24 PM GMT+01:00, Richard Sandiford wrote: >Unlike most vector ops, extract-last reductions replace the original >scalar code in-situ rather than adding an adjacent vector >implementation. >I.e.: > > dest_1 = COND_EXPR <...>; > >becomes: > > dest_1 = .EXTRACT_LAST (.

Re: Record the loop masks needed for EXTRACT_LAST_REDUCTIONs

2019-12-10 Thread Richard Biener
On December 10, 2019 12:34:33 PM GMT+01:00, Richard Sandiford wrote: >The analysis phase of vectorizable_condition wasn't recording the >loop masks needed by the transform phase. This meant that the masks >wouldn't be created in the (rare) case that no other statement needed >them. > >Tested on

Re: Make dwarf2out punt for MODE_VECTOR_BOOL

2019-12-10 Thread Richard Biener
On December 10, 2019 12:44:01 PM GMT+01:00, Richard Sandiford wrote: >The dwarf2 handling of vector constants currently divides the vector >into a length (number of elements) and byte element size. This doesn't >work well for MODE_VECTOR_BOOL, where several elements are packed into >the same byt

Re: [testsuite][arm] Remove xfail for vect-epilogues test

2019-12-11 Thread Richard Biener
On December 11, 2019 12:27:31 PM GMT+01:00, "Andre Vieira (lists)" wrote: >Hi, > >We can now vectorize an epilogue for this loop for arm too, so removing > >xfail. > >Is this OK for trunk? Wasn't entirely sure whether I could commit this >under obvious. Sure. Richard. >gcc/testsuite/ChangeL

Re: [PATCH] Fix simplify-rtx.c handling of avx512 vector comparisons (PR target/92908)

2019-12-12 Thread Richard Biener
On December 12, 2019 12:56:01 AM GMT+01:00, Jakub Jelinek wrote: >Hi! > >The AVX512{F,VL} vector comparisons that set %kN registers are >represented >in RTL as comparisons with vector mode operands and scalar integral >result, >where at runtime the scalar integer is filled with a bitmask. >Unfort

Re: AW: [PATCH] m68k architecture: support ccmode + lra

2019-12-12 Thread Richard Biener
On December 12, 2019 7:43:58 AM GMT+01:00, Stefan Franke wrote: >Am 2019-12-08 01:54, schrieb Oleg Endo: >> On Tue, 2019-11-26 at 07:38 +0100, ste...@franke.ms wrote: >>> > On 11/21/19 10:30 AM, ste...@franke.ms wrote: >>> > > Hi there, >>> > > >>> > > here is mc68k's patch to switch the m68k arc

Re: [PATCH] Fix simplify-rtx.c handling of avx512 vector comparisons (PR target/92908)

2019-12-12 Thread Richard Biener
On December 12, 2019 10:53:26 AM GMT+01:00, Jakub Jelinek wrote: >On Thu, Dec 12, 2019 at 09:22:47AM +, Richard Sandiford wrote: >> > So there's no whole vector equality RTX but we have to pun to >integer >> > modes for that? The eq:SImode would suggest that. Guess we should >have >> > used

Re: Add a compatible_vector_types_p target hook

2019-12-12 Thread Richard Biener
On December 12, 2019 4:10:33 PM GMT+01:00, Richard Sandiford wrote: >One problem with adding an N-bit vector extension to an existing >architecture is to decide how N-bit vectors should be passed to >functions and returned from functions. Allowing all N-bit vector >types to be passed in register

Re: Add a compatible_vector_types_p target hook

2019-12-12 Thread Richard Biener
On December 12, 2019 5:44:25 PM GMT+01:00, Richard Sandiford wrote: >Richard Biener writes: >> On December 12, 2019 4:10:33 PM GMT+01:00, Richard Sandiford > wrote: >>>One problem with adding an N-bit vector extension to an existing >>>architecture is to deci

Re: [PATCH] Fix simplify-rtx.c handling of avx512 vector comparisons (PR target/92908)

2019-12-13 Thread Richard Biener
On December 13, 2019 12:54:08 AM GMT+01:00, Jakub Jelinek wrote: >On Thu, Dec 12, 2019 at 04:59:40PM +0100, Richard Biener wrote: >> >If it starts being ambiguous somewhere, could we use some target >macro >> >or >> >target hook to decide? >> >> A

Re: Add a compatible_vector_types_p target hook

2019-12-13 Thread Richard Biener
On December 12, 2019 7:15:36 PM GMT+01:00, Richard Sandiford wrote: >Richard Biener writes: >> On December 12, 2019 5:44:25 PM GMT+01:00, Richard Sandiford > wrote: >>>Richard Biener writes: >>>> On December 12, 2019 4:10:33 PM GMT+01:00, Richard Sandiford

Re: AW: [PATCH] m68k architecture: support ccmode + lra

2019-12-13 Thread Richard Biener
On December 13, 2019 12:03:30 PM GMT+01:00, Segher Boessenkool wrote: >On Thu, Dec 12, 2019 at 09:32:27AM +, Richard Sandiford wrote: >> I doubt it will be long before we deprecate >> all targets that require old reload.) > >Do we wait until GCC 12 (to remove old reload completely)? If not,

Re: Add a compatible_vector_types_p target hook

2019-12-13 Thread Richard Biener
On December 13, 2019 10:12:40 AM GMT+01:00, Richard Sandiford wrote: >Richard Biener writes: >>>>>The AArch64 port emits an error if calls pass values of SVE type to >>>an >>>>>unprototyped function. To do that we need to know whether the >value

Re: [PATCH] Fix PR70985

2019-12-13 Thread Richard Biener
On December 14, 2019 6:28:48 AM GMT+01:00, Andrew Pinski wrote: >On Mon, May 9, 2016 at 2:32 AM Richard Biener >wrote: >> >> >> I am testing the following followup to my BIT_FIELD_REF >simplification >> changes which resolve issues when applying to memory BI

Re: [PATCH] Fix ipa_fn_summary_write for offloading LTO streaming (PR ipa/92357)

2019-12-14 Thread Richard Biener
On December 14, 2019 10:11:33 AM GMT+01:00, Jakub Jelinek wrote: >Hi! > >As discussed on IRC and in the PR, we get an ICE during >inline_read_section >in the offloading lto1, because the size of streamed out and expected >to be >streamed in data doesn't match. This happens on the testcase from t

Re: [PATCH] Fix up handling of __builtin_apply in ipa-pure-const (PR tree-optimization/92930)

2019-12-14 Thread Richard Biener
On December 14, 2019 9:21:21 AM GMT+01:00, Jakub Jelinek wrote: >Hi! > >__builtin_apply calls some other function, so whether it is const, pure >or >none of that, whether it can throw or not etc. depends on whether that >called function is const or pure or none of that, whether it can throw >etc.

Re: Add a compatible_vector_types_p target hook

2019-12-14 Thread Richard Biener
On December 14, 2019 11:43:48 AM GMT+01:00, Richard Sandiford wrote: >Richard Biener writes: >> On December 13, 2019 10:12:40 AM GMT+01:00, Richard Sandiford > wrote: >>>Richard Biener writes: >>>>>>>The AArch64 port emits an error if

Re: [PATCH] Avoid suspicious -Wduplicate-branches warning in lto-wrapper.c (PR lto/92972)

2019-12-18 Thread Richard Biener
On December 17, 2019 9:43:26 PM GMT+01:00, Jakub Jelinek wrote: >Hi! > >big ? "-fno-pie" : "-fno-pie" doesn't make much sense, either we want >to >use big ? "-fno-PIE" : "-fno-pie", but as both mean the same thing, I >think >just using "-fno-pie" is good enough. + a few formatting nits and one >

Re: [modulo-sched][PATCH] Fix PR92591

2019-12-18 Thread Richard Biener
On December 17, 2019 8:40:59 PM GMT+01:00, Roman Zhuykov wrote: >Hello. > >> As pointed out in the PR >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92591#c1, the test can >be >> fixed by DFA-checking more adjacent row sequences in the partial >> schedule. >> I've found that on powerpc64 gcc.c-t

Re: [PATCH 1/4] Add verification of SRA accesses

2019-12-18 Thread Richard Biener
On December 17, 2019 1:40:47 PM GMT+01:00, Martin Jambor wrote: >Hi, > >because the follow-up patches perform some non-trivial operations on >SRA patches, I wrote myself a verifier. And sure enough, it has >spotted two issues, one of which is fixed in this patch too - we did >not correctly set t

Re: [PATCH 3/4] Also propagate SRA accesses from LHS to RHS (PR 92706)

2019-12-18 Thread Richard Biener
On December 17, 2019 1:43:15 PM GMT+01:00, Martin Jambor wrote: >Hi, > >the previous patch unfortunately does not fix the first testcase in PR >92706 and since I am afraid it might be the important one, I also >focused on that. The issue here is again total scalarization accesses >clashing with

Re: [PATCH PR92926]Fix wrong code caused by ctor node translation unit wide sharing

2019-12-19 Thread Richard Biener
On December 20, 2019 2:13:47 AM GMT+01:00, "Bin.Cheng" wrote: >On Fri, Dec 13, 2019 at 11:26 AM bin.cheng > wrote: >> >> Hi, >> >> As reported in PR92926, constant ctor is shared translation unit wide >because of constexpr_call_table, >> however, during gimplify, the shared ctor could be modified

Re: Add missing target check for fully-masked fold-left reductions

2019-12-27 Thread Richard Biener
On December 27, 2019 5:02:55 PM GMT+01:00, Richard Sandiford wrote: >The fold-left reduction code has a (rarely-used) fallback that handles >cases in which the loop is fully-masked and the target has no native >support for the reduction. The fallback includea a VEC_COND_EXPR >between the reducti

Re: Check for a supported comparison when using EXTRACT_LAST_REDUCTION

2019-12-28 Thread Richard Biener
On December 28, 2019 5:29:20 PM GMT+01:00, Richard Sandiford wrote: >The EXTRACT_LAST_REDUCTION handling needs to generate a separate >comparison instruction that feeds the vector mask argument of the >IFN_EXTRACT_LAST call. We weren't checking whether that comparison >was supported, leading to

Re: Unshare DR_STEP before gimplifying it

2019-12-28 Thread Richard Biener
On December 28, 2019 5:31:20 PM GMT+01:00, Richard Sandiford wrote: >In this testcase we use an unmasked SVE loop with an Advanced SIMD >epilogue (because we don't yet support fully-masked downward loops). >The main loop uses a gather load for the strided access while the >epilogue loop builds th

Re: Fix SSA update when vectorisation adds a vdef to a read-only loop

2019-12-30 Thread Richard Biener
On December 30, 2019 3:15:14 PM GMT+01:00, Richard Sandiford wrote: >This patch fixes an awkward corner case in which: > >(a) we apply if-conversion to a loop; > >(b) the original scalar loop doesn't have a vdef, and thus doesn't >need a virtual phi; > >(c) the vectorised main loop does need

Re: [PATCH] popcount{64,32}c pattern matching fixes (PR tree-optimization/93098)

2019-12-31 Thread Richard Biener
On December 31, 2019 12:00:56 PM GMT+01:00, Jakub Jelinek wrote: >Hi! > >This patch fixes various issues in the popcount{64,32}c matcher. > >The first issue is that it blindly uses tree_to_uhwi on all the >INTEGER_CST >operands. That is fine for those where we know their type, after the >prec <=

Re: [testsuite][arm] Remove xfail for vect-epilogues test

2020-01-06 Thread Richard Biener
; >> > >>> gcc/testsuite/ChangeLog: > >>> > >>> 2019-12-12  Andre Vieira  > >>> > >>> * gcc.dg/vect/vect-epilogues.c: XFAIL for arm big endian. > >>> * lib/target-supports.exp > >>> (check_effe

<    8   9   10   11   12   13   14   15   16   17   >