On 15 June 2012 18:18, Marc Glisse <marc.gli...@inria.fr> wrote:
> On Fri, 15 Jun 2012, Ramana Radhakrishnan wrote:
>
>>> I just noticed this part. Rereading my comment in
>>>
>>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033#c22
>>
>>
>> I haven't been able to make it break with -std=c++11 . Is there
>> something I'm missing here ?
>
>
> I don't remember. It might just be that trying to create a constexpr vector
> variable or calling __builtin_shuffle on it ICEs instead of giving an error.
> I can keep a note to make some tests at the end of July (I will be mostly
> away until then), but I believe the code from comment 22 is safer than the
> one from comment 20, if memory serves.

I'm not qualified enough to take a call on what's better in this case
and will have to defer to Jason and the C++ maintainers on this one.

Now that you've said this I decided to go back and throw more tests through it
I've tried to chug through most of the testcases for __builtin_shuffle
including a few of my own the simplest of which I show below trying to
trigger this issue but can't seem to do so.

typedef int v4si __attribute__ ((vector_size (16)));
v4si c;
const v4si d = (v4si) { 10, 11, 23, 33};
v4si vs (v4si a, v4si b)
{
  c =  __builtin_shuffle (a, b, (v4si){0, 4, 1, 5});
  return a;
}

Ofcourse it is not complicated C++ in any which way but  the frontend
ends up generating something like the following

  (void) (c =  VEC_PERM_EXPR < a , b , TARGET_EXPR <D.5209, {0, 4, 1,
5}> > ) >>>>>;


rather than anything else but I could be missing something fundamental
here if that's not what you expect the C++ frontend to be doing.


regards,
Ramana

>
> --
> Marc Glisse

Reply via email to