public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-9003] libstdc++: Remove redundant zeroing in std::bitset::operator>>= [PR113806]
@ 2024-02-15 11:44 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2024-02-15 11:44 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:bf883e6428a545d091319c8b71fcfb35e7dd7084

commit r14-9003-gbf883e6428a545d091319c8b71fcfb35e7dd7084
Author: Jonathan Wakely <jwakely@redhat.com>
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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-02-15 11:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-15 11:44 [gcc r14-9003] libstdc++: Remove redundant zeroing in std::bitset::operator>>= [PR113806] Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).