This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: doc patch for memory clobbers in ASM
- To: Geoff Keating <geoffk at cygnus dot com>
- Subject: Re: doc patch for memory clobbers in ASM
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Mon, 17 Jul 2000 04:19:38 -0600
- cc: gcc-patches at gcc dot gnu dot org
- Reply-To: law at cygnus dot com
In message <200006262018.NAA00408@localhost.cygnus.com>you write:
>
> At present, gcc will still perform folding, loop hoisting, etc. on
> asm statements which clobber "memory" but are not volatile; for
> instance,
>
> int main(void)
> {
> int t, i, z = 1;
> for (i = 0; i < 10; i++)
> asm ("# do something with memory and %0" : "=r"(t) : "r"(&z) : "memory"
> );
> return z;
> }
>
> gets folded down to an empty loop. This patch documents this
> behaviour. The alternative would be to change it, but it needs to be
> changed in lots of places; for instance, single_set needs to be taught
> that the asm above isn't a single set, and so on.
>
> Is this OK?
>
> --
> - Geoffrey Keating <geoffk@cygnus.com>
>
> ===File ~/patches/cygnus/asm-memclobberdoc.patch============
> 2000-06-26 Geoff Keating <geoffk@cygnus.com>
>
> * extend.texi (Extended Asm): Mention that a memory clobber
> does not count as a side-effect.
This is fine by me.
jeff