Open
Description
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 by @progmachine at brechtsanders/winlibs_mingw#256