This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Preserve volatileness, fix PR32721


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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]