[PATCH] [v4][aarch64] Avoid tag collisions for loads falkor

2018-07-24 Thread Siddhesh Poyarekar
Hi, This is a rewrite of the tag collision avoidance patch that Kugan had written as a machine reorg pass back in February. The falkor hardware prefetching system uses a combination of the source, destination and offset to decide which prefetcher unit to train with the load. This is great when

[PATCH] Make strlen range computations more conservative

2018-07-24 Thread Bernd Edlinger
Hi! This patch makes strlen range computations more conservative. Firstly if there is a visible type cast from type A to B before passing then value to strlen, don't expect the type layout of B to restrict the possible return value range of strlen. Furthermore use the outermost enclosing array

[PATCH] Introduce __builtin_expect_with_probability (PR target/83610).

2018-07-24 Thread Martin Liška
Hi. This is implementation of new built-in that can be used for more fine tweaking of probability. Micro benchmark is attached as part of the PR. Patch can bootstrap on ppc64le-redhat-linux and survives regression tests. Ready to be installed? Martin gcc/ChangeLog: 2018-07-24 Martin Liska

Re: [Patch-86512]: Subnormal float support in armv7(with -msoft-float) for intrinsics

2018-07-24 Thread Umesh Kalappa
Thank you All for the suggestions and we tried runing the GCC testsuite and found that no regression with the fix and also ran the our regressions base for conformance with no regress. Is ok for commit with below Changelog ? +++ libgcc/ChangeLog(working copy) @@ -1,3 +1,9 @@ +2018-07-18

[PATCH] Limix dump_flag enum values range (PR middle-end/86645).

2018-07-24 Thread Martin Liška
Hi. That fixes many UBSAN issues that are caused by: {"all", dump_flags_t (~(TDF_RAW | TDF_SLIM | TDF_LINENO | TDF_GRAPH | TDF_STMTADDR | TDF_RHS_ONLY | TDF_NOUID | TDF_ENUMERATE_LOCALS | TDF_SCEV | TDF_GIMPLE))}, That goes out of: minv =

[PATCH] Fix expand_divmod (PR middle-end/86627)

2018-07-24 Thread Jakub Jelinek
Hi! As the following testcase shows, expand_divmod stopped emitting int128 signed divisions by positive small (fitting into hwi) power of two constants in my r242690 aka PR78416 fix, where I've added next to EXACT_POWER_OF_2_OR_ZERO_P uses a check that either the bitsize is smaller or equal to

[PATCH] gcov: Fix wrong usage of NAN in statistics (PR gcov-profile/86536).

2018-07-24 Thread Martin Liška
Hi. We have situations where a branch can return more often than called (fork). Thus I decided to rapidly simplify format_gcov and print ratios that are provided. No extra values are handled now. Patch can bootstrap on ppc64le-redhat-linux and survives regression tests. If no objections, I'll

Avoid _VINFO_MASKS for bb vectorisation (PR 86618)

2018-07-24 Thread Richard Sandiford
r262589 introduced another instance of the bug fixed in r258131. Tested on aarch64-linux-gnu and applied as obvious. Richard 2018-07-24 Richard Sandiford gcc/ PR tree-optimization/86618 * tree-vect-stmts.c (vectorizable_call): Don't take the address of

Re: [RFC 2/3, debug] Add fkeep-vars-live

2018-07-24 Thread Alexandre Oliva
On Jul 24, 2018, Tom de Vries wrote: > This patch adds fake uses of user variables at the point where they go out of > scope, to keep user variables inspectable throughout the application. I suggest also adding such uses before sets, so that variables aren't regarded as dead and get optimized

[Patch] [Aarch64] PR 86538 - Define __ARM_FEATURE_LSE if LSE is available

2018-07-24 Thread Steve Ellcey
This is a patch for PR 86538, to define an __ARM_FEATURE_LSE macro when LSE is available.  Richard Earnshaw closed PR 86538 as WONTFIX because the ACLE (Arm C Language Extension) does not require this macro and because he is concerned that it might encourage people to use inline assembly instead

Re: [5/5] C-SKY port: libgcc

2018-07-24 Thread Segher Boessenkool
On Mon, Jul 23, 2018 at 10:26:35PM -0600, Sandra Loosemore wrote: > diff --git a/libgcc/config.host b/libgcc/config.host > index 18cabaf..b2ee0c9 100644 > --- a/libgcc/config.host > +++ b/libgcc/config.host > @@ -94,6 +94,9 @@ am33_2.0-*-linux*) > arc*-*-*) > cpu_type=arc > ;; >

Re: [PATCH][GCC][front-end][build-machinery][opt-framework] Allow setting of stack-clash via configure options. [Patch (4/6)]

2018-07-24 Thread Alexandre Oliva
Hello, Christina, On Jul 24, 2018, Tamar Christina wrote: > gcc/ > 2018-07-24 Tamar Christina > PR target/86486 > * configure.ac: Add stack-clash-protection-guard-size. > * doc/install.texi: Document it. > * config.in (DEFAULT_STK_CLASH_GUARD_SIZE): New. > *

Fix ceil_log2(0) (PR 86644)

2018-07-24 Thread Richard Sandiford
This PR shows a pathological case in which we try SLP vectorisation on dead code. We record that 0 bits of the result are enough to satisfy all users (which is true), and that led to precision being 0 in: static unsigned int vect_element_precision (unsigned int precision) { precision = 1 <<

Re: [PATCH] Introduce instance discriminators

2018-07-24 Thread Alexandre Oliva
On Jul 19, 2018, Richard Biener wrote: > Oh, that probably wasn't omitted on purpose. Cary said it was used > for profiling but I can't see any such use. > Is the instance discriminator stuff also used for profiling? Not that I know, but... I probably wouldn't know yet ;-) Anyway, it was

Re: [RFC 1/3, debug] Add fdebug-nops

2018-07-24 Thread Alexandre Oliva
On Jul 24, 2018, Tom de Vries wrote: > There's a design principle in GCC that code generation and debug generation > are independent. This guarantees that if you're encountering a problem in an > application without debug info, you can recompile it with -g and be certain > that you can

Re: committed: remove redundant -Wall from -Warray-bounds (PR 82063)

2018-07-24 Thread Franz Sirl
Am 2018-07-24 um 17:35 schrieb Martin Sebor: On 07/24/2018 03:24 AM, Franz Sirl wrote: Am 2018-07-20 um 23:22 schrieb Martin Sebor: As the last observation in PR 82063 Jim points out that    Both -Warray-bounds and -Warray-bounds= are listed in the c.opt    file as being enabled by -Wall, but

Re: committed: remove redundant -Wall from -Warray-bounds (PR 82063)

2018-07-24 Thread Martin Sebor
On 07/24/2018 01:48 PM, Franz Sirl wrote: Am 2018-07-24 um 17:35 schrieb Martin Sebor: On 07/24/2018 03:24 AM, Franz Sirl wrote: Am 2018-07-20 um 23:22 schrieb Martin Sebor: As the last observation in PR 82063 Jim points out that Both -Warray-bounds and -Warray-bounds= are listed in the

Re: [PATCH] fix a couple of bugs in const string folding (PR 86532)

2018-07-24 Thread Martin Sebor
On 07/20/2018 04:20 AM, Richard Biener wrote: On Thu, 19 Jul 2018, Martin Sebor wrote: Here's one more update with tweaks addressing a couple more of Bernd's comments: 1) correct the use of TREE_STRING_LENGTH() where a number of array elements is expected and not bytes 2) set CHARTYPE as soon

Re: [2/5] C-SKY port: Backend implementation

2018-07-24 Thread Sandra Loosemore
On 07/24/2018 09:45 AM, Jeff Law wrote: On 07/23/2018 10:21 PM, Sandra Loosemore wrote: 2018-07-23  Jojo      Huibin Wang      Sandra Loosemore      Chung-Lin Tang      C-SKY port: Backend implementation     gcc/     * config/csky/*: New.    

Re: [5/5] C-SKY port: libgcc

2018-07-24 Thread Sandra Loosemore
On 07/24/2018 12:10 PM, Segher Boessenkool wrote: On Mon, Jul 23, 2018 at 10:26:35PM -0600, Sandra Loosemore wrote: diff --git a/libgcc/config.host b/libgcc/config.host index 18cabaf..b2ee0c9 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -94,6 +94,9 @@ am33_2.0-*-linux*)

Re: [PATCH] include more detail in -Warray-bounds (PR 86650)

2018-07-24 Thread Martin Sebor
On 07/24/2018 11:05 AM, David Malcolm wrote: On Mon, 2018-07-23 at 20:56 -0600, Martin Sebor wrote: On 07/23/2018 07:20 PM, David Malcolm wrote: On Mon, 2018-07-23 at 17:49 -0600, Martin Sebor wrote: (David, I'm hoping your your help here. Please see the end.) While looking into a recent

Re: [5/5] C-SKY port: libgcc

2018-07-24 Thread Segher Boessenkool
On Tue, Jul 24, 2018 at 12:19:30PM -0600, Sandra Loosemore wrote: > On 07/24/2018 12:10 PM, Segher Boessenkool wrote: > >On Mon, Jul 23, 2018 at 10:26:35PM -0600, Sandra Loosemore wrote: > >>diff --git a/libgcc/config.host b/libgcc/config.host > >>index 18cabaf..b2ee0c9 100644 > >>---

[PATCH] Fix a missing case of PR 21458 similar to fc6141f097056f830a412afebed8d81a9d72b696.

2018-07-24 Thread Robert Schiele
The original fix for PR 21458 was causing some issues, which were addressed to be fixed with a follow-up fix fc6141f097056f830a412afebed8d81a9d72b696. Unfortunately that follow-up fix missed one case, which is handled by this fix. Change-Id: Ie32e3f2514b3e4b6b35c0a693de6b65ef010bb9d ---

[01/46] Move special cases out of get_initial_def_for_reduction

2018-07-24 Thread Richard Sandiford
This minor clean-up avoids repeating the test for double reductions and also moves the vect_get_vec_def_for_operand call to the same function as the corresponding vect_get_vec_def_for_stmt_copy. 2018-07-24 Richard Sandiford gcc/ * tree-vect-loop.c (get_initial_def_for_reduction):

[00/46] Remove vinfo_for_stmt etc.

2018-07-24 Thread Richard Sandiford
The aim of this series is to: (a) make the vectoriser refer to statements using its own expanded stmt_vec_info rather than the underlying gimple stmt. This reduces the number of stmt lookups from 480 in current sources to under 100. (b) make the remaining lookups relative the owning

[06/46] Add vec_info::add_stmt

2018-07-24 Thread Richard Sandiford
This patch adds a vec_info function for allocating and setting stmt_vec_infos. It's the start of a long process of removing the global stmt_vec_info array. 2018-07-24 Richard Sandiford gcc/ * tree-vectorizer.h (stmt_vec_info): Move typedef earlier in file.

[07/46] Add vec_info::lookup_stmt

2018-07-24 Thread Richard Sandiford
This patch adds a vec_info replacement for vinfo_for_stmt. The main difference is that the new routine can cope with arbitrary statements, so there's no need to call vect_stmt_in_region_p first. The patch only converts calls that are still needed at the end of the series. Later patches get rid

[02/46] Remove dead vectorizable_reduction code

2018-07-24 Thread Richard Sandiford
vectorizable_reduction has old code to cope with cases in which the given statement belongs to a reduction group but isn't the first statement. That can no longer happen, since all statements in the group go into the same SLP node, and we only check the first statement in each node. The point is

[03/46] Remove unnecessary update of NUM_SLP_USES

2018-07-24 Thread Richard Sandiford
vect_free_slp_tree had: gimple *stmt; FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (node), i, stmt) /* After transform some stmts are removed and thus their vinfo is gone. */ if (vinfo_for_stmt (stmt)) { gcc_assert (STMT_VINFO_NUM_SLP_USES (vinfo_for_stmt (stmt)) > 0);

[04/46] Factor out the test for a valid reduction input

2018-07-24 Thread Richard Sandiford
vect_is_slp_reduction and vect_is_simple_reduction had two instances each of: && (is_gimple_assign (def_stmt) || is_gimple_call (def_stmt) || STMT_VINFO_DEF_TYPE (vinfo_for_stmt (def_stmt)) == vect_induction_def

[05/46] Fix make_ssa_name call in vectorizable_reduction

2018-07-24 Thread Richard Sandiford
The usual vectoriser dance to create new assignments is: new_stmt = gimple_build_assign (vec_dest, ...); new_temp = make_ssa_name (vec_dest, new_stmt); gimple_assign_set_lhs (new_stmt, new_temp); but one site in vectorizable_reduction used: new_temp = make_ssa_name (vec_dest,

[20/46] Make *FIRST_ELEMENT and *NEXT_ELEMENT stmt_vec_infos

2018-07-24 Thread Richard Sandiford
This patch changes {REDUC,DR}_GROUP_{FIRST,NEXT} element from a gimple stmt to stmt_vec_info. 2018-07-24 Richard Sandiford gcc/ * tree-vectorizer.h (_stmt_vec_info::first_element): Change from a gimple stmt to a stmt_vec_info. (_stmt_vec_info::next_element): Likewise.

[18/46] Make SLP_TREE_SCALAR_STMTS a vec

2018-07-24 Thread Richard Sandiford
This patch changes SLP_TREE_SCALAR_STMTS from a vec to a vec. It's longer than the previous conversions but mostly mechanical. 2018-07-24 Richard Sandiford gcc/ * tree-vectorizer.h (_slp_tree::stmts): Change from a vec to a vec. * tree-vect-slp.c

[19/46] Make vect_dr_stmt return a stmt_vec_info

2018-07-24 Thread Richard Sandiford
This patch makes vect_dr_stmt return a stmt_vec_info instead of a gimple stmt. Rather than retain a separate gimple stmt variable in cases where both existed, the patch replaces uses of the gimple variable with the uses of the stmt_vec_info. Later patches do this more generally. Many things

[22/46] Make DR_GROUP_SAME_DR_STMT a stmt_vec_info

2018-07-24 Thread Richard Sandiford
This patch changes STMT_VINFO_SAME_DR_STMT from a gimple stmt to a stmt_vec_info. 2018-07-24 Richard Sandiford gcc/ * tree-vectorizer.h (_stmt_vec_info::same_dr_stmt): Change from a gimple stmt to a stmt_vec_info. * tree-vect-stmts.c (vectorizable_load): Update

[21/46] Make grouped_stores and reduction_chains use stmt_vec_infos

2018-07-24 Thread Richard Sandiford
This patch changes the SLP lists grouped_stores and reduction_chains from auto_vec to auto_vec. It was easier to do them together due to the way vect_analyze_slp is structured. 2018-07-24 Richard Sandiford gcc/ * tree-vectorizer.h (vec_info::grouped_stores): Change from an

[23/46] Make LOOP_VINFO_MAY_MISALIGN_STMTS use stmt_vec_info

2018-07-24 Thread Richard Sandiford
This patch changes LOOP_VINFO_MAY_MISALIGN_STMTS from an auto_vec to an auto_vec. 2018-07-24 Richard Sandiford gcc/ * tree-vectorizer.h (_loop_vec_info::may_misalign_stmts): Change from an auto_vec to an auto_vec. * tree-vect-data-refs.c

[40/46] Add vec_info::lookup_dr

2018-07-24 Thread Richard Sandiford
Previous patches got rid of a lot of calls to vect_dr_stmt. This patch replaces the remaining ones with calls to a new vec_info::lookup_dr function, so that the lookup is relative to a particular vec_info rather than to global state. 2018-07-24 Richard Sandiford gcc/ *

[41/46] Add vec_info::remove_stmt

2018-07-24 Thread Richard Sandiford
This patch adds a new helper function for permanently removing a statement and its associated stmt_vec_info. 2018-07-24 Richard Sandiford gcc/ * tree-vectorizer.h (vec_info::remove_stmt): Declare. * tree-vectorizer.c (vec_info::remove_stmt): New function. *

[43/46] Make free_stmt_vec_info take a stmt_vec_info

2018-07-24 Thread Richard Sandiford
This patch makes free_stmt_vec_info take the stmt_vec_info that it's supposed to free and makes it free only that stmt_vec_info. Callers need to update the statement mapping where necessary (but now there are only a couple of callers). This in turns means that we can leave ~vec_info to do the

[42/46] Add vec_info::replace_stmt

2018-07-24 Thread Richard Sandiford
This patch adds a helper for replacing a stmt_vec_info's statement with a new statement. 2018-07-24 Richard Sandiford gcc/ * tree-vectorizer.h (vec_info::replace_stmt): Declare. * tree-vectorizer.c (vec_info::replace_stmt): New function. * tree-vect-slp.c

[46/46] Turn stmt_vec_info back into a typedef

2018-07-24 Thread Richard Sandiford
This patch removes the stmt_vec_info wrapper class added near the beginning of the series and turns stmt_vec_info back into a typedef. 2018-07-24 Richard Sandiford gcc/ * tree-vectorizer.h (stmt_vec_info): Turn back into a typedef. (NULL_STMT_VEC_INFO): Delete.

RE: [PATCH][GCC][front-end][build-machinery][opt-framework] Allow setting of stack-clash via configure options. [Patch (4/6)]

2018-07-24 Thread tamar . christina
Hi Jeff, This patch defines a configure option to allow the setting of the default guard size via configure flags when building the target. The new flag is: * --with-stack-clash-protection-guard-size= The patch defines a new macro DEFAULT_STK_CLASH_GUARD_SIZE which targets need to use

Re: [PATCH] Fix up pr19476-{1,5}.C (PR testsuite/86649)

2018-07-24 Thread Jakub Jelinek
On Tue, Jul 24, 2018 at 12:08:35PM +0200, Richard Biener wrote: > OK - can you add a variant with -O2 that tests it at EVRP time then? Here is what I've committed to trunk then: 2018-07-24 Jakub Jelinek PR testsuite/86649 * g++.dg/tree-ssa-/pr19476-1.C: Check dom2 dump

Re: [RFC][debug] Add -fadd-debug-nops

2018-07-24 Thread Tom de Vries
On 07/16/2018 05:10 PM, Tom de Vries wrote: > On 07/16/2018 03:50 PM, Richard Biener wrote: >> On Mon, 16 Jul 2018, Tom de Vries wrote: >>> Any comments? >> >> Interesting idea. I wonder if that should be generalized >> to other places > > I kept the option name general, to allow for that. > >

[09/46] Add vec_info::lookup_single_use

2018-07-24 Thread Richard Sandiford
This patch adds a helper function for seeing whether there is a single user of an SSA name, and whether that user has a stmt_vec_info. 2018-07-24 Richard Sandiford gcc/ * tree-vectorizer.h (vec_info::lookup_single_use): Declare. * tree-vectorizer.c

[08/46] Add vec_info::lookup_def

2018-07-24 Thread Richard Sandiford
This patch adds a vec_info helper for checking whether an operand is an SSA_NAME that is defined in the vectorisable region. 2018-07-24 Richard Sandiford gcc/ * tree-vectorizer.h (vec_info::lookup_def): Declare. * tree-vectorizer.c (vec_info::lookup_def): New function.

[16/46] Make STMT_VINFO_REDUC_DEF a stmt_vec_info

2018-07-24 Thread Richard Sandiford
This patch changes STMT_VINFO_REDUC_DEF from a gimple stmt to a stmt_vec_info. 2018-07-24 Richard Sandiford gcc/ * tree-vectorizer.h (_stmt_vec_info::reduc_def): Change from a gimple stmt to a stmt_vec_info. * tree-vect-loop.c (vect_active_double_reduction_p)

[17/46] Make LOOP_VINFO_REDUCTIONS an auto_vec

2018-07-24 Thread Richard Sandiford
This patch changes LOOP_VINFO_REDUCTIONS from an auto_vec to an auto_vec. It also changes the associated vect_force_simple_reduction so that it takes and returns stmt_vec_infos instead of gimple stmts. 2018-07-24 Richard Sandiford gcc/ * tree-vectorizer.h

[15/46] Make SLP_TREE_VEC_STMTS a vec

2018-07-24 Thread Richard Sandiford
This patch changes SLP_TREE_VEC_STMTS from a vec to a vec. This involved making the same change to the phis vector in vectorizable_reduction, since SLP_TREE_VEC_STMTS is spliced into it here: phis.splice (SLP_TREE_VEC_STMTS (slp_node_instance->reduc_phis)); 2018-07-24 Richard Sandiford

[38/46] Pass stmt_vec_infos instead of data_references where relevant

2018-07-24 Thread Richard Sandiford
This patch makes various routines (mostly in tree-vect-data-refs.c) take stmt_vec_infos rather than data_references. The affected routines are really dealing with the way that an access is going to vectorised for a particular stmt_vec_info, rather than with the original scalar access described by

Re: [PATCH] Fix up pr19476-{1,5}.C (PR testsuite/86649)

2018-07-24 Thread Richard Biener
On Tue, 24 Jul 2018, Jakub Jelinek wrote: > Hi! > > When looking at PR86569 testresults, I must have missed these two tests > (but looking at test_summary outputs, I see it now). > When we no longer fold this during cp_fold (to avoid code generation > changes between -Wnonnull-compare and

[37/46] Associate alignment information with stmt_vec_infos

2018-07-24 Thread Richard Sandiford
Alignment information is really a property of a stmt_vec_info (and the way we want to vectorise it) rather than the original scalar dr. I think that was true even before the recent dr sharing. This patch therefore makes the alignment-related interfaces take stmt_vec_infos rather than

[39/46] Replace STMT_VINFO_UNALIGNED_DR with the associated statement

2018-07-24 Thread Richard Sandiford
After previous changes, it makes more sense to record which stmt's access is going to be aligned via peeling, rather than the associated scalar data reference. 2018-07-24 Richard Sandiford gcc/ * tree-vectorizer.h (_loop_vec_info::unaligned_dr): Replace with...

[36/46] Add a pattern_stmt_p field to stmt_vec_info

2018-07-24 Thread Richard Sandiford
This patch adds a pattern_stmt_p field to stmt_vec_info, so that it's possible to tell whether the statement is a pattern statement without referring to other statements. The new field goes in what was previously a hole in the structure, so the size is the same as before. 2018-07-24 Richard

Re: [PATCH][debug] Handle references to skipped params in remap_ssa_name

2018-07-24 Thread Tom de Vries
On 07/19/2018 10:30 AM, Richard Biener wrote: > On Wed, Jul 18, 2018 at 3:42 PM Tom de Vries wrote: >> >> On 07/06/2018 12:28 PM, Richard Biener wrote: >>> On Thu, Jul 5, 2018 at 4:12 PM Tom de Vries wrote: On 07/05/2018 01:39 PM, Richard Biener wrote: > On Thu, Jul 5, 2018 at 1:25

RE: [PATCH][GCC][front-end][opt-framework] Update options framework for parameters to properly handle and validate configure time params. [Patch (2/3)]

2018-07-24 Thread tamar . christina
Hi All, This patch is re-spun to handle the configure changes in patch 4 / 6 of the previous series. This patch now changes it so that default parameters are validated during initialization. This change is needed to ensure parameters set via by the target specific common initialization routines

[C PATCH] Fix endless loop in the C FE initializer handling (PR c/85704)

2018-07-24 Thread Jakub Jelinek
Hi! Starting with r258497 aka PR46921 fix the C FE can loop forever in initializers where a zero length field's initializer has side-effects (in this testcase merely because it is a compound literal) and that zero length field is followed by some other fields. Previously, we'd throw initializers

Re: [Patch, Fortran] PR 57160: short-circuit IF only with -ffrontend-optimize

2018-07-24 Thread Dominique d'Humières
Hi Janus, > gfortran currently does short-circuiting, and after my patch for PR > 85599 warns about cases where this might remove an impure function > call (which potentially can change results). > > Now, this PR (57160) is about code which relies on the > short-circuiting behavior. Since

Re: committed: remove redundant -Wall from -Warray-bounds (PR 82063)

2018-07-24 Thread Franz Sirl
Am 2018-07-20 um 23:22 schrieb Martin Sebor: As the last observation in PR 82063 Jim points out that   Both -Warray-bounds and -Warray-bounds= are listed in the c.opt   file as being enabled by -Wall, but they are the same option,   and it causes this one option to be processed twice in the

[13/46] Make STMT_VINFO_RELATED_STMT a stmt_vec_info

2018-07-24 Thread Richard Sandiford
This patch changes STMT_VINFO_RELATED_STMT from a gimple stmt to a stmt_vec_info. 2018-07-24 Richard Sandiford gcc/ * tree-vectorizer.h (_stmt_vec_info::related_stmt): Change from a gimple stmt to a stmt_vec_info. (is_pattern_stmt_p): Update accordingly. *

[12/46] Make vect_finish_stmt_generation return a stmt_vec_info

2018-07-24 Thread Richard Sandiford
This patch makes vect_finish_replace_stmt and vect_finish_stmt_generation return the stmt_vec_info for the vectorised statement, so that the caller doesn't need a separate vinfo_for_stmt to get at it. This involved changing the structure of the statement-generating loops so that they use narrow

[14/46] Make STMT_VINFO_VEC_STMT a stmt_vec_info

2018-07-24 Thread Richard Sandiford
This patch changes STMT_VINFO_VEC_STMT from a gimple stmt to a stmt_vec_info and makes the vectorizable_* routines pass back a stmt_vec_info to vect_transform_stmt. 2018-07-24 Richard Sandiford gcc/ * tree-vectorizer.h (_stmt_vec_info::vectorized_stmt): Change from a gimple

Re: [PATCH] Fix a missing case of PR 21458 similar to fc6141f097056f830a412afebed8d81a9d72b696.

2018-07-24 Thread Robert Schiele
On Tue, Jul 24, 2018 at 11:05 AM Kyrill Tkachov wrote: > Patches to gas should be sent to the binutils list: binut...@sourceware.org > rather than gcc-patches. That indeed is a very good point and I'd like to express my apologies for that. Obviously I did too many things at one point in time

[34/46] Alter interface to vect_get_vec_def_for_stmt_copy

2018-07-24 Thread Richard Sandiford
This patch makes vect_get_vec_def_for_stmt_copy take a vec_info rather than a vect_def_type. If the vector operand passed in is defined in the vectorised region, we should look for copies in the normal way. If it's defined in an external statement (such as by vect_init_vector_1) we should just

[32/46] Use stmt_vec_info in function interfaces (part 2)

2018-07-24 Thread Richard Sandiford
This second part handles the mechanical change from a gimple stmt argument to a stmt_vec_info argument. It updates the function comments if they referred to the argument by name, but it doesn't try to retrofit mentions to other functions. 2018-07-24 Richard Sandiford gcc/ *

[31/46] Use stmt_vec_info in function interfaces (part 1)

2018-07-24 Thread Richard Sandiford
This first (less mechanical) part handles cases that involve changes in the callers or non-trivial changes in the functions themselves. 2018-07-24 Richard Sandiford gcc/ * tree-vect-data-refs.c (vect_describe_gather_scatter_call): Take a stmt_vec_info instead of a gcall.

[35/46] Alter interfaces within vect_pattern_recog

2018-07-24 Thread Richard Sandiford
vect_pattern_recog_1 took a gimple_stmt_iterator as argument, but was only interested in the gsi_stmt, not anything else. This patch makes the associated routines operate directly on stmt_vec_infos. 2018-07-24 Richard Sandiford gcc/ * tree-vect-patterns.c (vect_mark_pattern_stmts):

[33/46] Use stmt_vec_infos instead of vec_info/gimple stmt pairs

2018-07-24 Thread Richard Sandiford
This patch makes vect_record_max_nunits and vect_record_base_alignment take a stmt_vec_info instead of a vec_info/gimple pair. 2018-07-24 Richard Sandiford gcc/ * tree-vect-data-refs.c (vect_record_base_alignment): Replace vec_info and gimple stmt arguments with a

Re: Improve std::rotate usages

2018-07-24 Thread François Dumont
Ping. On 08/06/2018 07:54, François Dumont wrote: Gentle reminder. On 27/05/2018 19:25, François Dumont wrote: Still no chance to review it ? I'd like this one to go in before submitting other algo related patches.     * include/bits/stl_algo.h     (__rotate(_Ite, _Ite, _Ite,

RE: [PATCH][GCC][AArch64] Cleanup the AArch64 testsuite when stack-clash is on [Patch (6/6)]

2018-07-24 Thread tamar . christina
Hi All, This patch cleans up the testsuite when a run is done with stack clash protection turned on. Concretely this switches off -fstack-clash-protection for a couple of tests: * sve: We don't yet support stack-clash-protection and sve, so for now turn these off. * assembler scan: some tests

RE: [PATCH][GCC][AArch64] Set default values for stack-clash and do basic validation in back-end. [Patch (5/6)]

2018-07-24 Thread tamar . christina
Hi All, This patch is a cascade update from having to re-spin the configure patch (no# 4 in the series). This patch enforces that the default guard size for stack-clash protection for AArch64 be 64KB unless the user has overriden it via configure in which case the user value is used as long as

RE: [PATCH][GCC][front-end][build-machinery][opt-framework] Allow setting of stack-clash via configure options. [Patch (4/6)]

2018-07-24 Thread Joseph Myers
On Tue, 24 Jul 2018, tamar.christ...@arm.com wrote: > This patch defines a configure option to allow the setting of the default > guard size via configure flags when building the target. If you add a configure option, you must also add documentation for it in install.texi. -- Joseph S. Myers

Re: [PATCH] Fix a missing case of PR 21458 similar to fc6141f097056f830a412afebed8d81a9d72b696.

2018-07-24 Thread Kyrill Tkachov
Hi Robert, On 24/07/18 09:48, Robert Schiele wrote: The original fix for PR 21458 was causing some issues, which were addressed to be fixed with a follow-up fix fc6141f097056f830a412afebed8d81a9d72b696. Unfortunately that follow-up fix missed one case, which is handled by this fix. Change-Id:

[PATCH] Fix up pr19476-{1,5}.C (PR testsuite/86649)

2018-07-24 Thread Jakub Jelinek
Hi! When looking at PR86569 testresults, I must have missed these two tests (but looking at test_summary outputs, I see it now). When we no longer fold this during cp_fold (to avoid code generation changes between -Wnonnull-compare and -Wno-nonnull-compare), it isn't folded from the first pass;

[11/46] Pass back a stmt_vec_info from vect_is_simple_use

2018-07-24 Thread Richard Sandiford
This patch makes vect_is_simple_use pass back a stmt_vec_info to those callers that want it. Most users only need the stmt_vec_info but some need the gimple stmt too. It's probably high time we added a class to represent "simple operands" instead, but I have a separate series that tries to clean

[10/46] Temporarily make stmt_vec_info a class

2018-07-24 Thread Richard Sandiford
This patch turns stmt_vec_info into an unspeakably bad wrapper class and adds an implicit conversion to the associated gimple stmt. Having this conversion makes the rest of the series easier to write, but since the class goes away again at the end of the series, I've not bothered adding any

[29/46] Use stmt_vec_info instead of gimple stmts internally (part 2)

2018-07-24 Thread Richard Sandiford
This second part handles the less mechnical cases, i.e. those that don't just involve swapping a gimple stmt for an existing stmt_vec_info. 2018-07-24 Richard Sandiford gcc/ * tree-vect-loop.c (vect_analyze_loop_operations): Look up the statement before passing it to

[28/46] Use stmt_vec_info instead of gimple stmts internally (part 1)

2018-07-24 Thread Richard Sandiford
This first part makes functions use stmt_vec_infos instead of gimple stmts in cases where the stmt_vec_info was already available and where the change is mechanical. Most of it is just replacing "stmt" with "stmt_info". 2018-07-24 Richard Sandiford gcc/ * tree-vect-data-refs.c

[30/46] Use stmt_vec_infos rather than gimple stmts for worklists

2018-07-24 Thread Richard Sandiford
2018-07-24 Richard Sandiford gcc/ * tree-vect-loop.c (vect_analyze_scalar_cycles_1): Change the type of the worklist from a vector of gimple stmts to a vector of stmt_vec_infos. * tree-vect-stmts.c (vect_mark_relevant, process_use)

[PATCH 02/11] [nvptx] Rename worker_bcast variables oacc_bcast.

2018-07-24 Thread cesar
From: Cesar Philippidis Eventually, we want the nvptx BE to use a common shared memory buffer for both worker and vector state propagation (albeit using different partitions of shared memory for each logical thread). This patch renames the worker_bcast variables into a more generic oacc_bcast.

[PATCH 00/11] [nvptx] Initial vector length changes

2018-07-24 Thread cesar
From: Cesar Philippidis This patch series contains various cleanups and structural reorganizations to the NVPTX BE in preparation for the forthcoming variable length vector length enhancements. Tom, in order to make these changes easier for you to review, I broke these patches into logical

[PATCH 01/11] [nvptx] Update openacc dim macros

2018-07-24 Thread cesar
From: Cesar Philippidis Besides for updating the macros for the NVPTX OpenACC dims, this patch also renames PTX_GANG_DEFAULT to PTX_DEFAULT_RUNTIME_DIM. I had originally included the PTX_GANG_DEFAULT hunk in an earlier libgomp patch, but going forward it makes sense to isolate the nvptx and

[PATCH 03/11] [nvptx] Consolidate offloaded function attributes into struct offload_attrs

2018-07-24 Thread cesar
From: Cesar Philippidis This patch introduces a new struct offload_attrs, which contains the details regarding the offload function launch geometry. In addition to its current usage to neuter worker and vector threads, it will eventually by used to validate the compile-time launch geometry

[PATCH 04/11] [nvptx] Make nvptx state propagation function names more generic

2018-07-24 Thread cesar
From: Cesar Philippidis This patch renames various state propagation functions into somewhat that reflects their usage in generic worker and vector contexts. E.g., whereas before nvptx_wpropagate used to be used exclusively for worker state propagation, it will eventually be used for any state

Re: [RFC 1/3, debug] Add fdebug-nops

2018-07-24 Thread Tom de Vries
On 07/24/2018 09:06 PM, Alexandre Oliva wrote: > On Jul 24, 2018, Tom de Vries wrote: > >> There's a design principle in GCC that code generation and debug generation >> are independent. This guarantees that if you're encountering a problem in an >> application without debug info, you can

[PATCH] Add initial version of C++17 header

2018-07-24 Thread Jonathan Wakely
This is missing the synchronized_pool_resource and unsynchronized_pool_resource classes but is otherwise complete. This is a new implementation, not based on the existing code in , but memory_resource and polymorphic_allocator ended up looking almost the same anyway. The constant_init kluge in

Re: [PATCH] combine: Allow combining two insns to two insns

2018-07-24 Thread Jeff Law
On 07/24/2018 11:18 AM, Segher Boessenkool wrote: > This patch allows combine to combine two insns into two. This helps > in many cases, by reducing instruction path length, and also allowing > further combinations to happen. PR85160 is a typical example of code > that it can improve. > > This

Re: [2/5] C-SKY port: Backend implementation

2018-07-24 Thread Jeff Law
On 07/24/2018 12:18 PM, Sandra Loosemore wrote: > On 07/24/2018 09:45 AM, Jeff Law wrote: >> On 07/23/2018 10:21 PM, Sandra Loosemore wrote: >>> 2018-07-23  Jojo  >>> Huibin Wang  >>> Sandra Loosemore  >>> Chung-Lin Tang  >>> >>> C-SKY port:

Re: [PATCH] Make strlen range computations more conservative

2018-07-24 Thread Jeff Law
On 07/24/2018 01:59 AM, Bernd Edlinger wrote: > Hi! > > This patch makes strlen range computations more conservative. > > Firstly if there is a visible type cast from type A to B before passing > then value to strlen, don't expect the type layout of B to restrict the > possible return value

Re: [Patch] [Aarch64] PR 86538 - Define __ARM_FEATURE_LSE if LSE is available

2018-07-24 Thread Steve Ellcey
On Tue, 2018-07-24 at 22:04 +0100, James Greenhalgh wrote: >  > > I'd say this patch isn't desirable for trunk. I'd be interested in use cases > that need a static decision on presence of LSE that are not better expressed > using higher level language features. > > Thanks, > James How about

Re: [PATCH] fix a couple of bugs in const string folding (PR 86532)

2018-07-24 Thread Jeff Law
On 07/24/2018 02:16 PM, Martin Sebor wrote: > On 07/20/2018 04:20 AM, Richard Biener wrote: >> On Thu, 19 Jul 2018, Martin Sebor wrote: >> >>> Here's one more update with tweaks addressing a couple more >>> of Bernd's comments: >>> >>> 1) correct the use of TREE_STRING_LENGTH() where a number of

Re: [PATCH] Make strlen range computations more conservative

2018-07-24 Thread Bernd Edlinger
On 07/24/18 23:46, Jeff Law wrote: > On 07/24/2018 01:59 AM, Bernd Edlinger wrote: >> Hi! >> >> This patch makes strlen range computations more conservative. >> >> Firstly if there is a visible type cast from type A to B before passing >> then value to strlen, don't expect the type layout of B to

[PATCH 11/11] [nvptx] Generalize state propagation and synchronization

2018-07-24 Thread cesar
From: Tom de Vries As the title mentions, this patch generalizes the state propagation and synchronization code. Note that while the patch makes reference to large_vectors, they are not enabled in nvptx_goacc_validate_dims. Therefore, only the worker case is exercised in this patch. 2018-XX-YY

[PATCH] PR libstdc++/86658 fix __niter_wrap to not copy invalid iterators

2018-07-24 Thread Jonathan Wakely
An output iterator passed as the unused first argument to __niter_wrap might have already been invalidated, so don't copy it. PR libstdc++/86658 * include/bits/stl_algobase.h (__niter_wrap<_Iterator>): Pass unused parameter by reference, to avoid copying invalid

Re: [Patch] [Aarch64] PR 86538 - Define __ARM_FEATURE_LSE if LSE is available

2018-07-24 Thread James Greenhalgh
On Tue, Jul 24, 2018 at 03:22:02PM -0500, Steve Ellcey wrote: > This is a patch for PR 86538, to define an __ARM_FEATURE_LSE macro > when LSE is available.  Richard Earnshaw closed PR 86538 as WONTFIX > because the ACLE (Arm C Language Extension) does not require this > macro and because he is

Re: Fix ceil_log2(0) (PR 86644)

2018-07-24 Thread Jeff Law
On 07/24/2018 12:11 PM, Richard Sandiford wrote: > This PR shows a pathological case in which we try SLP vectorisation on > dead code. We record that 0 bits of the result are enough to satisfy > all users (which is true), and that led to precision being 0 in: > > static unsigned int >

Re: [PATCH 6/7] AArch64 - new pass to add conditional-branch speculation tracking

2018-07-24 Thread Jeff Law
On 07/23/2018 08:33 AM, Richard Earnshaw (lists) wrote: > [sorry, missed this mail somehow] > > On 11/07/18 22:01, Jeff Law wrote: >> On 07/09/2018 10:38 AM, Richard Earnshaw wrote: >>> This patch is the main part of the speculation tracking code. It adds >>> a new target-specific pass that is

Re: [PATCH] Explain asan parameters in params.def (PR sanitizer/79635).

2018-07-24 Thread Jeff Law
On 07/24/2018 06:18 AM, Martin Liška wrote: > Hi. > > That's simple patch that improves documentation as requested > in the PR. > > Ready for trunk? > Martin > > gcc/ChangeLog: > > 2018-07-24 Martin Liska > > PR sanitizer/79635 > * params.def: Explain ASan abbreviation and

[PATCH 09/11] [nvptx] Use TARGET_SET_CURRENT_FUNCTION

2018-07-24 Thread cesar
From: Cesar Philippidis Chung-Lin had originally defined TARGET_SET_CURRENT_FUNCTION as part of his gang-local variable patch. But I intend to introduce those changes at a later time. Eventually the state propagation code will utilize nvptx_set_current_function to reset the reduction buffer

  1   2   >