This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/65146] alignment of _Atomic structure member is not correct


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]