https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128826
--- Comment #5 from Barry Revzin <barry.revzin at gmail dot com> --- It seems related to having an empty subobject anywhere. Here is another example (https://compiler-explorer.com/z/b9rb44b3z): struct Empty {}; struct S { Empty e; // or [[no_unique_address]] Empty e;, or struct S : Empty union { int i; int big[32]; }; constexpr S() : i(5) {} }; S f() { return S(); } In gcc 14.2 -std=c++20 -O3, this is 3 instructions: f(): mov DWORD PTR [rdi+4], 5 mov rax, rdi ret In gcc 15.2 -std=c++20 -O3, this is 14: f(): mov QWORD PTR [rdi], 0 mov rdx, rdi lea rdi, [rdi+8] xor eax, eax mov QWORD PTR [rdi+116], 0 mov rcx, rdx and rdi, -8 sub rcx, rdi add ecx, 132 shr ecx, 3 rep stosq mov DWORD PTR [rdx+4], 5 mov rax, rdx ret
