[Bug c/65146] alignment of _Atomic structure member is not correct
alexey.lapshin at oracle dot com
gcc-bugzilla@gcc.gnu.org
Fri Feb 20 22:51:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65146
--- Comment #2 from Alexey Lapshin <alexey.lapshin at oracle dot com> ---
if alignment of atomic object less then it`s size then it could not be
lock-free on x86 32. If that object would split across cache lines then the
operation would not be atomic.
At the same time compiler reports for this 8-bytes size object:
__atomic_always_lock_free(sizeof(obj2.ao), &obj2.ao) TRUE
atomic_is_lock_free( &obj2.ao ) TRUE
so it looks like lock-free atomic operation on this 4-bytes aligned data object
could fail to be atomic.
More information about the Gcc-bugs
mailing list