From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7B5823858408; Wed, 7 Feb 2024 12:21:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7B5823858408 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707308507; bh=k5OfBPeRs8rqw4x01AcofyFJ/TakKaXiyvNImD6FTD8=; h=From:To:Subject:Date:From; b=IutrZbuMSoxfu++2C9gLbH2PIQLPRp3t/7f/48K1xzsaJV9fPuPxWYQWVk6vHi3f5 CYAC8kZrDeyVmGJBTy5zManjsOcMSSmWjBxkfT8HLBDaEYoK8dW3fnhpIRQfS4Cwxr NmvpidEQJdnPoV4CWHpW+nbbZbd0Ox7YxLTudPJw= From: "rhalbersma at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/113806] New: [performance] bitset::operator>>= unnecessarily sanitizes the high-word Date: Wed, 07 Feb 2024 12:21:46 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rhalbersma at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113806 Bug ID: 113806 Summary: [performance] bitset::operator>>=3D 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>>=3D unnecessarily sanitizes the high word by calling this->_M_do_sanitize();=20 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<<=3D where bits flow into the high word, and where t).=20 Current LOC is 1092 in on libstdc++ trunk, and could be removed wi= th no functional change.=