This is the mail archive of the gcc-patches@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: [v3 RFC] PATCH to memory asm ops in atomicity.h


On Tue, Dec 16, 2003 at 09:00:01PM -0500, Jason Merrill wrote:
> They're used for atomic access to a particular memory location.  Why isn't
> it enough to specify that location directly?

If that is *all* they are used for, then fine.  But if an
atomic increment is used to implement a mutex, then it is
not fine.

> Note also that the asms are marked volatile, which should prevent
> scheduling across them.

That only applies to scheduling.  Not to cse or load-store motion or
any other optimization that shouldn't cross a thread synchronization
point.


r~


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