public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
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	[thread overview]
Message-ID: <20220707165256.1418408-1-jwakely@redhat.com> (raw)

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


                 reply	other threads:[~2022-07-07 16:52 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=20220707165256.1418408-1-jwakely@redhat.com \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@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).