It is not in the C standard but the way GCC implements it is that it is hands-off with optimizations to any volatile variables and pointers. And since Linux is only compiled with GCC, it works.
People porting to llvm and icc have to do whatever it takes so that all the gadgets defined by the kernel work in those compilers as expected.
ISO C standard conformance isn't entirely irrelevant, but thereabouts.
There is no such thing as building systems from the ground up without controlling compilers beyond what is specified in the applicable language standards.