<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/79789>79789</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
【Warning】differences in GCC and LLVM Behaviors about __sync_fetch_and_nand
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
zhangtianhao6
</td>
</tr>
</table>
<pre>
Differences in GCC and LLVM Behaviors about __sync_fetch_and_nand
Warning content:
`warning: the semantics of this intrinsic changed with GCC version 4.4 - the newer semantics are provided here [-Wsync-fetch-and-nand-semantics-changed]`
Demo:
```
void test9_4(volatile int* ptr, int val) {
__sync_fetch_and_nand(ptr, val);
}
```
https://godbolt.org/z/5r5dbcPaj
GCC use note, LLVM use warning,Why are they different?
LLVM use option -Wno-sync-fetch-and-nand-semantics-changed to suppress alarm,is there a way to modify the code to cancel the alarm?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykk02PuzYQxj_NcBkROQYCHDjk5U8vW6mn5hgZewheETuyTaLsp68MbFpVe6hUCYE848fz4xmP8F5fDVEDxQGKUyKmMFjXfA3CXIMWZhB2l3RWvZqT7ntyZCR51AZ_Ox5RGIUfH3_-jgcaxENb51F0dgp4ufiXkZeeghwuwqiLiVuBnYDtz8IZba4orQlkAmT7NQE79lxyMRYGQk83YYKWHm2PYdCxcHDaeC1RRkJS-NRhmGEe5Ly2BvNNjuksN_Qk949DhCO8O_vQihQO5AihOKTniJrOqKkwKo2o6VuUrnWgOMGOraDz-0Q3C9n-zb4-8_JhtcJAPtSXHHj1sKMIeqSID3yP9-CAH-MKH2IEXiOUh0WJ-LN5wKtVtSggWwVQnn5EGEK4-8jHW-Dt1arOjmFj3RV4-wW8LVyhOvmH-Fy2RwcnT2hsIPjVwuEI1XFpbgx_N-Y7cx5es51hoBeq9WYEyNrltLfO3kPsSXo2Nv1PPmOw6Kf73ZH3KEbhbu-a2sdyjlDgU7zixptVun_NvZZWUQxJYSSNc2hRZ22imkzVWS0SarYl2xXbbVmxZGg41TtGRddnnSrLXV5ypjrWZxUriFfbPtENZzxnW16zkvGi3uSF4F2ey4xxRlx2kDO6CT1uxvFxi-Ym2vuJmrIuqzoZRUejnyeLc0NPnJPAeRw010RN2k1XDzkbtQ_-71OCDiM18CuDikHNzt_uL-ut-t-jmExubP51RXQYpm4j7Q14G0nWT3p39pNkAN7O_B54O__fXwEAAP__eRhbcA">