[PATCH] D98167: Avoid shuffle self-assignment in EXPENSIVE_CHECKS builds

Alexander Richardson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 8 04:41:11 PST 2021


arichardson added a comment.

In D98167#2610843 <https://reviews.llvm.org/D98167#2610843>, @lebedev.ri wrote:

> It seems like https://bugs.llvm.org/show_bug.cgi?id=37652 was fixed upstream.
> Do we still want to workaround it?

It appears that https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85828 was fixed Aug2020, so most Linux distributions still ship a libstdc++ with the assert unless they backported the fix. I think it probably makes sense to work around it.



================
Comment at: llvm/include/llvm/ADT/STLExtras.h:1339
+    difference_type offset = g() % size;
+    if (offset != difference_type(0))
+      std::iter_swap(first, first + offset);
----------------
lebedev.ri wrote:
> This should have a comment explaining why this is needed
Will add a comment if we are happy to proceed with this patch.
How about the following?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98167/new/

https://reviews.llvm.org/D98167



More information about the llvm-commits mailing list