Is "memory" clobber required for all inline asm which does atomic operation???
Alexandre Oliva
aoliva@redhat.com
Tue Jun 15 20:06:00 GMT 2004
On Jun 11, 2004, "Ashok.A" <ashok_kumar_ak@yahoo.com> wrote:
> * Should we use "memory" clobber in *every* inline asm
> which does atomic operation?
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.
It might be a good idea to mark atomic operations implemented with asm
statements as volatile, though, such that GCC doesn't schedule them
around the very bits they're meant to protect.
--
Alexandre Oliva http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}
More information about the Gcc
mailing list