[llvm-bugs] [Bug 50133] New: [MS] Crush when calling intrinsic __cpuid

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Apr 26 19:48:26 PDT 2021


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

            Bug ID: 50133
           Summary: [MS] Crush when calling intrinsic __cpuid
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: pengfei.wang at intel.com
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, pengfei.wang at intel.com,
                    spatel+llvm at rotateright.com

Small reproducer:

#include <array>
#include <vector>
#include <intrin.h>

struct A {
  std::string S;
  std::vector<std::array<int, 4>> V;
  A() {
        std::array<int, 4> B;
        __cpuid(B.data(), 0);
        V.push_back(B);
        V.push_back(B);
        char C[64];
        memset(C, 0, sizeof(C));
        S = C;
  }
} T;

Commands:

clang-cl -mavx2 /EHs repro.cpp -S
cat repro.asm  | grep cpuid -A7
        cpuid
        #NO_APP
        mov     r11d, eax
        mov     rax, qword ptr [rbx + 72]       # 8-byte Reload
        mov     r10d, ebx
        mov     r9d, ecx
        mov     rcx, qword ptr [rbx + 80]       # 8-byte Reload
        mov     r8d, edx

-- 
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/20210427/b20bc1f1/attachment.html>


More information about the llvm-bugs mailing list