Mail Archives: djgpp/1994/03/15/16:59:03
It turned out not to be a bug. When listing clobbered registers in an asm()
statement, no percent-signs ("%") should be used to name the registers.
If percent-signs are used, gcc will not complain but it will ignore the
clobbered register list. The manual is confusing on this, so I thought this
potential pitfall should be posted to the list. Thanks to Dieter Buerssner
for this info.
The corrected example follows:
void foo()
{
asm(
"movl $0,%%edi
movl $0,%%esi
movl $0,%%ebx"
:: "b" (5), "S" (10)
: "ebx", "esi", "edi", "cc");
}
--
----------------------------------------------------------------------
: Christopher : Huntington Beach California, USA :
: Christensen : email: cnc AT netcom DOT com :
----------------------------------------------------------------------
- Raw text -