aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2024-02-08 15:47:19 +0000
committerJonathan Wakely <jwakely@redhat.com>2024-02-15 11:43:21 +0000
commitbf883e6428a545d091319c8b71fcfb35e7dd7084 (patch)
treea141b6548b73220e36465835236c550638afc94e
parente7ae13a858f36031b8fd3aa07362752ff2b19b2e (diff)
downloadgcc-bf883e6428a545d091319c8b71fcfb35e7dd7084.zip
gcc-bf883e6428a545d091319c8b71fcfb35e7dd7084.tar.gz
gcc-bf883e6428a545d091319c8b71fcfb35e7dd7084.tar.bz2
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.
-rw-r--r--libstdc++-v3/include/std/bitset5
1 files changed, 1 insertions, 4 deletions
diff --git a/libstdc++-v3/include/std/bitset b/libstdc++-v3/include/std/bitset
index 16c4040..ccd6d19 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;