<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/77591>77591</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Inline assembly in Intel syntax loses operand size information
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          lhmouse
      </td>
    </tr>
</table>

<pre>
    https://gcc.godbolt.org/z/dnYjaYq3r
```c
int
x87_rint(const double* ptr)
  {
    int r;
    __asm__ (
      "fld %1; "
 "fistp %0; "
      : "=m"(r) : "m"(*ptr) : "st"
    );
 return r;
  }
```

The input is a `double`, so it should expand to `QWORD PTR [...]`, but Clang doesn't generate the size specifier, and fails to compile due to the ambiguity:

```
<source>:6:7: error: ambiguous operand size for instruction 'fld'
    6 |       "fld %1; "
      |       ^
<inline asm>:2:6: note: instantiated into assembly here
    2 |         fld [eax]; fistp [esp]; 
      | ^~~~~
<source>:6:7: error: ambiguous operand size for instruction 'fistp'
    6 |       "fld %1; "
      |       ^
<inline asm>:2:19: note: instantiated into assembly here
    2 |         fld [eax]; fistp [esp]; 
      |                          ^~~~~
2 errors generated.
Compiler returned: 1
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEVMGO4zYM_Rr6Qqxhy5GVHHxIJhNgT20XCxR7CmSLjrWQJVeS25k9zLcXij2TmaBFLy0aBJFIiuTT44tkCPpiiRrgB-DHTM5xcL4xw-jmQFnr1HMzxDgFqPbATsBOl67LL061zsTc-Quw0w9gJ2W_fZfffqs8FEco9lAXy7dbbG3jsnnairNPFtt2zoaIys2tIWB7nKIHtluOIYI4vG4RtY3ooXrnOZ9lGM9nBLa9ORGBsd4oBMZLqA7JXKMpoEOcUqj4GFoSq-sZqI5jWtg2YXn1ri5g-wXjqz_ED1US-jeMnuLs7QfUII537Kzm9ffrQKjtNEfUASVCXazU1AWwBwwOdcQwuNkopKdJWoXRpWO__PrTlyP-_PULAj_keQ78uOa0c8QHI-0FlaNggYmIF7LkZSSMA2HQPwjDRJ3uNfmUksr2UpuQindunLQhVDMlM2XIsdWXWcfnpId36O-vVD0EN_uOoHqEal9DtReJNPLe-bRZ6rg5oJvIp65XLL3zqG2Ifu6idhaBid4oYOLGco0gHvAfxr1Eb-f44xsubY22hDKMCza24kPrIqU19Zc2ahlJJeU5lCHQ2JpnHMjTrQN71wHxCoQfSD6lAVQHXPXGDxSm1XWPDvjjy8vLy7_PWWr9n7NW7v4n2v7284FPtjAX3iSv8iXwsMjar_9RUgl--Zc6zlRTqV21kxk1pSg2260QXGRD03cdr2W7E7KuqN9s1ablG8ZJUS_rXb3LdMMKtinKsihLzrnIK162oqS6a1VLqtjApqBRapMb8_uYXtJMhzBTIwTflZmRLZlwfZUZs_QHXoNpVPyY-SblfGrnS4BNYXSI4VYl6mio-fw6r3UE2uJnG8lgeLZRPqFxge50pG3v_CiThrLZm_tnX8dhbvPOjcBOqdm6fJq8-05dBHa6QgzATtcr_BkAAP__99LLRQ">