lkml.org 
[lkml]   [2016]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -v2 14/33] locking,m68k: Implement atomic_fetch_{add,sub,and,or,xor}()

On Mon, 20 Jun 2016, Andreas Schwab wrote:

> Peter Zijlstra <peterz@infradead.org> writes:
>
> > Could either of you comment on the below patch?
> >
> > All atomic functions that return a value should imply full memory
> > barrier semantics -- this very much includes a compiler barrier /
> > memory clobber.
>
> I wonder if it is possible to find a case where this makes a real
> difference, ie. where the compiler erroneously reused a value due to the
> missing barrier.

What the compiler does erroneously is a compiler bug by definition. But I
think that was not what you meant.

Perhaps you're asking whether gcc in particular does what you expect,
despite ambiguous source code. But what about other tools like static
analyzers?

Ambiguous code is likely to attract patches like this for as long as it
remains ambiguous. That's a waste of everyone's time, if patches like this
could be written and reviewed just once.

--

>
> Andreas.
>
>

\
 
 \ /
  Last update: 2016-06-21 07:01    [W:0.073 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site