[C++ PATCH 2/3] Support implicit parameter packs.

2013-11-02 Thread Adam Butcher
* parser.c (convert_generic_types_to_packs): New function to transform a range of implicitly introduced non-pack template parms to be parameter packs. (cp_parser_parameter_declaration_list): If a function parameter pack contains generic types, convert them

Re: [SKETCH] Refactor implicit function template implementation and fix 58534, 58536, 58548, 58549 and 58637.

2013-11-02 Thread Adam Butcher
Hi Jason, I've got the tsubst solution for implicit parameter packs working now. I've also improved the efficiency of incremental template parameter synthesis and added some testcases. All C++14 generic lambda examples pass and no new regressions. Cheers, Adam Patch summary (3): Refactor

[C++ PATCH 3/3] Add some generic lambda test cases.

2013-11-02 Thread Adam Butcher
gcc/testsuite/g++.dg/cpp1y/ * lambda-generic.C: New test case. * lambda-generic-cfun.C: New test case. * lambda-generic-dep.C: New test case. * lambda-generic-udt.C: New test case. * lambda-generic-variadic.C: New

[C++ PATCH 1/3] Refactor implicit function template implementation and fix 58534, 58536, 58548, 58549 and 58637.

2013-11-02 Thread Adam Butcher
gcc/ * tree.c (grow_tree_vec_stat): New function ... * tree.h (grow_tree_vec_stat) (grow_tree_vec): ... and its declaration and macro front-end. gcc/cp/ PR c++/58534 PR c++/58536 PR c++/58548 PR c++/58549 PR c++/58637 *

[wide-int] Fix aarch{32,64} builds

2013-11-02 Thread Richard Sandiford
I decided to lump these together since the problems were the same. There were some typos in the real_to_integer invocation, while changing: /* There must be no padding. */ if (!host_integerp (TYPE_SIZE (type), 1) || (tree_low_cst (TYPE_SIZE (type), 1)

[wide-int] Fix inverted bfin test

2013-11-02 Thread Richard Sandiford
A test for size 8 had got inverted. Tested on bfin-elf and applied as obvious. Thanks, Richard Index: gcc/config/bfin/bfin.c === --- gcc/config/bfin/bfin.c (revision 204311) +++ gcc/config/bfin/bfin.c (working copy) @@

[wide-int] Fix exact_log2 zext test

2013-11-02 Thread Richard Sandiford
...which I'd fluffed when doing the wi:: conversion. Tested on powerpc64-linux-gnu and x86_64-linux-gnu. It fixed a spurious gcc.dg difference on alpha-linux-gnu. Applied as obvious. Thanks, Richard Index: gcc/wide-int.cc ===

[wide-int] Fix mask inversions in expand_copysign_bit

2013-11-02 Thread Richard Sandiford
At some point the original ~s got straightened to -s. Tested on powerpc64-linux-gnu and x86_64-linux-gnu. This fixed a testsuite difference in bfin-elf. Applied as obvious. Thanks, Richard Index: gcc/optabs.c === ---

[wide-int] Do not treat rtxes as sign-extended

2013-11-02 Thread Richard Sandiford
Bah. After all that effort, it turns out that -- by design -- there is one special case where CONST_INTs are not sign-extended. Nonzero/true BImode integers are stored as STORE_FLAG_VALUE, which can be 1 rather than -1. So (const_int 1) can be a valid BImode integer -- and consequently

Re: [wide-int] Do not treat rtxes as sign-extended

2013-11-02 Thread Mike Stump
On Nov 2, 2013, at 3:30 AM, Richard Sandiford rdsandif...@googlemail.com wrote: Bah. After all that effort, it turns out that -- by design -- there is one special case where CONST_INTs are not sign-extended. I'm thinking this needs commentary in wide-int.h, though, not sure what we'd say...

[wide-int] Another tweak to convert_modes

2013-11-02 Thread Richard Sandiford
It turns out that when doing a vector shift by 2, the optab routine passes (const_int 2) to convert_modes with oldmode set to the mode of the shift (e.g. something like V8HI). When the target mode is a real integer mode like SImode, mainline just ignores that oldmode and returns a (const_int 2)

[wide-int] doloop fixes

2013-11-02 Thread Richard Sandiford
The first part of this is a simple type mismatch -- get_max_loop_iterations returns a widest_int aka max_wide_int -- and I'd have installed it as obvious. The second part isn't as obvious though. The old code stored the maximum iterations as: if (!get_max_loop_iterations (loop, iter) ||

[wide-int] Fix fold_ternary VEC_PERM_EXPR handling

2013-11-02 Thread Richard Sandiford
The wide-int conversion for the fold_ternary VEC_PERM_EXPR case converted a mask of valid element numbers to an element count, which is one greater. The old code set need_mask_canon if an index was greater than the mask, but the new code sets it if an index is greater than the element count,

Re: [wide-int] Do not treat rtxes as sign-extended

2013-11-02 Thread Richard Sandiford
Mike Stump mikest...@comcast.net writes: On Nov 2, 2013, at 3:30 AM, Richard Sandiford rdsandif...@googlemail.com wrote: Bah. After all that effort, it turns out that -- by design -- there is one special case where CONST_INTs are not sign-extended. I'm thinking this needs commentary in

[PATCH, i386]: Introduce Ts and Tv address constraints

2013-11-02 Thread Uros Bizjak
Hello! These two constraints go together with address_no_seg_operand and vsib_address_operand operand predicates. 2013-11-02 Uros Bizjak ubiz...@gmail.com * config/i386/constraints.md (Ts, Tv): New address constrains. * config/i386/i386.md (*leamode, *mode_bndcheck): Use Ts

[wide-int] Make shifted_mask more forgiving

2013-11-02 Thread Richard Sandiford
r201806 added some extra checks to the handling of CONCAT when expanding assignments. This was to fix an ICE on gcc.dg/pr48335-2.c for ppc. I tripped over this because it also causes the assembly output for the test to change. I tried backing out the patch and the ICE was from the assert in

[gomp4] fix simd clones with no return value

2013-11-02 Thread Aldy Hernandez
The second testcase currently ICEs I guess during simd cloning, just wanted to make it clear that while simd clones without any arguments probably don't make any sense (other than const, but those really should be hoisted out of the loop much earlier), simd clones with no return value make sense.

Re: [PATCH][ubsan] Add VLA bound instrumentation

2013-11-02 Thread Marek Polacek
On Fri, Nov 01, 2013 at 04:39:09PM -0400, Jason Merrill wrote: On 11/01/2013 03:10 PM, Marek Polacek wrote: + /* We need to stabilize side-effects in VLA sizes for regular array + declarations too, not just pointers to arrays. */ This comment isn't really relevant to its new

[gomp4] mangle linear step of 1 with just 'l'

2013-11-02 Thread Aldy Hernandez
Hi Jakub. Your patch mangling negative linear steps caused a regression in simd-clones-2.c. Well, it already had a failure, but now it has two :). The problem is that AFAIU, a linear step of 1, is mangled with just 'l', not 'l1'. I am not completely sure of this, and was hoping Balaji

Re: [wide-int] Fix aarch{32,64} builds

2013-11-02 Thread Kenneth Zadeck
I always like patches that change host dependencies into more general code. ok from my perspective. kenny On 11/02/2013 06:13 AM, Richard Sandiford wrote: I decided to lump these together since the problems were the same. There were some typos in the real_to_integer invocation, while

Re: [wide-int] Fix exact_log2 zext test

2013-11-02 Thread Kenneth Zadeck
On 11/02/2013 06:19 AM, Richard Sandiford wrote: ...which I'd fluffed when doing the wi:: conversion. Tested on powerpc64-linux-gnu and x86_64-linux-gnu. It fixed a spurious gcc.dg difference on alpha-linux-gnu. Applied as obvious. Thanks, Richard Index: gcc/wide-int.cc

Re: [wide-int] Do not treat rtxes as sign-extended

2013-11-02 Thread Kenneth Zadeck
On 11/02/2013 06:30 AM, Richard Sandiford wrote: Bah. After all that effort, it turns out that -- by design -- there is one special case where CONST_INTs are not sign-extended. Nonzero/true BImode integers are stored as STORE_FLAG_VALUE, which can be 1 rather than -1. So (const_int 1) can be a

Re: [wide-int] Another tweak to convert_modes

2013-11-02 Thread Kenneth Zadeck
On 11/02/2013 06:48 AM, Richard Sandiford wrote: It turns out that when doing a vector shift by 2, the optab routine passes (const_int 2) to convert_modes with oldmode set to the mode of the shift (e.g. something like V8HI). When the target mode is a real integer mode like SImode, mainline just

Re: [wide-int] doloop fixes

2013-11-02 Thread Kenneth Zadeck
On 11/02/2013 07:06 AM, Richard Sandiford wrote: The first part of this is a simple type mismatch -- get_max_loop_iterations returns a widest_int aka max_wide_int -- and I'd have installed it as obvious. The second part isn't as obvious though. The old code stored the maximum iterations as:

Re: [wide-int] Make shifted_mask more forgiving

2013-11-02 Thread Kenneth Zadeck
this is fine with me. kenny On 11/02/2013 07:52 AM, Richard Sandiford wrote: r201806 added some extra checks to the handling of CONCAT when expanding assignments. This was to fix an ICE on gcc.dg/pr48335-2.c for ppc. I tripped over this because it also causes the assembly output for the test

Re: [wide-int] Fix fold_ternary VEC_PERM_EXPR handling

2013-11-02 Thread Kenneth Zadeck
On 11/02/2013 07:14 AM, Richard Sandiford wrote: The wide-int conversion for the fold_ternary VEC_PERM_EXPR case converted a mask of valid element numbers to an element count, which is one greater. The old code set need_mask_canon if an index was greater than the mask, but the new code sets it

Re: [wide-int] Do not treat rtxes as sign-extended

2013-11-02 Thread Richard Sandiford
Kenneth Zadeck zad...@naturalbridge.com writes: On 11/02/2013 06:30 AM, Richard Sandiford wrote: Bah. After all that effort, it turns out that -- by design -- there is one special case where CONST_INTs are not sign-extended. Nonzero/true BImode integers are stored as STORE_FLAG_VALUE, which

Re: [wide-int] doloop fixes

2013-11-02 Thread Richard Sandiford
Kenneth Zadeck zad...@naturalbridge.com writes: On 11/02/2013 07:06 AM, Richard Sandiford wrote: The first part of this is a simple type mismatch -- get_max_loop_iterations returns a widest_int aka max_wide_int -- and I'd have installed it as obvious. The second part isn't as obvious though.

Re: [wide-int] Do not treat rtxes as sign-extended

2013-11-02 Thread Kenneth Zadeck
On 11/02/2013 10:25 AM, Richard Sandiford wrote: Kenneth Zadeck zad...@naturalbridge.com writes: On 11/02/2013 06:30 AM, Richard Sandiford wrote: Bah. After all that effort, it turns out that -- by design -- there is one special case where CONST_INTs are not sign-extended. Nonzero/true BImode

Re: [wide-int] doloop fixes

2013-11-02 Thread Kenneth Zadeck
On 11/02/2013 10:47 AM, Richard Sandiford wrote: Kenneth Zadeck zad...@naturalbridge.com writes: On 11/02/2013 07:06 AM, Richard Sandiford wrote: The first part of this is a simple type mismatch -- get_max_loop_iterations returns a widest_int aka max_wide_int -- and I'd have installed it as

Re: [PATCH, rs6000] Fix rs6000_expand_vector_set for little endian

2013-11-02 Thread David Edelsohn
On Thu, Oct 31, 2013 at 9:45 PM, Bill Schmidt wschm...@linux.vnet.ibm.com wrote: Hi, Brooks Moses reported a bug with code that sets a single element of a vector to a given value and the rest of the vector to zero. This is implemented in rs6000_expand_vector_set, which uses a vperm

Re: [wide-int] doloop fixes

2013-11-02 Thread Richard Sandiford
Kenneth Zadeck zad...@naturalbridge.com writes: On 11/02/2013 10:47 AM, Richard Sandiford wrote: Kenneth Zadeck zad...@naturalbridge.com writes: On 11/02/2013 07:06 AM, Richard Sandiford wrote: The first part of this is a simple type mismatch -- get_max_loop_iterations returns a widest_int

Re: [gomp4] mangle linear step of 1 with just 'l'

2013-11-02 Thread Jakub Jelinek
On Sat, Nov 02, 2013 at 08:25:28AM -0500, Aldy Hernandez wrote: Your patch mangling negative linear steps caused a regression in simd-clones-2.c. Well, it already had a failure, but now it has two :). The problem is that AFAIU, a linear step of 1, is mangled with just 'l', not 'l1'. I

Re: [Patch, fortran] PR57445 - [4.8/4.9 Regression] ICE in gfc_conv_class_to_class - for OPTIONAL polymorphic array

2013-11-02 Thread Steve Kargl
On Fri, Nov 01, 2013 at 04:56:36PM +0100, Paul Richard Thomas wrote: This one is trivial. The ICE was caused by an assert that turns out to be spurious and has been removed. Bootstrapped and regtested on FC17/x86_64 - OK for trunk and 4.8? OK. -- Steve

Re: libsanitizer merge from upstream r191666

2013-11-02 Thread Jack Howarth
On Fri, Nov 01, 2013 at 04:13:05PM -0700, Konstantin Serebryany wrote: Jukub, This works! New patch attached. Konstantin, This patch, when applied on top of r204305, bootstraps fine on x86_64-apple-darwin12 but produces a lot of regressions with... make -k check RUNTESTFLAGS=asan.exp

Re: [wide-int] doloop fixes

2013-11-02 Thread Kenneth Zadeck
On 11/02/2013 11:31 AM, Richard Sandiford wrote: Kenneth Zadeck zad...@naturalbridge.com writes: On 11/02/2013 10:47 AM, Richard Sandiford wrote: Kenneth Zadeck zad...@naturalbridge.com writes: On 11/02/2013 07:06 AM, Richard Sandiford wrote: The first part of this is a simple type mismatch

Re: [wide-int] doloop fixes

2013-11-02 Thread Richard Sandiford
Kenneth Zadeck zad...@naturalbridge.com writes: On 11/02/2013 11:31 AM, Richard Sandiford wrote: Kenneth Zadeck zad...@naturalbridge.com writes: On 11/02/2013 10:47 AM, Richard Sandiford wrote: Kenneth Zadeck zad...@naturalbridge.com writes: On 11/02/2013 07:06 AM, Richard Sandiford wrote:

Re: [Patch] Implementation of n3793 experimental/optional

2013-11-02 Thread Luc Danton
On 2013-11-01 21:46, Paolo Carlini wrote: Hi, Il giorno 01/nov/2013, alle ore 21:09, Jonathan Wakely jwakely@gmail.com ha scritto: Here's the final version of Luc's optional implementation that I'm committing, tested on x86_64-linux. Great. Just noticed a minor nit: the fallback

Re: [Patch] Implementation of n3793 experimental/optional

2013-11-02 Thread Paolo Carlini
Can you expand? I think it's just as much inline as the other overload -- does it need to be different? The other overload is constexpr thus it's implicitly inline. The fall back is very simple too and I think it should be declared inline, unless you analyzed the assembly and believe it

Re: [wide-int] doloop fixes

2013-11-02 Thread Kenneth Zadeck
On 11/02/2013 01:51 PM, Richard Sandiford wrote: Kenneth Zadeck zad...@naturalbridge.com writes: On 11/02/2013 11:31 AM, Richard Sandiford wrote: Kenneth Zadeck zad...@naturalbridge.com writes: On 11/02/2013 10:47 AM, Richard Sandiford wrote: Kenneth Zadeck zad...@naturalbridge.com writes:

Re: [Patch] Implementation of n3793 experimental/optional

2013-11-02 Thread Luc Danton
On 2013-11-02 19:02, Paolo Carlini wrote: Can you expand? I think it's just as much inline as the other overload -- does it need to be different? The other overload is constexpr thus it's implicitly inline. The fall back is very simple too and I think it should be declared inline, unless you

Re: [Patch] Implementation of n3793 experimental/optional

2013-11-02 Thread Paolo Carlini
Hi I see. It didn't occur to me to declare it inline, as I only ever use the keyword to satisfy ODR requirements. E.g. the non-member swap isn't declared inline either. For future reference, is there a rule of thumb in use? In general we are very careful with code bloat, but free functions

LRA vs reload on powerpc: 2 extra FAILs that are actually improvements?

2013-11-02 Thread Steven Bosscher
Hello, Today's powerpc64-linux gcc has 2 extra failures with -mlra vs. reload (i.e. svn unpatched). (I'm excluding guality failure differences here because there are too many of them that seem to fail at random after minimal changes anywhere in the compiler...). Test results are posted here:

Re: lto-plugin: mismatch between ld's architecture and GCC's configure --host

2013-11-02 Thread Thomas Schwinge
Hi! Ping. On Fri, 25 Oct 2013 09:23:24 +0200, I wrote: Ping. To sum it up, with these patches applied, there are no changes for a regular build (not using the new configure options). On the other hand, configuring GCC as described, it is possible use the 32-bit x86 linker for/with a

[PATCH, rs6000] Re-permute source register for postreload splits of VSX LE stores

2013-11-02 Thread Bill Schmidt
Hi, When I created the patch to split VSX loads and stores to add permutes so the register image was correctly little endian, I forgot to implement a known requirement. When a VSX store is split after reload, we must reuse the source register for the permute, which leaves it in a swapped state

Re: [Patch] Implementation of n3793 experimental/optional

2013-11-02 Thread Luc Danton
On 2013-11-02 23:31, Paolo Carlini wrote: In general we are very careful with code bloat, but free functions which just forward to other functions should be definiyely inline, otherwise typically at widely used optimization levels like -O2 users get suboptimal performance for no reason. But