On Wed, 9 Jun 2010, Artem Shinkarov wrote: > It should be addressable, but register keyword disallows it. To solve > this problem I modify c-decl.c:start_decl like this:
I think that's too early, since you still want "&vector" (explicitly taking the address) to be rejected for a vector with register storage class. I don't claim it's optimal, but Andrew Pinski's patch handles marking vectors addressable even when they have the register storage class. > But still I have an example that does not work: > struct vec_s { > vector short member; > }; > > int main () { > register struct vec_s v2; > v2.member[2] = 4; > return 0; > } > > The question is should it work at all? And what would be the optimal > way to implement it? If you allow subscripting register vectors, then surely this case should work as well. -- Joseph S. Myers jos...@codesourcery.com