<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=http://email.email.llvm.org/c/eJylVE1v2zAM_TXOhYjhyHESH3xoGhQo0GHAVuwa0BadaJWlQJKTZr9-lNxPYNtlhhKbJvX4SD6rtfLafP2elTfwoMz4DJnYtGOAe7igh85Z7-edHU5KK3OA3jq4KFMKuBzJcFCvnA9gbFAdSQhH5TNRZ8UuK25uNfKOTKzg4eHHFziT88qamMjRyVk5dqrVBNbAosyLvMjELcTMMS8CR7B3gJY4J02IL7jWeCXJpWxwC52VFFlPLIn5hSPMe_TDvNW2e0qMypfN2ap4Wcn0AZk5KBMgkA9ZtS2zagdZyb_1FhaRk4h_Jdu7rNx-JBJ37fcYglPMm_Z7JsHL4BPJmFPUMKAy_OpslXzrCwNPD8AXs3w3AD754jXYMxA-RwrLzx5lOpAX6yScggNmngoQ2xhd7f6K8u9AR-Eznd0r590f-_d4JPDUWSO5Ek9Dq688j2FAftGj0h7etdNSh6Pngfc8LYFDqw6jHT3YE7kY79UvYkccpSR_UoF4wjzZVZHKjDlFnQN8Iy4nAirWitKaO-EDoYQJHg2Qc6xTOboYxbmfVBLi5gODiMz64e690J2wt6w_VqfGLm6JQSilIy7NT7pCjud0yKOPhN6auYytXBUToUndlIKdoy4kjeYz2ZSyLmuc4RiO1jWPdvBWzkanm2MIJx9VKu54HTjV2OZMjQ2tz6-3OSP_ZDw2lfcjsbTvqnJRr2fHhnpZ1tRvKqoKLMV6Q9W6kpti02ONtOxnGlvSvmHO3GVDF0gQ_MzUZ__PQDWiEKJYLJbFsizFJseSapLrAtuiWvT9IlsWxN-DziNObt1h5poE2Y4Hz06tfPDvTtaTOhiiRJgZBhV0MpThkVL6cvhTvTeBNPirCSxnPlvS7P10PDH7Vpk4SRYFOodXOKNTGI-dqDjkWR84K58lyqSYadhAz6d45-NqlqpsUom_Abs6nTc>53197</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[inline asm] Intel syntax: errors when combining an array variable and a register in an address expression
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Tomsod
</td>
</tr>
</table>
<pre>
OS: Linux (but I was cross-compiling for win32 when I first noticed this)
Clang & LLVM version: reproducible on 13.0.0, but was a problem before
Consider this C code (compile with -fasm-blocks):
```
static int test[3] = { 1, 2, 3 };
int __attribute__((naked)) main(void)
{
asm
{
mov eax, 4
inc dword ptr [test+eax]
mov eax, [test+eax]
ret
}
}
```
The second assembly command fails compiling because of "ambiguous operand size" (despite the `dword`). Removing it will instead cause an error during linking (because of the third command). But replacing the addresses with a constant `[test+4]` will produce a correct code.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx9k91u2zAMhZ_GuSESOLLz4wtfNA0KFOgwYCt2G8gWk2iVpUCSk2ZPvyM7XVtgm-HElkWRH8nDxqlr_fV7VtzRk7b9K2Vi3fSRHukiA7XehTBtXXfSRtsD7Z2ni7aFoMuRLYz22odI1kXdsqJ41CETVZZvs_zu3kicyMSSnp5-fKEz-6CdTYE8n7xTfasbw-QszYtZPsszcU8pcoorCRbY7ahhxOTR482vs0Er9kM0uqfWKU7UIyWDLx5pupehmzbGtS8DUXE7nC3z2z0sQ5QgJ20jRQ4xW2yKbLGlrMBvtaF5YhLpr8B6mxWbjyDp1G4nY_Qa3LzbAQK3lS-sUkxRUSe1xaez0-pPXeB4fCFcoHxfEH3aS1fnzsTyNSGUn3e0bUldnFd0ip5APiQgNsl6sf2nl_8beo6fcbZvzNu_1u_5yBS4dVYhk8BdY67oR9dJfNhLbQK9a6fhVvYBDd-jW0J2jT70rg_kTuyTfdC_GBuplYrDSUdGh9HZZT6kmWKKakb0jZFOcqihFW0MKhEiS0Wje2mJvYdOVe-TFWK_6EGI6w8EyTP0g-rdcEffG-gP6jSyTUeSkVTKM1ILo64k7BFOovUJ6E8xy1TKZT4Cjermwdh7buOg0dlE1YWqikpOoo6Ga5zWFng8qACye7SRDYWrjWgN5mTII4yjBsxG20SFBKX38kpn6bVMI5SqJ8F90CiERz0GmxGc-PWUnhi9Se9NfYzxFNI4iAfcB-TUNzM4x8KY89tjihR-AhxLHULPmKGHRTGvVpNjvSjXe9mgllyuua3KqmqlaBZVKcpGLFbtxMiGTUjpoZ2WLzS4wDtynOha5ELk83mZl0Uh1jNZcMVqlcsmX8z3-3lW5oyxMbPEMXP-MPH1gNT0h4BNgyTD-yZkpw-Wh2om_7KPR-frZ9cFpyZD5Hog_w1PaIey">