This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Vector subscription, register storage class


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
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]