This is the mail archive of the gcc@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: linux says it is a bug


On Tue, Mar 04, 2014 at 12:08:19PM +0100, Richard Biener wrote:
> On Tue, Mar 4, 2014 at 10:33 AM, Hannes Frederic Sowa
> <hannes@stressinduktion.org> wrote:
> > On Tue, Mar 04, 2014 at 09:26:31AM +0000, Andrew Haley wrote:
> >> On 03/04/2014 09:24 AM, Hannes Frederic Sowa wrote:
> >> >> > So the bug was probably fixed more than 15 years ago.
> >> > Probably :)
> >> >
> >> > But the __volatile__ shoud do no harm and shouldn't influence code
> >> > generation in any way, no?
> >>
> >> Of course it will: it's a barrier.
> >
> > Sure. My question was about the volatile marker. asm("":::"memory") should act
> > as the barrier alone.
> 
> __asm__("":::"memory")
> 
> is a memory barrier
> 
> volatile __asm__("":::"memory")
> 
> is a memory barrier and a barrier for other volatile instructions.
> 
> Nothing more, nothing less.
> 
> Neither is a "optimization barrier" or "compiler barrier" or whatever
> name you invent.

Being a bit more familiar with the kernel code I often think about a
memory barrier as "fencing" instruction.

Thanks for the clarification,

  Hannes


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