lkml.org 
[lkml]   [1996]   [May]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
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.079 / U:2.436 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site