Re: [C++] Fix __builtin_shuffle

2013-06-28 Thread Marc Glisse
On Fri, 28 Jun 2013, Marc Glisse wrote: It seems better to do the following, so we still test for extra warnings: -template void g (T) {} -template auto g (T x) -> typename enable_if::type {} +template void g (T const&) {} +template auto g (T const& x) -> typename enable_if::type {} I

Re: [C++] Fix __builtin_shuffle

2013-06-28 Thread Marc Glisse
On Fri, 28 Jun 2013, Jakub Jelinek wrote: Hi! On Thu, Jun 27, 2013 at 01:59:37PM +0200, Marc Glisse wrote: --- testsuite/g++.dg/ext/pr57509.C (revision 0) +++ testsuite/g++.dg/ext/pr57509.C (revision 0) @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-std=c++11" } */ + +t

Re: [C++] Fix __builtin_shuffle

2013-06-27 Thread Jakub Jelinek
Hi! On Thu, Jun 27, 2013 at 01:59:37PM +0200, Marc Glisse wrote: > --- testsuite/g++.dg/ext/pr57509.C(revision 0) > +++ testsuite/g++.dg/ext/pr57509.C(revision 0) > @@ -0,0 +1,16 @@ > +/* { dg-do compile } */ > +/* { dg-options "-std=c++11" } */ > + > +template struct enable_if {}; > +tem

Re: [C++] Fix __builtin_shuffle

2013-06-27 Thread Marc Glisse
On Thu, 27 Jun 2013, Marc Glisse wrote: On Thu, 27 Jun 2013, Jakub Jelinek wrote: On Thu, Jun 27, 2013 at 05:54:10PM +0200, Marc Glisse wrote: I don't really see why, as I am still calling c_build_vec_perm_expr in the same cases, just possibly not exactly with the same arguments (they don't g

Re: [C++] Fix __builtin_shuffle

2013-06-27 Thread Marc Glisse
On Thu, 27 Jun 2013, Jakub Jelinek wrote: On Thu, Jun 27, 2013 at 05:54:10PM +0200, Marc Glisse wrote: I don't really see why, as I am still calling c_build_vec_perm_expr in the same cases, just possibly not exactly with the same arguments (they don't go through build_non_dependent_expr, but Ja

Re: [C++] Fix __builtin_shuffle

2013-06-27 Thread Jakub Jelinek
On Thu, Jun 27, 2013 at 05:54:10PM +0200, Marc Glisse wrote: > I don't really see why, as I am still calling c_build_vec_perm_expr > in the same cases, just possibly not exactly with the same arguments > (they don't go through build_non_dependent_expr, but Jason seemed to > imply that it did not ma

Re: [C++] Fix __builtin_shuffle

2013-06-27 Thread Marc Glisse
On Thu, 27 Jun 2013, Jakub Jelinek wrote: On Thu, Jun 27, 2013 at 05:24:45PM +0200, Marc Glisse wrote: On Thu, 27 Jun 2013, Jason Merrill wrote: On 06/27/2013 07:59 AM, Marc Glisse wrote: I assume I can't call directly c_build_vec_perm_expr on the original arguments without build_non_depende

Re: [C++] Fix __builtin_shuffle

2013-06-27 Thread Jakub Jelinek
On Thu, Jun 27, 2013 at 05:24:45PM +0200, Marc Glisse wrote: > On Thu, 27 Jun 2013, Jason Merrill wrote: > > >On 06/27/2013 07:59 AM, Marc Glisse wrote: > >>I assume I can't call directly c_build_vec_perm_expr on the original > >>arguments without build_non_dependent_expr? > > > >It looks like c_b

Re: [C++] Fix __builtin_shuffle

2013-06-27 Thread Marc Glisse
On Thu, 27 Jun 2013, Jason Merrill wrote: On 06/27/2013 07:59 AM, Marc Glisse wrote: I assume I can't call directly c_build_vec_perm_expr on the original arguments without build_non_dependent_expr? It looks like c_build_vec_perm_expr is safe to take the original arguments, since it doesn't l

Re: [C++] Fix __builtin_shuffle

2013-06-27 Thread Jason Merrill
On 06/27/2013 07:59 AM, Marc Glisse wrote: I assume I can't call directly c_build_vec_perm_expr on the original arguments without build_non_dependent_expr? It looks like c_build_vec_perm_expr is safe to take the original arguments, since it doesn't look deep into the expression. So either wa

Re: [C++] Fix __builtin_shuffle

2013-06-27 Thread Marc Glisse
On Wed, 26 Jun 2013, Jason Merrill wrote: On 06/09/2013 07:09 AM, Marc Glisse wrote: + arg0 = build_non_dependent_expr (arg0); + arg1 = build_non_dependent_expr (arg1); + arg2 = build_non_dependent_expr (arg2); +} + return c_build_vec_perm_expr (loc, arg0, arg1, arg2, compla

Re: [C++] Fix __builtin_shuffle

2013-06-26 Thread Jason Merrill
On 06/09/2013 07:09 AM, Marc Glisse wrote: + arg0 = build_non_dependent_expr (arg0); + arg1 = build_non_dependent_expr (arg1); + arg2 = build_non_dependent_expr (arg2); +} + return c_build_vec_perm_expr (loc, arg0, arg1, arg2, complain & tf_error); This is wrong; the places

Re: [C++] Fix __builtin_shuffle

2013-06-26 Thread Marc Glisse
Ping http://gcc.gnu.org/ml/gcc-patches/2013-06/msg00470.html On Sun, 9 Jun 2013, Marc Glisse wrote: Hello, when porting __builtin_shuffle from C to C++, I ignored all the C++ specificities and added some extra bugs. This should improve things a bit. Bootstrap+testsuite on x86_64-linux-gnu.

[C++] Fix __builtin_shuffle

2013-06-09 Thread Marc Glisse
Hello, when porting __builtin_shuffle from C to C++, I ignored all the C++ specificities and added some extra bugs. This should improve things a bit. Bootstrap+testsuite on x86_64-linux-gnu. 2013-06-10 Marc Glisse PR c++/57509 gcc/c-family/ * c-common.h (c_build_vec_perm