On Thu, 2007-11-01 at 10:41 -0700, Jeremy Fitzhardinge wrote:
I understood it as reordering was permitted, but no re-ordering across
another volatile load, store, or asm was permitted. And of course, as
long as input and output constraints are written properly, the
re-ordering should not be vulnerable to pathological movement causing
the code to malfunction.
It seems that CPU state side effects which can't be expressed in C need
special care - FPU is certainly one example.
Also, memory clobber on a volatile asm should stop invalid movement
across TLB flushes and other problems areas. Even memory fences should
have memory clobber in order to stop movement of loads and stores across
the fence by the compiler.
Zach
-