[LLVMbugs] [Bug 20201] New: clang-cl: cannot compile this unexpected cast lvalue yet in inline assembly

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jul 3 21:39:53 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20201

            Bug ID: 20201
           Summary: clang-cl: cannot compile this unexpected cast lvalue
                    yet in inline assembly
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ehsan at mozilla.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

$ cat test.cpp
#include <stdint.h>

typedef __declspec(align(16)) uint32_t uvec32[4];

static uvec32 kHash16x33 = { 0x92d9e201, 0, 0, 0 }; // 33 ^ 16
static uvec32 kHashMul3 = {
  0x00008c61, // 33 ^ 3
  0x00000441, // 33 ^ 2
  0x00000021, // 33 ^ 1
  0x00000001, // 33 ^ 0
};

uint32_t HashDjb2_SSE41(const uint8_t* src) {
  uint32_t hash;
  asm volatile ( // NOLINT
    "movd      %%xmm0,%3                       \n"
  : "+r"(src), // %0
    "=g"(hash) // %3
  : "m"(kHash16x33), // %4
    "m"(kHashMul3) // %8
  : "memory", "cc"
    , "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7"
  ); // NOLINT
  return hash;
}


$ clang-cl -c test.cpp
test.cpp(19,9) :  error: cannot compile this unexpected cast lvalue yet
  : "m"(kHash16x33), // %4
        ^~~~~~~~~~
test.cpp(20,9) :  error: cannot compile this unexpected cast lvalue yet
    "m"(kHashMul3) // %8
        ^~~~~~~~~
2 errors generated.

-- 
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/20140704/61838c6c/attachment.html>


More information about the llvm-bugs mailing list