https://llvm.org/bugs/show_bug.cgi?id=31721
Bug ID: 31721 Summary: [ARM] MC crashes with LDREXD inline assembly Product: libraries Version: trunk Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: Backend: ARM Assignee: unassignedb...@nondot.org Reporter: renato.go...@linaro.org CC: llvm-bugs@lists.llvm.org Classification: Unclassified While investigating Bug #31058, I found that the MC layer is crashing on a syntax previously accepted by 3.9 Clang on ARM mode: void foo(long long *ptr, long long value) { int store_failed; __asm__ __volatile__( "1:\n" // Dummy load to lock cache line. "ldrexd %1, [%2]\n" "teq %0, #0\n" "bne 1b" : "=&r" (store_failed) : "r"(value), "r" (ptr) : "cc", "memory"); } $ clang -S -O2 -target armv7a ldrexd.c -o - llvm/include/llvm/MC/MCInst.h:75: int64_t llvm::MCOperand::getImm() const: Assertion `isImm() && "This is not an immediate"' failed. However, since the syntax proposed in bug #31058 works: void foo(long long *ptr, long long value) { int store_failed; __asm__ __volatile__( "1:\n" // Dummy load to lock cache line. "ldrexd %1, %H1, [%2]\n" "teq %0, #0\n" "bne 1b" : "=&r" (store_failed) : "r"(value), "r" (ptr) : "cc", "memory"); } and is preferred, we may just emit an error for this GNU syntax. Or we can fix it and make it work on Thumb and ARM. Whatever is easier. Also, LLVM is currently emitting an error for Thumb: strexd.c:7:8: error: instruction requires: arm-mode "ldrexd %1, [%3]\n" strexd.c:8:8: error: instruction requires: arm-mode "strexd %0, %2, [%3]\n" which may or may not be related to bug #31720. -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs