Issue 136428
Summary Clang uses wrong ABI for __atomic_store_16 on Windows
Labels clang
Assignees
Reporter Alcaro
    ```c++
unsigned __int128 g;
extern "C" void k(unsigned __int128* a, unsigned __int128 b, int c);
extern "C" void r()
{
    k(&g, 1234, 5);
}
extern "C" void p()
{
    __atomic_store_n(&g, 1234, __ATOMIC_SEQ_CST);
}
```
Expected: Pass the int128 by reference, and place __ATOMIC_SEQ_CST=5 in r8d, for both calls, like GCC.

Actual: Clang calls __atomic_store_16 by passing the int128 by value in r8:rdx, and the 5 goes in r9d. https://godbolt.org/z/49Gzso4ax

Originally reported at https://github.com/brechtsanders/winlibs_mingw/issues/256
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to