Yvan noticed that the set of memory models has already been validated by expand_builtin_atomic_store, so the test here in expand_atomic_store is fully redundant.
Committed. r~
* optabs.c (expand_atomic_store): Elide redundant model test. diff --git a/gcc/optabs.c b/gcc/optabs.c index 99fd025..4f3cbb4 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -7537,8 +7537,7 @@ expand_atomic_store (rtx mem, rtx val, enum memmodel model, bool use_release) } /* Otherwise assume stores are atomic, and emit the proper barriers. */ - if (model == MEMMODEL_SEQ_CST || model == MEMMODEL_RELEASE) - expand_mem_thread_fence (model); + expand_mem_thread_fence (model); emit_move_insn (mem, val);