From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id B52F7384F00C; Thu, 15 Feb 2024 11:44:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B52F7384F00C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707997473; bh=J8lceYn7o7xg0Dy+c8AzGbVYuY9E+e2668S3W6I0xa8=; h=From:To:Subject:Date:From; b=UhDCxbAEDqQSEmRBcG3v1+tmPmfWW9hbb96SofupHBwPt1ehtjcjG8jV036t+60SU re+RWyS5yUrnKHw4MmI6tkjZ8s2Lj8NrqtAHurpXhs2KnSrApCpH/k3YOGt3/rl79L Vr1U76SLt+RsNDoGLD6pcuqdIp06gIhaGBp2d+zE= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r14-9003] libstdc++: Remove redundant zeroing in std::bitset::operator>>= [PR113806] X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: e7ae13a858f36031b8fd3aa07362752ff2b19b2e X-Git-Newrev: bf883e6428a545d091319c8b71fcfb35e7dd7084 Message-Id: <20240215114433.B52F7384F00C@sourceware.org> Date: Thu, 15 Feb 2024 11:44:33 +0000 (GMT) List-Id: https://gcc.gnu.org/g:bf883e6428a545d091319c8b71fcfb35e7dd7084 commit r14-9003-gbf883e6428a545d091319c8b71fcfb35e7dd7084 Author: Jonathan Wakely Date: Thu Feb 8 15:47:19 2024 +0000 libstdc++: Remove redundant zeroing in std::bitset::operator>>= [PR113806] The unused bits in the high word are already zero before this operation. Shifting the used bits to the right cannot affect the unused bits, so we don't need to sanitize them. libstdc++-v3/ChangeLog: PR libstdc++/113806 * include/std/bitset (bitset::operator>>=): Remove redundant call to _M_do_sanitize. Diff: --- libstdc++-v3/include/std/bitset | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libstdc++-v3/include/std/bitset b/libstdc++-v3/include/std/bitset index 16c4040f532f..ccd6d19f7a40 100644 --- a/libstdc++-v3/include/std/bitset +++ b/libstdc++-v3/include/std/bitset @@ -1094,10 +1094,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER operator>>=(size_t __position) _GLIBCXX_NOEXCEPT { if (__builtin_expect(__position < _Nb, 1)) - { - this->_M_do_right_shift(__position); - this->_M_do_sanitize(); - } + this->_M_do_right_shift(__position); else this->_M_do_reset(); return *this;