https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115576
--- Comment #10 from John Zwinck <jzwinck at gmail dot com> --- GCC 15.1 generates better code, though technically still slightly worse than GCC 13: S32::To64() const: mov edx, DWORD PTR [rdi] mov eax, DWORD PTR [rdi+4] xchg rdx, rax ret Note the extra xchg. I'm not sure if that should be optimized away by some later pass in a general way. So more work could be done to make the machine code concise, though I expect the runtime performance difference will be nil on x86-64 due to register renaming. I'll leave it up to someone more involved with the GCC project whether to mark this bug fixed in 15.1 or to leave it open until it's 100% as good as in GCC 13.