This is the mail archive of the gcc-help@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: why the barrier() can not take effect?


> I don't know why you'd expect a difference, really. ?Try this:

I just want to know precisely what measures the gcc take when a asm
statement including a clobber of "memory", rather merely than a
general description in the gcc manual. In Linux kernel code, the
barrier() appears frequently in some kernel funcitons. So, I wish to
get the exactly meaning of the barrier().

> int s = 0;

So, just the variables which might be modified by some outer code
unpredictable, such as interrupt handlers, other processes, etc, will
be given more cares by the gcc. But, we need not to worry about
whether or not a local variable in some function is consistent with
the corresponding register, because it is impossible that a local
variable will be modified outside the current code. Is that true?


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