This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: clobber list in inline assembly for calls
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