public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r14-9003] libstdc++: Remove redundant zeroing in std::bitset::operator>>= [PR113806]
Date: Thu, 15 Feb 2024 11:44:33 +0000 (GMT)	[thread overview]
Message-ID: <20240215114433.B52F7384F00C@sourceware.org> (raw)

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;

                 reply	other threads:[~2024-02-15 11:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240215114433.B52F7384F00C@sourceware.org \
    --to=redi@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).