This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Assigning registers to variables in inlines
- To: "Timothy J. Wood" <tjw at omnigroup dot com>
- Subject: Re: Assigning registers to variables in inlines
- From: Fergus Henderson <fjh at cs dot mu dot oz dot au>
- Date: Wed, 10 Jan 2001 15:08:40 +1100
- Cc: gcc at gcc dot gnu dot org
- References: <200101100115.RAA06777@scyther.omnigroup.com>
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.