Problem with extended asm clobber
Fri Dec 31 20:54:00 GMT 1999
Etienne LORRAIN wrote:
> Eric Rudd <rudd at cyberoptics dot com> wrote:
> > In gcc v2.95, a change was made in the way that gcc handles clobbered
> > registers in extended asm statements. It is discussed in the gcc FAQ:
> > http://www.gnu.org/software/gcc/faq.html#asmclobber
> > ...
> > but beyond the manifest awkwardness of the dummy variables (and the
> > re-numbering of existing arguments that it necessitates), there arises a
> > new problem: where there previously had been six operands, there are now
> > 11, and gcc now complains that it can't handle more than 10 operands to
> > an extended asm.
> I used this solution (the '+' instead of '='), for the same problem:
> unsigned input_output;
> input_output = 3;
> asm ( " xchg %0,addr " : "+r" (input_output) : ... );
> return input_output;
Although I can foresee circumstances where I might later need the original
values of the input operands (and thus the gcc limit of 10 operands still
ought to be increased), it happens that my immediate problem is with routines
that don't use the inputs later on, so this technique should get me unstuck.
More information about the Gcc-bugs