<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64980>64980</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[asm] the embedded assemble prevent the optimization of clang
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
vfdff
</td>
</tr>
</table>
<pre>
test: https://gcc.godbolt.org/z/s9qWz8hs3
```
int test_inline_asm(int &a, int &b, int &c, int &d, int e) {
int a0 = a, b0 = b;
__asm__ __volatile__("");
a = a0, b = b0;
return 0;
}
```
* **gcc**: return 0 directly
```
mov w0, 0
ret
```
* **clang**: the **__asm__ __volatile__** block the value propagation
```
ldr w8, [x0]
ldr w9, [x1]
str w8, [x0]
mov w0, wzr
str w9, [x1]
ret
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEU02ToyAQ_TXthZoUA8HowUNmLf_CHi3AVtlFyQomO_n1WxDnOzWbokLLe7xuGp703gwzYgXiCUSdyTWMbqnOfdf3mXLdcxXQB-BHMoZw8sCPwBpgzaD1bnCdcjbs3DIAa67AGl_--XktRs-B1kCPkNNtpE8zBxLVWjNbM2Mr_QSsiKvAcgnsB9li9S7W7-LuJUZgJYHD002XEJJWJSXAa5KU1C1WwN-R2piybUnbnp2VwVhsW2AFMJZG-YEsb2I0qd3E6AfCgmFdZvK2CIf67rm3f3YkwOI0aH0LYltfVEhnFtTBPt-VINtvcmdySSV9AhYM93O_ZtVWzsNb3jDiBtzvStqprNO_E_Us7YrktLiTHGQwbv62TNstab4UsVQQT38piPor51K-4I9fcB_-rxHbkTipJZfrssGve7_R_9qxrKt4V_JSZlg95iUrhWA0z8aqOOScSi4kp5qX-76gSuRCa60OWhaFyEzFKOO0YIKWjNJ8d5AC93te0H2u-v5Qwp7iJI3dWXueomEy4_2KVb4vC5pZqdD6ZEHGZryQBMY3KepsqeKeB7UOHvbUGh_8m0owwSbvRi-JOl0VTgq7DjsivcdJ2XhteMZovhGJOwUzmWu6Q-J6kp5Fti62-mRwE8ZV7bSbgDUx3zY9nBb3C3UA1qQqPbAmneJfAAAA__9N9izV">