Consider this C code:
extern volatile int hardware_reg; void f(const void *src, size_t len) { void *dst = ; hardware_reg = 1;
My assumption would be that the compiler never re-orders volatile assignments since it has to assume they must be executed at exactly the position where they occur in the code.