https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111246
--- Comment #3 from Luke Geeson <luke.geeson at cs dot ucl.ac.uk> --- According to the latest C/C++ and PPC models, yes. If x was non-atomic, then this would be a racy (UB) test, but making x atomic with relaxed order is well-defined according to the C model (and therefore any racy behaviour should not occur). In any case, a sequentially consistent load should not allow re-ordering. We reported (and are patching) a similar bug in LLVM for AArch64 (https://github.com/llvm/llvm-project/issues/62652)