-
Notifications
You must be signed in to change notification settings - Fork 123
Open
Description
It's perhaps a little early to open an issue for this but since I'm already toying with GCC16, I was surprised to see that it now generates a memset to zero init even when default_init is used.
boost::container::small_vector<float, 100> bar(100, boost::container::default_init);
for(auto b : bar)
std::cout << b;GCC16.0.1 (-std=c++26 -O3):
push r12
mov edx, 424
xor esi, esi
push rbp
push rbx
sub rsp, 432
mov rdi, rsp
lea r12, [rsp+24]
lea rbp, [rsp+424]
call "memset" ; zero init 400 bytes
mov eax, 100
mov QWORD PTR [rsp], r12
mov rbx, r12
movq xmm0, rax
punpcklqdq xmm0, xmm0
movups XMMWORD PTR [rsp+8], xmm032-bit (only the relevant bit):
lea eax, [ebp-440]
push 412 ; count
push 0 ; ch
push eax ; dest
call "memset"GCC15.2 (-std=c++26 -O3):
push r12
mov eax, 100
push rbp
movq xmm0, rax
push rbx
punpcklqdq xmm0, xmm0
sub rsp, 432
lea r12, [rsp+24]
movups XMMWORD PTR [rsp+8], xmm0
lea rbp, [rsp+424]
mov QWORD PTR [rsp], r12
mov rbx, r12Clang 22.1 (-std=c++26 -O3):
push r15
push r14
push rbx
sub rsp, 432
lea r14, [rsp + 32]
mov qword ptr [rsp + 24], 100
mov qword ptr [rsp + 8], r14
mov qword ptr [rsp + 16], 100
mov r15d, 24
mov rbx, qword ptr [rip + std::cout@GOTPCREL]I'm not yet sure if this is a compiler regression, an issue with the containers, a skill issue or something else. Again, happy to close it if it's too soon. :)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels