Assigning registers to variables in inlines

Fergus Henderson fjh@cs.mu.oz.au
Tue Jan 9 20:08:00 GMT 2001


On 09-Jan-2001, Timothy J. Wood <tjw@omnigroup.com> wrote:
> static inline unsigned int __lwbrx(register void *addr, register int 
> offset) {
>      register unsigned int word;
>      register unsigned int asm("r9") _offset = offset;
> 
>      asm("lwbrx %0,%2,%1" : "=r" (word) : "r" (addr), "r" (_offset));
>      return word;
> }
> 
> ...: parse error before `asm'

The right syntax is

	register unsigned int _offset asm("r9") = offset;

However, the solution that Jeffrey A. Law posted is a better solution.

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: < http://www.cs.mu.oz.au/~fjh >  |     -- the last words of T. S. Garp.


More information about the Gcc mailing list