https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114865
--- Comment #8 from Peter Dimov <pdimov at gmail dot com> --- (In reply to Andrew Pinski from comment #6) > No it is dependent on the standard level. C++11 fails but C++14, C++17 and > C++20 all pass. That's interesting because I see basically no difference in the generated code on CE between 11 and 14: --- "C++-x86-64 gcc 13.2-1 (1).asm" 2024-04-27 03:25:11.149385400 +0300 +++ "C++-x86-64 gcc 13.2-1.asm" 2024-04-27 03:24:59.207244400 +0300 @@ -76,10 +76,11 @@ jmp .L8 main: push rbx + mov eax, 8738 mov ebx, 1024 sub rsp, 16 mov QWORD PTR [rsp], 0 - mov QWORD PTR [rsp+8], 8738 + mov WORD PTR [rsp+8], ax .L14: mov rdi, rsp call generate(std::atomic<state_type>*) (https://godbolt.org/z/nexn5W4Ph)