This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Is "memory" clobber required for all inline asm which does atomic operation???
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: "Ashok.A" <ashok_kumar_ak at yahoo dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: 15 Jun 2004 17:06:09 -0300
- Subject: Re: Is "memory" clobber required for all inline asm which does atomic operation???
- Organization: Red Hat Global Engineering Services Compiler Team
- References: <20040611114919.93941.qmail@web12001.mail.yahoo.com>
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}