[Bug target/65146] alignment of _Atomic structure member is not correct
peter at cordes dot ca
gcc-bugzilla@gcc.gnu.org
Tue Sep 5 13:58:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65146
--- Comment #6 from Peter Cordes <peter at cordes dot ca> ---
My test-case on godbolt: https://godbolt.org/g/MmLycw. gcc8 snapshot still
only has 4B alignment
Fun fact: clang4.0 -m32 inlines lock cmpxchg8b for 8-byte atomic load/store.
This is ironic, because it *does* align _Atomic 64-bit objects to 8 bytes so
it could safely use SSE loads/stores. It would work correctly if called from
gcc-compiled code that passed it a misaligned atomic_llong *. But since gcc
and clang don't agree on i386 SysV struct layout for _Atomic 64-bit members, so
clang should really just start using movq for 64-bit atomic objects in 32-bit
mode.
More information about the Gcc-bugs
mailing list