This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Problem with reordering of memory accesses
- To: Michael Schwingen <michaels at stochastik dot rwth-aachen dot de>
- Subject: Re: Problem with reordering of memory accesses
- From: Hartmut Schirmer <hartmut dot schirmer at arcormail dot de>
- Date: Tue, 17 Oct 2000 18:44:46 +0200
- Cc: gcc at gcc dot gnu dot org
- References: <20001017140250.A10784@draco.stochastik.rwth-aachen.de>
- Reply-To: hartmut dot schirmer at arcormail dot de
On Tue, 17 Oct 2000, Michael Schwingen wrote:
>How do I ensure that the writes occur in the specified order?
Use a memory barrier:
p->x4 = 0x12345678;
__asm__ volatile("":::"memory");
p->x2 = 0x87654321;
GCC should move a memory access across the asm statement.
Hartmut