[llvm-bugs] [Bug 39181] New: aarch64 unpredictable instruction from inline assembly

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Oct 4 11:49:38 PDT 2018


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

            Bug ID: 39181
           Summary: aarch64 unpredictable instruction from inline assembly
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: compnerd at compnerd.org
                CC: llvm-bugs at lists.llvm.org

```
// %RUN: %clang_cc1 -triple aarch64 -O1 -emit-obj -o /dev/null -x c %s

typedef __UINTPTR_TYPE__ uintptr_t;
typedef __UINT32_TYPE__ uint32_t;

static _Bool g(uintptr_t *destination,
               uintptr_t old __attribute__((__unused__)), uintptr_t value) {
  uint32_t status;
  __asm__("stxr %w[status], %x[value], [%x[location]]"
          : [status] "=r" (status), "=m" (*destination)
          : [value] "r" (value), [location] "r" (destination));
  return !status;
}

void f(void) {
  uintptr_t value;
  uintptr_t destination;
  g(&destination, 0, value);
}
```

Marking status as an early clobber doesn't seem to help either.  I've not yet
reduced this down, but, putting here to make sure that we don't forget about
it.  This did work with clang 6 at least.

-- 
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/20181004/026117c3/attachment.html>


More information about the llvm-bugs mailing list