[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 l

[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

[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 ins

[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] 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 i

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 Ume

[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 hwi

[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 --- gas/conf

[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] 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:

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 short-ci

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

[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; wi

[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 vec_

[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): Move

[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 t

[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);

[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, new

[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

[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. (vec_info::add_stmt

[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 o

[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.

[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 (vec_info::lookup_single_use

[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 comment

[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

[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. * tree

[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 sc

[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 st

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 agai

[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 (_loop_vec_info::reductions)

[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 gc

[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) (

[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 (vect_free_slp_tree):

[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 that

[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 accordi

[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 au

[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 (vect_enhance_data_refs_alignme

[24/46] Make stmt_info_for_cost use a stmt_vec_info

2018-07-24 Thread Richard Sandiford
This patch makes stmt_info_for_cost carry a stmt_vec_info instead of a gimple stmt. The structure is internal to the vectoriser, so targets aren't affected. 2018-07-24 Richard Sandiford gcc/ * tree-vectorizer.h (stmt_info_for_cost::stmt): Replace with... (stmt_info_for_cost::

[26/46] Make more use of dyn_cast in tree-vect*

2018-07-24 Thread Richard Sandiford
If we use stmt_vec_infos to represent statements in the vectoriser, it's then more natural to use dyn_cast when processing the statement as an assignment, call, etc. This patch does that in a few more places. 2018-07-24 Richard Sandiford gcc/ * tree-vect-data-refs.c (vect_check_gathe

[25/46] Make get_earlier/later_stmt take and return stmt_vec_infos

2018-07-24 Thread Richard Sandiford
...and also make vect_find_last_scalar_stmt_in_slp return a stmt_vec_info. 2018-07-24 Richard Sandiford gcc/ * tree-vectorizer.h (get_earlier_stmt, get_later_stmt): Take and return stmt_vec_infos rather than gimple stmts. Do not accept null arguments. (vect_fi

[27/46] Remove duplicated stmt_vec_info lookups

2018-07-24 Thread Richard Sandiford
Various places called vect_dr_stmt or vinfo_for_stmt multiple times on the same input. This patch makes them reuse the earlier result. It also splits a couple of single vinfo_for_stmt calls out into separate statements so that they can be reused in later patches. 2018-07-24 Richard Sandiford

[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 vect_anal

[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 (vect_

[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) (vect_mark_stmts_to_be_

[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.

[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 us

[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/ * tree-vect

[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): T

[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 stmt_vec_inf

[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 San

[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 data_referenc

[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 -Wno-no

[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... (_loop_vec_info

[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/ * tree-vectorizer

[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. * tree-vect-l

[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 (vect_remove_

[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 actu

[44/46] Remove global vinfo_for_stmt-related routines

2018-07-24 Thread Richard Sandiford
There are no more direct uses of: - new_stmt_vec_info - set_vinfo_for_stmt - free_stmt_vec_infos - free_stmt_vec_info outside of vec_info, so they can now be private member functions. It also seemed better to put them in tree-vectorizer.c, along with the other vec_info routines. We can also get

[45/46] Remove vect_stmt_in_region_p

2018-07-24 Thread Richard Sandiford
Unlike the old vinfo_for_stmt, vec_info::lookup_stmt can cope with any statement, so there's no need to check beforehand that the statement is part of the vectorisable region. This means that there are no longer any calls to vect_stmt_in_region_p. 2018-07-24 Richard Sandiford gcc/ *

[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. (stmt_v

Re: [C++ PATCH] Speed up inplace_merge algorithm & fix inefficient logic(PR libstdc++/83938)

2018-07-24 Thread François Dumont
Hi     Any chance to review this patch ? François On 06/06/2018 18:39, François Dumont wrote: Hi     I review and rework this proposal. I noticed that the same idea to limit buffer size within inplace_merge also apply to stable_sort.     I also change the decision when buffer is too small

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, forward_iterato

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 instead

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 explicit

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 t

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 a

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

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 j

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

2018-07-24 Thread Jakub Jelinek
On Tue, Jul 24, 2018 at 12:29:37PM +0200, Tom de Vries wrote: > > I wonder if it makes sense to disambiguate things from the gcc side > > by generating an empty location description for known optimized out > > values (the standard seems to explicitely call that out as a way to > > say "optimized ou

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. > > A

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

2018-07-24 Thread Tom de Vries
On Tue, Jul 24, 2018 at 01:30:30PM +0200, Tom de Vries wrote: > 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

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

2018-07-24 Thread Tom de Vries
On Tue, Jul 24, 2018 at 01:30:30PM +0200, Tom de Vries wrote: > 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

[RFC 3/3, debug] Add fdebug-nops and fkeep-vars-live to Og only

2018-07-24 Thread Tom de Vries
On Tue, Jul 24, 2018 at 01:30:30PM +0200, Tom de Vries wrote: > 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

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

2018-07-24 Thread Jakub Jelinek
On Tue, Jul 24, 2018 at 01:37:32PM +0200, Tom de Vries wrote: > Another drawback is that the fake uses confuse the unitialized warning > analysis, so that is switched off for -fkeep-vars-live. Is that really needed? I.e. can't you for the purpose of uninitialized warning analysis ignore the clobb

[PATCH] Come up with TARGET_GET_VALID_OPTION_VALUES option hook (PR driver/83193).

2018-07-24 Thread Martin Liška
Hi. I'm sending updated version of the patch. It comes up with a new target common hook that provide option completion list. It's used both in --help=target and with --completion option. I implemented support for -match and -mtune for i386 target. Patch can bootstrap on x86_64-linux-gnu and sur

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

2018-07-24 Thread Martin Liška
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 provide a documentation link. --- gcc/params.def | 2 ++ 1 file

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

2018-07-24 Thread Tom de Vries
On 07/24/2018 01:46 PM, Jakub Jelinek wrote: > On Tue, Jul 24, 2018 at 01:37:32PM +0200, Tom de Vries wrote: >> Another drawback is that the fake uses confuse the unitialized warning >> analysis, so that is switched off for -fkeep-vars-live. > > Is that really needed? I.e. can't you for the purpo

[PATCH] Reorder conditions in uses-allocator construction helper

2018-07-24 Thread Jonathan Wakely
The erased_type condition is only true for code using the Library Fundamentals TS, so assume it's less common and only check it after checking for convertibility. This does mean for types using erased_type the more expensive convertibility check is done first, but such types are rare. *

[PATCH] PR libstdc++/70966 fix lifetime bug for default resource

2018-07-24 Thread Jonathan Wakely
Similar to what I did for the new_delete_resource and null_memory_resource objects, this makes the atomic immortal. This ensure it can still be used after static destructors start running. PR libstdc++/70966 * include/experimental/memory_resource (__get_default_resource): Use

[PATCH] Make __resource_adaptor_imp usable with C++17 memory_resource

2018-07-24 Thread Jonathan Wakely
By making the memory_resource base class a template parameter the __resource_adaptor_imp can be used to adapt an allocator into a std::pmr::memory_resource instead of experimental::pmr::memory_resource. No uses for this in the library but somebody might want to do it, and it costs us nothing to s

[PATCH] Add BIT_FIELD_REF canonicalization patterns

2018-07-24 Thread Richard Biener
The following adds some simple BIT_FIELD_REF canonicalization patterns that fire during SCCVN expression simplification. Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk. Richard. 2018-07-24 Richard Biener * match.pd: Add BIT_FIELD_REF canonicalizations. Index

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

2018-07-24 Thread Janus Weil
2018-07-24 11:12 GMT+02:00 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

[PR 80689] Copy small aggregates element-wise

2018-07-24 Thread Martin Jambor
Hi, I'd like to propose again a new variant of a fix that I sent here in November (https://gcc.gnu.org/ml/gcc-patches/2017-10/msg00881.html) that avoids store-to-load forwarding stalls in the ImageMagick benchmark by expanding copies of very small simple aggregates element-wise rather than "by pie

[PATCH] Minor refactoring in header

2018-07-24 Thread Jonathan Wakely
* include/std/bit (__countl_zero, __countr_zero, __popcount): Use local variables for number of digits instead of type aliases. (__log2p1): Remove redundant branch also checked in __countl_zero. Tested powerpc64le-linux, committed to trunk. commit b5cb477ecf9e98d10f4608b

Re: [PATCH] Make function clone name numbering independent.

2018-07-24 Thread Michael Ploujnikov
On 2018-07-20 06:05 AM, Richard Biener wrote: > On Fri, Jul 20, 2018 at 4:48 AM Michael Ploujnikov > wrote: >> >> On 2018-07-17 04:25 PM, Michael Ploujnikov wrote: >>> On 2018-07-17 06:02 AM, Richard Biener wrote: On Tue, Jul 17, 2018 at 8:10 AM Bernhard Reutner-Fischer wrote: > >>>

Re: [PATCH] -fsave-optimization-record: add contrib/optrecord.py

2018-07-24 Thread Richard Biener
On Mon, Jul 23, 2018 at 9:20 PM David Malcolm wrote: > > On Mon, 2018-07-23 at 11:46 +0200, Richard Biener wrote: > > On Fri, Jul 20, 2018 at 6:27 PM David Malcolm > > wrote: > > > > > > This patch adds a Python 3 module to "contrib" for reading the > > > output of > > > -fsave-optimization-recor

Re: [PATCH] Fix segfault in -fsave-optimization-record (PR tree-optimization/86636)

2018-07-24 Thread Richard Biener
On Tue, Jul 24, 2018 at 1:44 AM David Malcolm wrote: > > There are various ways that it's possible for a gimple statement to > have an UNKNOWN_LOCATION, and for that UNKNOWN_LOCATION to be wrapped > in an ad-hoc location to capture inlining information. > > For such a location, LOCATION_FILE (loc)

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 All, Here's an updated patch with documentation. Ok for trunk? Thanks, Tamar 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)

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

2018-07-24 Thread Richard Biener
On Tue, Jul 24, 2018 at 9:27 AM Martin Liška wrote: > > 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_L

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

2018-07-24 Thread Richard Biener
On Tue, 24 Jul 2018, Jakub Jelinek wrote: > 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 c

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

2018-07-24 Thread Richard Biener
On Tue, Jul 24, 2018 at 12:39 PM Jakub Jelinek wrote: > > On Tue, Jul 24, 2018 at 12:29:37PM +0200, Tom de Vries wrote: > > > I wonder if it makes sense to disambiguate things from the gcc side > > > by generating an empty location description for known optimized out > > > values (the standard see

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

2018-07-24 Thread Jakub Jelinek
On Tue, Jul 24, 2018 at 04:33:30PM +0200, Richard Biener wrote: > DW_OP_GNU_variable_value you mean. That's true. But I was talking about Sure. > omitting DW_AT_upper_bound which would correspond to int[] vs. > a empty location list DW_AT_upper_bound which would correspond to > int[]. I think

Re: [PATCH] Make strlen range computations more conservative

2018-07-24 Thread Richard Biener
On Tue, 24 Jul 2018, 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 range o

[PATCH, debug] Add fdebug-nops

2018-07-24 Thread Tom de Vries
On Tue, Jul 24, 2018 at 01:35:14PM +0200, Tom de Vries wrote: > On Tue, Jul 24, 2018 at 01:30:30PM +0200, Tom de Vries wrote: > > 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? > >

[PATCH, debug] Add fkeep-vars-live

2018-07-24 Thread Tom de Vries
On Tue, Jul 24, 2018 at 02:34:26PM +0200, Tom de Vries wrote: > On 07/24/2018 01:46 PM, Jakub Jelinek wrote: > > On Tue, Jul 24, 2018 at 01:37:32PM +0200, Tom de Vries wrote: > >> Another drawback is that the fake uses confuse the unitialized warning > >> analysis, so that is switched off for -fkee

[PATCH] Fix PR86654

2018-07-24 Thread Richard Biener
I am testing the following patch to avoid forcing DIEs for a type context for method clones late via limbo processing. Instead hang them off comp_unit_die if there is no early DIE for the function. One question is whether the comment "If we're a nested function" matches up with the decl_functio

Re: [1/5] C-SKY port: Configury

2018-07-24 Thread Jeff Law
On 07/23/2018 10:19 PM, Sandra Loosemore wrote: > 2018-07-23  Jojo  >     Huibin Wang  >     Sandra Loosemore  >     Chung-Lin Tang  >     Andrew Jenner  > >     C-SKY port: Configury > >     gcc/ >     * config.gcc (csky-*-*): New. >     * con

  1   2   >