[committed] Remove bogus target-def.h includes

2015-06-23 Thread Richard Sandiford
target-def.h should only be included by files that want to initialise targetm. This patch removes unnecessary includes for other files. Bootstrapped & regression-tested on x86_64-linux-gnu. Also tested with config-list.mk. Applied as obvious. Thanks, Richard gcc/c-family/ * c-common.c

Move target-def.h includes after main include block

2015-06-23 Thread Richard Sandiford
This moves target-def.h includes to the end of the include list, so that the file sees the same header files as the targetm initialisation itself. I've left a gap to emphasise that the placement is deliberate. This is a prerequisite for the patch I'm about to post. It probably doesn't make much s

Re: [PATCH] backport FreeBSD add functionality to build PIE executables

2015-06-23 Thread Jakub Jelinek
On Tue, Jun 23, 2015 at 07:58:48PM +0200, Andreas Tobler wrote: > On 23.06.15 19:50, Jakub Jelinek wrote: > >On Tue, Jun 23, 2015 at 07:26:09PM +0200, Andreas Tobler wrote: > >>Hi all, > >> > >>I'm going to commit this patch to 5.1 in the next days unless someone > >>objects. > >> > >>The patch is

Add .def file for public target instructions

2015-06-23 Thread Richard Sandiford
[A fair bit later than promised, sorry...] Mikhail posted a patch to make genflags generate the default HAVE_foo and gen_foo definitions that have recently been added to defaults.h: https://gcc.gnu.org/ml/gcc-patches/2015-06/msg00723.html I agree it'd be a good idea to generate this kind of th

Re: [PATCH 00/17] RFC: Addding a unit testing framework to gcc

2015-06-23 Thread Jeff Law
On 06/10/2015 11:16 AM, David Malcolm wrote: On Wed, 2015-06-10 at 17:34 +0200, Jakub Jelinek wrote: On Wed, Jun 10, 2015 at 11:24:41AM -0400, David Malcolm wrote: I picked the Google Test framework: http://code.google.com/p/googletest/ I must say I'm not very excited about using this, it

Re: [PATCH 1/3] Refactor entry point to -Wmisleading-indentation

2015-06-23 Thread Patrick Palka
On Mon, Jun 22, 2015 at 2:56 PM, Patrick Palka wrote: > On Mon, Jun 22, 2015 at 1:29 PM, Jeff Law wrote: >> On 06/09/2015 11:31 AM, Patrick Palka wrote: >>> >>> This patch refactors the entry point of -Wmisleading-indentation from: >>> >>>void >>>warn_for_misleading_indentation (location_

Re: [PATCH 02/17] Add test-bitmap.c to gcc/unittests

2015-06-23 Thread Jeff Law
On 06/10/2015 09:24 AM, David Malcolm wrote: gcc/unittests/ChangeLog: * test-bitmap.c: New file. --- gcc/unittests/test-bitmap.c | 117 1 file changed, 117 insertions(+) create mode 100644 gcc/unittests/test-bitmap.c diff --git a/gcc/unit

Re: [PATCH 03/17] Add test-cfg.c to gcc/unittests

2015-06-23 Thread Jeff Law
On 06/10/2015 09:24 AM, David Malcolm wrote: gcc/unittests/ChangeLog: * test-cfg.c: New file. --- gcc/unittests/test-cfg.c | 319 +++ 1 file changed, 319 insertions(+) create mode 100644 gcc/unittests/test-cfg.c So this one would be a great

Re: [PATCH/RFC]: unittesting v2: as a plugin (was Re: [PATCH 00/17] RFC: Addding a unit testing framework to gcc)

2015-06-23 Thread Jeff Law
On 06/17/2015 01:48 PM, David Malcolm wrote: On Thu, 2015-06-11 at 00:18 +0200, Jakub Jelinek wrote: I wrote a custom formatter for the output (class deja_gnu_printer within unittests-plugin.c) which generates lines like this on stderr: PASS: ggc_test.tree_marking PASS: ggc_test.custom_struct P

Re: pr66345.c size_t assumption bug

2015-06-23 Thread Jeff Law
On 06/08/2015 06:58 PM, DJ Delorie wrote: The testcase for pr 66345 assumes size_t is "unsigned long" instead of using the real type, which causes failures on some 16-bit targets. Ok? Also, I note that some tests check for __SIZE_TYPE__ as I do below, and others use it unconditionally as a re

Re: New type-based pool allocator code miscompiled due to aliasing issue?

2015-06-23 Thread Pat Haugen
On 06/18/2015 06:10 AM, Richard Biener wrote: You are right that we should call ::new just for classes that have m_ignore_type_size == false. >I've come up with following patch, that I tested slightly: > >diff --git a/gcc/alloc-pool.h b/gcc/alloc-pool.h >index 1785df5..7da5f7a 100644 >--- a/gcc/

Re: [C/C++ PATCH] PR c++/66572. Fix Wlogical-op false positive

2015-06-23 Thread Marek Polacek
On Sat, Jun 20, 2015 at 03:02:06AM +0300, Mikhail Maltsev wrote: > - /* We do not warn for constants because they are typical of macro > - expansions that test for features. */ > - if (CONSTANT_CLASS_P (op_left) || CONSTANT_CLASS_P (op_right)) > + /* We do not warn for literal constants bec

Re: [PATCH 00/17] RFC: Addding a unit testing framework to gcc

2015-06-23 Thread Mike Stump
On Jun 10, 2015, at 10:16 AM, David Malcolm wrote: > It doesn't have an output formatter for the DejaGnu format, but I guess > I could write one. The gtest standard output format is IMHO superior to > DejaGnu's since it tells you start-of-test/end-of-test on separate > lines, so you can see which

Re: Do not take address of empty string front

2015-06-23 Thread François Dumont
On 22/06/2015 17:10, Jonathan Wakely wrote: > On 20/06/15 12:59 +0100, Jonathan Wakely wrote: >> On 20/06/15 12:03 +0200, François Dumont wrote: >>> Hi >>> >>> 2 experimental tests are failing in debug mode because >>> __do_str_codecvt is sometimes taking address of string front() and >>> back()

Re: [PATCH][RFC] Add FRE in pass_vectorize

2015-06-23 Thread Jeff Law
On 06/10/2015 08:02 AM, Richard Biener wrote: The following patch adds FRE after vectorization which is needed for IVOPTs to remove redundant PHI nodes (well, I'm testing a patch for FRE that will do it already there). Redundant or degenerates which should be propagated? I believe Alan Lawrenc

Re: [PATCH/RFC] Make loop-header-copying more aggressive, rerun before tree-if-conversion

2015-06-23 Thread Jeff Law
On 06/19/2015 11:38 AM, Alan Lawrence wrote: Jeff Law wrote: On 05/22/2015 09:42 AM, Alan Lawrence wrote: This patch does so (and makes slightly less conservative, to tackle the example above). I found I had to make this a separate pass, so that the phi nodes were cleaned up at the end of the p

Re: [00/13] Share hash traits between hash_table and hash_set

2015-06-23 Thread Jeff Law
On 06/16/2015 02:42 AM, Richard Sandiford wrote: At the moment we need separate traits classes for hash_table, hash_set and hash_map. I think that's a sign that we don't have the right abstraction. You're probably right. The aim of this series is to unify the traits for hash_table and hash_s

Re: [01/13] Move hash traits to their own header file

2015-06-23 Thread Jeff Law
On 06/16/2015 02:43 AM, Richard Sandiford wrote: This patch just moves the traits classes to their own header file, hash-traits.h. gcc/ * hash-table.h: Include hash-traits.h. (typed_free_remove, typed_noop_remove, pointer_hash, ggc_hasher) (ggc_cache_hasher): Move to...

Re: [02/13] Replace handle_cache_entry with new interface

2015-06-23 Thread Jeff Law
On 06/16/2015 02:45 AM, Richard Sandiford wrote: As described in the covering note, this patch replaces handle_cache_entry with a new function keep_cache_entry. It also ensures that elements are deleted using the proper function, so that m_n_deleted is updated. I couldn't tell whether the unusu

Re: [03/13] Make ggc_cached_hasher inherit from ggc_hasher

2015-06-23 Thread Jeff Law
On 06/16/2015 02:52 AM, Richard Sandiford wrote: Most of ggc_cache_hasher is duplicated from ggc_hasher. This patch gets the same functionality via inheritance. It also brings the ggc_hasher functions in line with ggc_cache_hasher by making remove() and ggc_mx() take references rather than poin

Re: [04/13] Add {mark,is}_{empty,deleted} to pointer_hash

2015-06-23 Thread Jeff Law
On 06/16/2015 02:53 AM, Richard Sandiford wrote: This patch just adds the standard pointer handling of empty and deleted entries. As the series goes on, more and more traits classes will inherit these definitions, to the point where we can require the functions to exist. gcc/ * hash-tra

[PATCH/AARCH64] Update ThunderX schedule model

2015-06-23 Thread Andrew Pinski
Hi, This patch updates the schedule model to be more accurate and model SIMD and fp instructions that I had missed out when I had the last patch. OK? Bootstrapped and tested on aarch64-linux-gnu with no regeessions. Thanks, Andrew Pinski ChangeLog: * config/aarch64/thunderx.md (thunderx_shi

Re: Remove redundant AND from count reduction loop

2015-06-23 Thread Marc Glisse
On Tue, 23 Jun 2015, Richard Sandiford wrote: +/* Vector comparisons are defined to produce all-one or all-zero results. */ +(simplify + (vec_cond @0 integer_all_onesp@1 integer_zerop@2) + (if (tree_nop_conversion_p (type, TREE_TYPE (@0))) + (convert @0))) I am trying to understand why the

Re: [05/13] Add nofree_ptr_hash

2015-06-23 Thread Jeff Law
On 06/16/2015 02:55 AM, Richard Sandiford wrote: This patch stops pointer_hash from inheriting typed_noop_remove and instead creates a new class nofree_ptr_hash that inherits from both. It then updates all uses of typed_noop_remove (which are all pointers) and pointer_hash so that they use this n

DIsable reorder_blocks_and_partition for DWARF2 unwinding

2015-06-23 Thread Dehao Chen
This patch disables reorder_blocks_and_partition for DWARF2 unwinding. This is causing an internal application to segfault when built with AutoFDO+EH. Unfortunately, I don't have a small reproducible. But from the comment above the code, I do not see why UI_DWARF2 will survive the issue. Any commen

[C++ Patch] PR 65811

2015-06-23 Thread Paolo Carlini
Hi, the testcase shows that after Jason's r222134 in some cases it can still happen that TREE_PUBLIC is false and DECL_COMDAT is true, thus the assertion in vague_linkage_p triggers. For the testcase, in duplicate_decls, newdecl starts with both flags true and only the former becomes false wh

Re: [06/13] Add free_ptr_hash

2015-06-23 Thread Jeff Law
On 06/16/2015 02:56 AM, Richard Sandiford wrote: Similarly to the last patch, this one adds a free_ptr_hash that inherits from both pointer_hash and typed_free_remove. gcc/ * hash-traits.h (free_ptr_hash): New class. * dwarf2out.c (decl_table_entry_hasher): Inherit from free_ptr_

Re: [07/13] Add ggc_ptr_hash

2015-06-23 Thread Jeff Law
On 06/16/2015 03:01 AM, Richard Sandiford wrote: This patch renames ggc_hasher to ggc_remove and removes the typedefs, to make it provide the same kind of interface as typed_noop_remove and typed_free_remove. It then defines a new class ggc_ptr_hash that inherits from both pointer_hash and ggc_r

Re: [08/13] Add a ggc_cache_ptr_hash

2015-06-23 Thread Jeff Law
On 06/16/2015 03:03 AM, Richard Sandiford wrote: Like the previous patch, but for ggc_cache_hasher. gcc/ * hash-traits.h (ggc_cache_hasher): Rename to... (ggc_cache_remove): ...this and remove typedefs. (ggc_cache_ptr_hash): New class. * hash-table.h: Update comme

Re: [09/13] Make remaining pointer hashes inherit from a generic class

2015-06-23 Thread Jeff Law
On 06/16/2015 03:05 AM, Richard Sandiford wrote: This patch mops up the remaining pointer traits classes that didn't inherit from any of the standard ones and just did their own thing. gcc/ * cgraph.h (asmname_hasher): Inherit from ggc_ptr_hash. Remove redundant typedefs and mem

Re: [10/13] Require {mark,id}_{deleted,empty} functions

2015-06-23 Thread Jeff Law
On 06/16/2015 03:11 AM, Richard Sandiford wrote: After the previous changes, all traits classes provide an implementation of the empty & deleted entry functions, so we can remove the code that provided defaults. gcc/ * hash-table.h (has_is_deleted, is_deleted_helper): Delete. (ha

Re: [11/13] Generalise typed_noop_remove

2015-06-23 Thread Jeff Law
On 06/16/2015 03:12 AM, Richard Sandiford wrote: The traits interface is supposed to support non-pointer element types, so there's no real reason for typed_noop_remove to be specifically for pointers. It should be usable by anything that wants a no-op remove(). gcc/ * hash-traits.h (typ

Re: [12/13] Reuse hash_table traits for hash_set

2015-06-23 Thread Jeff Law
On 06/16/2015 03:14 AM, Richard Sandiford wrote: This is the main patch, to reuse the hash_table traits for hash_set. The idea is to replace the untemplated default_hashset_traits with a templated default_hash_traits, which gives the default traits for a given type. This allows things like hash_

Re: [13/13] Update comments in hash-table.h

2015-06-23 Thread Jeff Law
On 06/16/2015 03:17 AM, Richard Sandiford wrote: This updates the commentary in hash-table.h for the changes in this series and fixes some cases that were already out of date. It also has a couple of trivial formatting fixes. gcc/ * hash-table.h: Update comments. OK. jeff

Re: DIsable reorder_blocks_and_partition for DWARF2 unwinding

2015-06-23 Thread Jeff Law
On 06/23/2015 04:18 PM, Dehao Chen wrote: This patch disables reorder_blocks_and_partition for DWARF2 unwinding. This is causing an internal application to segfault when built with AutoFDO+EH. Unfortunately, I don't have a small reproducible. But from the comment above the code, I do not see why

Re: [PATCH] Fix PR c++/30044

2015-06-23 Thread Patrick Palka
On Tue, Jun 23, 2015 at 12:38 AM, Jason Merrill wrote: > On 06/15/2015 02:32 PM, Patrick Palka wrote: >> >> On Mon, Jun 15, 2015 at 2:05 PM, Jason Merrill wrote: >>> >>> Any reason not to use grow_tree_vec? >> >> >> Doing so causes a lot of ICEs in the testsuite. I think it's because >> grow_tre

[RS6000 0/7] rtx_cost patches

2015-06-23 Thread Alan Modra
This series fixes a number of problems in the rs6000 backend, building on top of https://gcc.gnu.org/ml/gcc-patches/2015-06/msg01396.html. Patch 5,6,7 really need the fixed rtx_cost function to be applied first, the others are independent of that change (if you're willing to allow a failing testcas

[RS6000 1/7] Hide insns not needing to be public

2015-06-23 Thread Alan Modra
* config/rs6000/rs6000.md (addsi3_high, bswaphi2_internal, ashldi3_internal5, ashldi3_internal8): Prefix with '*'. diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 6a14ee8..243a151 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.m

[RS6000 2/7] Tidy rotates

2015-06-23 Thread Alan Modra
Besides various tidies this fixes the wrong mode used for a number of rotate pattern shift counts. Since every other shift and rotate pattern uses SImode for the shift count, these combine patterns won't match anything. The testcase exercises one of these rotate patterns. It requires rtx_cost con

[RS6000 3/7] rtx_costs for ROTATE/ASHIFT inside AND

2015-06-23 Thread Alan Modra
The odd patterns for rldic and rldicr that require an insn predicate that examines both the shift count and the mask, must be costed at a point where both count and mask are available. Also tidies the mode passed to a couple of predicates. * config/rs6000/rs6000.c (rs6000_rtx_costs): Pass

[RS6000 4/7] rldic in rotate and mask patterns

2015-06-23 Thread Alan Modra
rldic can support ROTATE as well as ASHIFT inside an AND, provided the AND mask has exactly the shift count low zeros. The added rotate patterns are needed to support the next patch that removes the mask64_2_operand patterns, and may be generally useful too. Note that the costing for the ROTATEs

[RS6000 5/7] Split mask64_2_operand rotates early

2015-06-23 Thread Alan Modra
This gets rid of some patterns I added a long time ago for ANDs that can be performed by two rotate and mask insns. * config/rs6000/preficates.md (and64_2_operand): Delete. (and_2rld_operand): Delete. * config/rs6000/rs6000.md (and3): Expand two insn mask_operand_wr

[RS6000 6/7] Cost multi-insn constants

2015-06-23 Thread Alan Modra
This small patch considerably improves code generated for large constants in 64-bit code, teaching gcc that it is better to load a constant from memory than to generate a sequence of five dependent instructions. Note that we already do this at expand time for plain moves. This change affects cons

[RS6000 7/7] Address cost

2015-06-23 Thread Alan Modra
The rs6000 backend currently uses an address cost of zero. This made sense prior to -mcmodel=medium/large, but medium/large model addresses before splitting are really two insns. So we should cost them one more than other addresses. This patch also adjusts rs6000_rtx_cost to use the new address

Re: [patch] fix regrename pass to ensure renamings produce valid insns

2015-06-23 Thread Sandra Loosemore
On 06/18/2015 11:32 AM, Eric Botcazou wrote: The attached patch teaches regrename to validate insns affected by each register renaming before making the change. I can see at least two other ways to handle this -- earlier, by rejecting renamings that result in invalid instructions when it's searc

Re: [C++ Patch] PR 65811

2015-06-23 Thread Jason Merrill
OK. Jason

Re: [PATCH] config/bfin/bfin.c (hwloop_optimize): Set JUMP_LABEL() after emit jump_insn

2015-06-23 Thread Jeff Law
On 06/20/2015 04:48 AM, Chen Gang wrote: JUMP_LABLE() must be defined after optimization completed. In this case, it is doing optimization, and is almost finished, so it is no chances to set JUMP_LABLE() next. The related issue is Bug 65803. 2015-06-20 Chen Gang * config/bfin/bfin.c

Re: [PING][PATCH][PR65511] Fix edge probabilities in move_sese_region_to_fn

2015-06-23 Thread Jeff Law
On 06/14/2015 08:15 AM, Tom de Vries wrote: On 30/03/15 11:54, Tom de Vries wrote: On 30-03-15 10:15, Jan Hubicka wrote: Also move_sese_region_to_fn seem to mis updating of counts. Can you, please, add that and send updated patch? Like this? OK for stage1 if bootstrap and reg-test on x86_6

Re: [PATCH]Use "unsigned int" instead of "int" to hold alignment in emit_local function.

2015-06-23 Thread Jeff Law
On 06/04/2015 05:05 AM, Renlin Li wrote: Hi all, This is a simple patch to change the align variable (used in emit_local()) from type "int" to type "unsigned int". It should be defined as "unsigned int" which is the same data type returned by symtab_node::get (decl)->definition_alignment () For

Re: Move target-def.h includes after main include block

2015-06-23 Thread Jeff Law
On 06/23/2015 12:29 PM, Richard Sandiford wrote: This moves target-def.h includes to the end of the include list, so that the file sees the same header files as the targetm initialisation itself. I've left a gap to emphasise that the placement is deliberate. This is a prerequisite for the patch

Re: Add .def file for public target instructions

2015-06-23 Thread Jeff Law
On 06/23/2015 12:41 PM, Richard Sandiford wrote: [A fair bit later than promised, sorry...] Mikhail posted a patch to make genflags generate the default HAVE_foo and gen_foo definitions that have recently been added to defaults.h: https://gcc.gnu.org/ml/gcc-patches/2015-06/msg00723.html I a

Re: [VRP] Improve value ranges for unsigned division

2015-06-23 Thread Kugan
On 23/06/15 01:09, Richard Biener wrote: > On Sat, Jun 20, 2015 at 9:12 AM, Kugan > wrote: >> As discussed in PR64130, this patch improves the VRP value ranges for >> unsigned division. >> >> Bootstrapped and regression tested on x86_64-linux-gnu and regression >> tested on arm-none-linux-gnu wi

[PATCH 3/8] S/390: Disable effect of support_vector_misalignment hook for non-z13 targets.

2015-06-23 Thread Andreas Krebbel
gcc/ChangeLog: * config/s390/s390.c (s390_support_vector_misalignment): Call default implementation for !TARGET_VX. --- gcc/config/s390/s390.c |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 859ed68.

[PATCH 2/8] S/390: Limit legitimate_constant_p changes to TARGET_VX.

2015-06-23 Thread Andreas Krebbel
gcc/ChangeLog: * config/s390/s390.c (s390_legitimate_constant_p): Add TARGET_VX check. --- gcc/config/s390/s390.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 934f7c0..859ed68 100644 --- a/gcc/config

[PATCH 8/8] S/390: Switch mode attribute to bhfgq for vec scatter patterns.

2015-06-23 Thread Andreas Krebbel
This fixes the mode attribute used in the vec scatter insn definitions. vec_scatter_element_ and vec_scatter_element_SI were using gf mode attribute which does not support vector modes. gcc/ChangeLog: * config/s390/vx-builtins.md ("vec_scatter_element_") ("vec_scatter_ele

[PATCH 5/8] S/390: Remove internal builtins from vecintrin.h.

2015-06-23 Thread Andreas Krebbel
This patch removes a couple for builtin definitions from the vecintrin.h file which are supposed to be used only internally. gcc/ChangeLog: * config/s390/vecintrin.h: Remove internal builtins. --- gcc/config/s390/vecintrin.h | 35 --- 1 file changed, 35

[PATCH 0/8] S/390: z13 support fixes and improvements

2015-06-23 Thread Andreas Krebbel
Hi, the following patchset consists of minor improvements and fixes. The most notable change is the conditional builtin creation patch which tries to limit a lot of the builtin initialization work to -march=z13. It also includes the GNU vector ABI attribute patch from the original series which I

[PATCH 4/8] S/390: Fix s390_secondary_reload register class check.

2015-06-23 Thread Andreas Krebbel
The current check does not work as expected with mixed register classes and also does not handle NO_REGS correctly. gcc/ChangeLog: * config/s390/s390.c (s390_secondary_reload): Fix check for GENERAL_REGS register class. --- gcc/config/s390/s390.c |2 +- 1 file changed, 1 inse

[PATCH 1/8] S/390 Vector ABI GNU Attribute.

2015-06-23 Thread Andreas Krebbel
With this patch .gnu_attribute is used to mark binaries with a vector ABI tag. This is required since the z13 vector support breaks the ABI of existing vector_size attribute generated vector types: 1. vector_size(16) and bigger vectors are aligned to 8 byte boundaries (formerly vectors were alway

[PATCH 7/8] S/390: Add proper comments to vpopct builtins for automated testsuite generation.

2015-06-23 Thread Andreas Krebbel
This is a comment only change which is supposed to be used by the autogenerated tests I run for the builtins. gcc/ChangeLog: * config/s390/s390-builtins.def: Fix vpopct instruction comments. --- gcc/config/s390/s390-builtins.def | 26 +- 1 file changed, 13 inser

<    1   2