What happens with __attribute__((vector_size(8))) short a = {1, -1};?

Aldy Hernandez aldyh@redhat.com
Thu Jun 19 14:28:00 GMT 2003


>>>>> "Kazu" == Kazu Hirata <kazu@cs.umass.edu> writes:

 > Hi Andrew,
 >> > When the vector size and the amount of initialization do not match like
 >> >
 >> >   __attribute__((vector_size(8))) short a = {1, -1};
 >> >
 >> > what is supposed to happen?  Is the initialization assumed to be like 
 >> > so?
 >> >
 >> 
 >> This one, just like structs work:
 >> >   {1, -1, 0, 0}

It's supposed to initialize the non existing elements to zero.

I just tried it and it seems like it's horribly broken though.

I'm getting:

(const_vector:V2SI [
        (const_int 1 [0x1])
        (nil)
    ])

...for a partial initialization of a V2SI value, which is completely bogus.

 > Thank you for a quick reply.  Do you happen to know where this
 > assumption is implemented?  I am in the middle of debugging the
 > failure of compile/20000804-1.c on H8.

This assumption should have been implemented in
const_vector_from_tree().

I'll take a look.



More information about the Gcc mailing list