This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Are arrays guaranteed to be affected by a "memory" clobber?
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Sebastian <sebastianspublicaddress at googlemail dot com>
- Cc: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Thu, 11 Jun 2015 23:52:58 +0100
- Subject: Re: Are arrays guaranteed to be affected by a "memory" clobber?
- Authentication-results: sourceware.org; auth=none
- References: <20150610224600 dot 00007d52 at unknown> <55796F33 dot 5070704 at redhat dot com> <20150611233856 dot 00007ddc at unknown>
On 11 June 2015 at 22:38, Sebastian wrote:
> On Thu, 11 Jun 2015 12:21:23 +0100 Andrew Haley wrote:
>> or one of the __atomic fences.
> As far as I can see, you can only use them on integers or pointers, but not on arrays.
You don't use a fence on anything, an atomic fence is a
synchronization operation without any associated memory location.
It provides the memory ordering guarantees without being used on a variable.