Landing: 2763d2c22442
Project / Subsystem
gcc / libstdc++
Date
2026-10-05
Author
Jonathan Wakely
Commit
2763d2c224422f3a54b76659f3634c034089b9ed
Source
github
Perf win
Yes
Breaking
No
All attributes
- project
- gcc
- subsystem
- libstdc++
- patch_id
- —
- commit_hash
- 2763d2c224422f3a54b76659f3634c034089b9ed
- source_type
- github
- headline
- libstdc++: Avoid zeroing stack buffer in std::bitset extraction
- tldr
- Improves efficiency by avoiding unnecessary zero-initialization of a stack buffer in std::bitset extraction.
- author
- Jonathan Wakely
- outcome
- committed
- performance_win
- true
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • libstdc++
- • optimization
- • C++98
- • C++20
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-10-05T00:00:00.000Z
A stack buffer used for istream extraction in std::bitset will no longer be zero-initialized. This change uses the [[indeterminate]] attribute (or __attribute__((uninitialized)) for C++98 compatibility) to mark the buffer as uninitialized, avoiding an unnecessary zeroing operation. Additionally, a new variable for the array length is introduced to prevent -Walloc-size warnings related to zero-sized allocations in C++98.