This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/65146] alignment of _Atomic structure member is not correct
- From: "alexey.lapshin at oracle dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 20 Feb 2015 22:14:38 +0000
- Subject: [Bug c/65146] alignment of _Atomic structure member is not correct
- Auto-submitted: auto-generated
- References: <bug-65146-4 at http dot gcc dot gnu dot org/bugzilla/>
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.