From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id BF35A158649 for ; Thu, 11 May 2023 20:28:21 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 09E7BE0AC6; Thu, 11 May 2023 20:28:21 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id EB254E0AC6 for ; Thu, 11 May 2023 20:28:20 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2B519340AC0 for ; Thu, 11 May 2023 20:28:20 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id BBC2F990 for ; Thu, 11 May 2023 20:28:18 +0000 (UTC) From: "Conrad Kostecki" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Conrad Kostecki" Message-ID: <1683836884.5c293f2a4687d15e5378d252ef67ef1acb95adfd.conikost@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/gcc/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-devel/gcc/files/gcc-13-PR109703-unreachable.patch X-VCS-Directories: sys-devel/gcc/files/ X-VCS-Committer: conikost X-VCS-Committer-Name: Conrad Kostecki X-VCS-Revision: 5c293f2a4687d15e5378d252ef67ef1acb95adfd X-VCS-Branch: master Date: Thu, 11 May 2023 20:28:18 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 13ddd7ee-153d-49ca-b7cb-64d911a3ef4e X-Archives-Hash: ce617c6cb8a43f572691a20a528aa3cd commit: 5c293f2a4687d15e5378d252ef67ef1acb95adfd Author: Michael Mair-Keimberger levelnine at> AuthorDate: Thu May 11 15:49:48 2023 +0000 Commit: Conrad Kostecki gentoo org> CommitDate: Thu May 11 20:28:04 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5c293f2a sys-devel/gcc: remove unused patch Signed-off-by: Michael Mair-Keimberger levelnine.at> Closes: https://github.com/gentoo/gentoo/pull/30997 Signed-off-by: Conrad Kostecki gentoo.org> .../gcc/files/gcc-13-PR109703-unreachable.patch | 54 ---------------------- 1 file changed, 54 deletions(-) diff --git a/sys-devel/gcc/files/gcc-13-PR109703-unreachable.patch b/sys-devel/gcc/files/gcc-13-PR109703-unreachable.patch deleted file mode 100644 index f7c7c9f60a70..000000000000 --- a/sys-devel/gcc/files/gcc-13-PR109703-unreachable.patch +++ /dev/null @@ -1,54 +0,0 @@ -https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109703 - -From d50f2599d7b23bdba05a9102645d082ed9bcb05f Mon Sep 17 00:00:00 2001 -From: Kefu Chai -Date: Mon, 1 May 2023 21:24:26 +0100 -Subject: [PATCH] libstdc++: Set _M_string_length before calling _M_dispose() - [PR109703] - -This always sets _M_string_length in the constructor for ranges of input -iterators, such as stream iterators. - -We copy from the source range to the local buffer, and then repeatedly -reallocate a larger one if necessary. When disposing the old buffer, -_M_is_local() is used to tell if the buffer is the local one or not (and -so must be deallocated). In addition to comparing the buffer address -with the local buffer, _M_is_local() has an optimization hint so that -the compiler knows that for a string using the local buffer, there is an -invariant that _M_string_length <= _S_local_capacity (added for PR109299 -via r13-6915-gbf78b43873b0b7). But we failed to set _M_string_length in -the constructor taking a pair of iterators, so the invariant might not -hold, and __builtin_unreachable() is reached. This causes UBsan errors, -and potentially misoptimization. - -To ensure the invariant holds, _M_string_length is initialized to zero -before doing anything else, so that _M_is_local() doesn't see an -uninitialized value. - -This issue only surfaces when constructing a string with a range of -input iterator, and the uninitialized _M_string_length happens to be -greater than _S_local_capacity, i.e., 15 for the std::string -specialization. - -libstdc++-v3/ChangeLog: - - PR libstdc++/109703 - * include/bits/basic_string.h (basic_string(Iter, Iter, Alloc)): - Initialize _M_string_length. - -Signed-off-by: Kefu Chai -Co-authored-by: Jonathan Wakely -(cherry picked from commit cbf6c7a1d16490a1e63e9a5ce00e9a5c44c4c2f2) ---- a/libstdc++-v3/include/bits/basic_string.h -+++ b/libstdc++-v3/include/bits/basic_string.h -@@ -760,7 +760,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 - _GLIBCXX20_CONSTEXPR - basic_string(_InputIterator __beg, _InputIterator __end, - const _Alloc& __a = _Alloc()) -- : _M_dataplus(_M_local_data(), __a) -+ : _M_dataplus(_M_local_data(), __a), _M_string_length(0) - { - #if __cplusplus >= 201103L - _M_construct(__beg, __end, std::__iterator_category(__beg)); --- -2.31.1