clobber list in inline assembly for calls
Ian Lance Taylor
iant@google.com
Sat Jan 8 05:24:00 GMT 2011
Daniel Mierswa <impulze@impulze.org> writes:
> On 08.01.2011 05:50, Ian Lance Taylor wrote:
>> You are correct: you have to list all the caller-saved registers in the
>> clobber list. On 32-bit x86 this is all the registers other than %ebp,
>> %ebx, %edi and %esi.
>>
>> Ian
>
> If I'm not mistaken that should leave eax, ecx and edx. What about "cc"
> and "memory" though?
Good point, yes, you should add an explicit "memory" clobber. You don't
need to explicitly clobber "cc". That is a fixed register (actually gcc
calls it "flags") and as such gcc won't make any particular assumptions
about it in any case.
Ian
More information about the Gcc-help
mailing list