From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 0C11238582B0 for ; Thu, 7 Jul 2022 16:52:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0C11238582B0 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-42-LhITr2e7MlWzl2dVuW4leA-1; Thu, 07 Jul 2022 12:52:57 -0400 X-MC-Unique: LhITr2e7MlWzl2dVuW4leA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 67E4B381684D; Thu, 7 Jul 2022 16:52:57 +0000 (UTC) Received: from localhost (unknown [10.33.36.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id 31574492CA2; Thu, 7 Jul 2022 16:52:57 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Remove workaround in __gnu_cxx::char_traits::move [PR89074] Date: Thu, 7 Jul 2022 17:52:56 +0100 Message-Id: <20220707165256.1418408-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jul 2022 16:53:00 -0000 Tested aarch64-linux, pushed to trunk. -- >8 -- The front-end bug that prevented this constexpr loop from working has been fixed since GCC 12.1 so we can remove the workaround. libstdc++-v3/ChangeLog: PR c++/89074 * include/bits/char_traits.h (__gnu_cxx::char_traits::move): Remove workaround for front-end bug. --- libstdc++-v3/include/bits/char_traits.h | 9 --------- 1 file changed, 9 deletions(-) diff --git a/libstdc++-v3/include/bits/char_traits.h b/libstdc++-v3/include/bits/char_traits.h index b856b1da320..965ff29b75c 100644 --- a/libstdc++-v3/include/bits/char_traits.h +++ b/libstdc++-v3/include/bits/char_traits.h @@ -215,14 +215,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { if (__s1 == __s2) // unlikely, but saves a lot of work return __s1; -#if __cpp_constexpr_dynamic_alloc - // The overlap detection below fails due to PR c++/89074, - // so use a temporary buffer instead. - char_type* __tmp = new char_type[__n]; - copy(__tmp, __s2, __n); - copy(__s1, __tmp, __n); - delete[] __tmp; -#else const auto __end = __s2 + __n - 1; bool __overlap = false; for (std::size_t __i = 0; __i < __n - 1; ++__i) @@ -244,7 +236,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } else copy(__s1, __s2, __n); -#endif return __s1; } #endif -- 2.36.1