[lkml]   [1996]   [May]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Is clobber "memory" in include/asm-i386/system.h necessary?
On Wed, 1 May 1996, Tom May wrote:

> In include/asm-i386/system.h there are numerous uses of __asm__ which
> clobber "memory". For reference, here they are:
> #define mb() __asm__ __volatile__ ("" : : :"memory")
> #define sti() __asm__ __volatile__ ("sti": : :"memory")
> #define cli() __asm__ __volatile__ ("cli": : :"memory")

> This clobber seems unnecessary since none of these instructions modify
> memory that gcc doesn't know about, and any memory that is modified by
> other means (hardware, interrupt handlers, etc.) is (should be?)
> accounted for in other ways such as by using volatile.

the "memory" option saves all register variables to memory .. so you will
have definit memory contents at that point. And i think it "atomizes" code
encosed in such "memory" options, no code will be optimized across this
boundary? ... not sure though ...

 \ /
  Last update: 2005-03-22 13:37    [W:0.074 / U:0.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site