This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: spin_lock forgets to clobber memory and other smp fixes [was Re: [patch] waitqueue optimization, 2.4.0-test7]
- To: Andrea Arcangeli <andrea at suse dot de>
- Subject: Re: spin_lock forgets to clobber memory and other smp fixes [was Re: [patch] waitqueue optimization, 2.4.0-test7]
- From: Jamie Lokier <egcs at tantalophile dot demon dot co dot uk>
- Date: Thu, 7 Sep 2000 19:14:28 +0200
- Cc: "David S. Miller" <davem at redhat dot com>, Ingo Molnar <mingo at elte dot hu>, Linus Torvalds <torvalds at transmeta dot com>, linux-kernel at vger dot kernel dot org, gcc at gcc dot gnu dot org
- References: <20000907183941.A22962@pcep-jamie.cern.ch> <Pine.LNX.4.21.0009071843170.8600-100000@inspiron.random>
Andrea Arcangeli wrote:
> Said that if your compiler puts the read before the spin_lock without the
> memory clobber, it is allowed to do that, and in such case you would proof
> it was a real world bug (not just a "documentation" one).
Yes, it does.
> Or maybe your testcase was a bit different then mine, in such case please
> send it to me (I'm curious indeed :).
int *p;
int func()
{
int x = *p;
__asm__ __volatile ("zzz" : :);
x = *p;
return x;
}
In output:
.ident "GCC: (GNU) 2.96 20000724 (experimental)"
From the Red Hat 7 beta.
-- Jamie