[lkml]   [2005]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: question on memory barrier

> > The sequence point argument is obviously wrong, BTW - if it were the
> > case that a mere sequence point required the compiler to have completed
> > all externally-visible side effects, then almost every optimization that
> > gcc does with -O2 would be impossible. CSE, loop splitting, etc.
> >
> > -andy
> Wrong. Reference:

This refers to externally visible in the view of _one_ cpu , not other
CPUs or other hardware on a bus.
Externally visible means by references to other routines.
In practice function calls.

m = a * b;
c += m;
d -= m;

is better than

c += (a * b);
d -= (a * b);

But this doesn't tell much more. The compiler is free to generate code that
acts like all values hit main memory at a ;. Only where it can't tell, it really
needs to write it out. Writes to memory may or may not be of that category,
it depends on how far aliasing can be computed.
In any case nothing of that applies to the order data goes onto the bus.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-08-24 22:23    [W:0.058 / U:3.164 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site