https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65697

--- Comment #9 from Matthew Wahab <matthew.wahab at arm dot com> ---
(In reply to Jonathan Wakely from comment #8)
> (In reply to Matthew Wahab from comment #7)
> > I agree that this wouldn't affect valid C11 code (because of data-races) but
> > my understanding is that __sync builtins don't require a C11 model. The
> 
> You say that like it's a good thing :-)
> 
> They don't require a memory model only because there wasn't a cross-platform
> one that existed at the time.

That's certainly changed, I'm not sure its made things any simpler though.

> It seems unsurprising to me that you'll get different behaviour when trying
> to use a program written with no formal memory model on platforms with
> different memory models.

I don't think it's the programs that are at fault here. I'd expect programs to
only rely on what the documentation tells them to expect, so, if the manual
says that something is a full barrier, it seems reasonable for code to assume a
full barrier will be provided.

Reply via email to