https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113806
Bug ID: 113806 Summary: [performance] bitset::operator>>= unnecessarily sanitizes the high-word Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: rhalbersma at gmail dot com Target Milestone: --- It seems that since time immemorial, bitset::operator>>= unnecessarily sanitizes the high word by calling this->_M_do_sanitize(); It is unnecessary since right-shifting moves bits away from the high-word so that the class invariant can not be violated (in contrast to bitset::operator<<= where bits flow into the high word, and where t). Current LOC is 1092 in <bitset> on libstdc++ trunk, and could be removed with no functional change.