On 2/2/2015 1:24 AM, Johannes Pfau wrote:
Usually those people just don't use
volatile as long as their code works. Once it breaks they add volatile
everywhere till it works again.

Having a volatile type is not going to make things better for such people. In fact, it may make things worse. It's harder to muck up volatileLoad() and volatileStore().


The compiler intrinsics participate in all optimizations.
Not sure what that's supposed to mean. The backend can generate
more efficient code if it knows that an address is a literal value. If
you add wrappers (void f(void* p) {volatileLoad(p)}) the information
that p is a constant is a literal is lost and needs to be recovered
by the backend, which is only done with enabled backend optimizations.

Please try it before deciding it does not work.

Reply via email to