[llvm-bugs] [Bug 45010] New: Assertion failed: !(isAtomic() && getAlignment() == 0) && "Alignment required for atomic load"

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Feb 24 11:29:44 PST 2020


https://bugs.llvm.org/show_bug.cgi?id=45010

            Bug ID: 45010
           Summary: Assertion failed: !(isAtomic() && getAlignment() == 0)
                    && "Alignment required for atomic load"
           Product: clang
           Version: 10.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: -New Bugs
          Assignee: gchatelet at google.com
          Reporter: alexandre.ganea at ubisoft.com
                CC: hans at chromium.org, htmldeveloper at gmail.com,
                    llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk
            Blocks: 44555

When compiling Clang with assertions enabled, I'm seeing the assert I've
mentioned here: https://reviews.llvm.org/D71547#1824272

Repro:

// a.cpp
// Build with: clang-cl a.cpp /c /O1
#include <vector>
struct SP {
  void WeakAddRef();
  void WeakRelease();
};
template <typename T> struct PtrBase {
  T *volatile P;
  ~PtrBase() {
    if (R)
      R->WeakRelease();
  }
  PtrBase(const PtrBase &O) : R(O.R) {
    if (R)
      R->WeakAddRef();
  }
  SP *R;
  bool IsValid() const { return P != nullptr; }
};
struct alignas(16) VectorSIMD4f {
  float V;
};
unsigned __int64 countAF() {
  class AF {
    VectorSIMD4f B;
  };
  struct PD {
    PtrBase<AF> P;
  };
  std::vector<PD> AFs;
  unsigned __int64 C = 0;
  for (auto A : AFs) {
    if (A.P.IsValid())
      ++C;
  }
  return C;
}


Referenced Bugs:

https://bugs.llvm.org/show_bug.cgi?id=44555
[Bug 44555] [meta] 10.0.0 Release Blockers
-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200224/ecfe8580/attachment-0001.html>


More information about the llvm-bugs mailing list