This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]