From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B08DF3861878; Thu, 15 Feb 2024 11:44:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B08DF3861878 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707997466; bh=1tNEMOnAm0FwcnHzWZ4FFug8a0dZeVqrS8kf/jCGyag=; h=From:To:Subject:Date:In-Reply-To:References:From; b=yE0Wuvi9C4rBC+CYZwNtx1aatkj3sRXiAxVAAxmnOoO676O6/FIceNgukl5jWNfeP u4/TSWym21Lvf9aRCduzdjD83wPN1hJd8KH3KMbiJEUdZIAGuh8WqXYxoDtkkZ8Ddx cXGOCrvOGoVYCor1H5bdQtcDx9+VvenJWQH69uvE= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/113811] std::rotate does 64-bit signed division Date: Thu, 15 Feb 2024 11:44:24 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 13.1.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW 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: Message-ID: In-Reply-To: References: 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=3D113811 --- Comment #4 from GCC Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:4d819db7f229a23cb15ef68f310e0bb51d201c45 commit r14-9001-g4d819db7f229a23cb15ef68f310e0bb51d201c45 Author: Jonathan Wakely Date: Thu Feb 8 15:40:32 2024 +0000 libstdc++: Use unsigned division in std::rotate [PR113811] Signed 64-bit division is much slower than unsigned, so cast the n and k values to unsigned before doing n %=3D k. We know this is safe because neither value can be negative. libstdc++-v3/ChangeLog: PR libstdc++/113811 * include/bits/stl_algo.h (__rotate): Use unsigned values for division.=