This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Preserve volatileness, fix PR32721
- From: Diego Novillo <dnovillo at google dot com>
- To: Richard Guenther <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 13 Jul 2007 08:53:49 -0400
- Subject: Re: [PATCH] Preserve volatileness, fix PR32721
- References: <Pine.LNX.4.64.0707131449440.3955@zhemvz.fhfr.qr>
On 7/13/07 8:52 AM, Richard Guenther wrote:
> int spinlock[2];
> void foo()
> {
> volatile int *x = &spinlock[0];
> *x = 1;
> while (*x)
> ;
> }
>
> we managed to preserve the volatileness of the accesses through *x in
> previous releases. Now we don't, maybe as part of the change of
> early optimizations.
Hmm? AFAIU, *x is *not* volatile, only the pointer is. So, *x = 1
ought to be fair game.
Is this an extension or something undefined in the standard?