https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114865
--- Comment #12 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Peter Dimov from comment #11) > So, basically, C++14 and above initialize the padding of > > ``` > std::atomic<state_type> state{{ 0, 0x2222 }}; > ``` > > in `main` to zero, which masks the problem in `generate`. (The problem in > `generate` still exists because the assembly is identical - it just doesn't > trigger because the padding is zero. If we manually poke something nonzero > into the padding, it would (ought to) still break.) No there is no problem in generate for C++14+ because there is no way to get the padding non-zero for that variable. The problem is only with C++11's std::atomic ... See PR 111077 and such.