This is the mail archive of the
mailing list for the GCC project.
Re: Is "memory" clobber required for all inline asm which does atomic operation???
On Tue, Jun 15, 2004 at 05:06:09PM -0300, Alexandre Oliva wrote:
> You should use "memory" clobber if the asm statement modifies memory
> that is not otherwise passed as an output operand to the asm
> statement. That's about it. It doesn't matter if you're doing atomic
> operations or not.
Not true. Memory clobbers are also used to force the data
being protected by the lock back to memory. A volatile asm
is not sufficient as a scheduling barrier.