more than 10 operands in `asm'

Robert Harley
Tue Nov 3 09:38:00 GMT 1998

Hope this isn't a FAQ...

I suppose we've all seen the "more than 10 operands in `asm'" error
message from time to time.

How about upping the limit from 10 to something more reasonable?

On Alpha we have 32 each of integer and float registers.  On ARM we
can run out with a single instruction!:

     U32 a,b,c,d,e,f,g,h,i, *p;

     asm ( "ldmia %0!, { %2,%3,%4,%5,%6,%7,%8,%9,%10 }"
         : "=r"(p)
         : "0"(p), "r"(a), "r"(b), "r"(c), "r"(d), "r"(e), "r"(f), "r"(g)
           , "r"(h), "r"(i)
         : "memory"

A limit of 10 often restricts inline ASM to trivial snippets of code,
especially as in & out registers get counted twice.  The patch is
probably a one-liner somewhere.


More information about the Gcc-bugs mailing list