<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - aarch64 unpredictable instruction from inline assembly"
   href="https://bugs.llvm.org/show_bug.cgi?id=39181">39181</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>aarch64 unpredictable instruction from inline assembly
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>LLVM Codegen
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>compnerd@compnerd.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>```
// %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.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>