I understand it works _if_ you declare p as being volatile, or explicitly tag it as _Atomic.
i.e., either of these forms:
foo * volatile p;
foo * _Atomic p;
Or at least it did when I was performing a similar experiment.