https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123172
--- Comment #4 from Zdenek Sojka <zsojka at seznam dot cz> ---
(In reply to Jakub Jelinek from comment #3)
> IMHO no, you don't want CMPXCHG16B being used on _Atomic _BitInt(128) and
> locks on _BitInt(128), that will mean on the same object some access might
> use the former and some the latter.
As far as I can say, _BitInt(128) and _Atomic _BitInt(128) are different types,
so there cannot be the same object accessed via pointer to the other type; gcc
even errors out on such assignments:
$ cat aa.c
_Atomic __int128 aa;
__int128 ab;
_BitInt(128) bb;
_Atomic _BitInt(128) ba;
int main()
{
__builtin_printf("%lx %lx %lx\n", _Alignof(aa), _Alignof(ab),
_Alignof(bb));
return __atomic_load_16(&aa, __ATOMIC_RELAXED) + __atomic_load_16(&ab,
__ATOMIC_RELAXED) + __atomic_load_16(&bb, __ATOMIC_RELAXED);
}
$ x86_64-pc-linux-gnu-gcc aa.c
aa.c: In function 'main':
aa.c:8:25: error: initialization of '_BitInt(128) *' from incompatible pointer
type '_Atomic _BitInt(128) *' [-Wincompatible-pointer-types]
8 | _BitInt(128) *bbp = &ba;
| ^
aa.c:9:33: error: initialization of '_Atomic _BitInt(128) *' from incompatible
pointer type '_BitInt(128) *' [-Wincompatible-pointer-types]
9 | _Atomic _BitInt(128) *bap = &bb;
| ^