This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [powerpc64le] seq_cst memory order possibly not honored
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Andrey Semashev <andrey dot semashev at gmail dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Fri, 14 Aug 2015 09:51:19 +0100
- Subject: Re: [powerpc64le] seq_cst memory order possibly not honored
- Authentication-results: sourceware.org; auth=none
- References: <55CD3833 dot 2080002 at gmail dot com>
On 14 August 2015 at 01:37, Andrey Semashev wrote:
> 1. Is my test valid or is there a flaw that I'm missing?
The cppmem tool at http://svr-pes20-cppmem.cl.cam.ac.uk/cppmem/ shows
that there are consistent executions where (x==0 && y==0) is true. I
used this code:
int main() {
atomic_int a = 0;
atomic_int b = 0;
int x, y;
{{{
{
a.store(1,mo_seq_cst);
a.load(mo_relaxed);
x = b.load(mo_relaxed);
}
|||
{
b.store(1, mo_seq_cst);
b.load(mo_relaxed);
y = a.load(mo_relaxed);
}
}}}
return 0;
}