It would be great if somebody could take a look at PR96159.
It seems we do not do atomic accesses correctly when the alignment is insufficient for a lockfree access, but I think we should fall back to a library call in this case (as clang does). This is very unfortunate as it is an important functionality to be able to do atomic accesses on non-atomic types and it seems there is no way to achieve this. Also documentation and various descriptions of the atomic functions imply that this is expected to work. But maybe I am missing something and the generated code is indeed safe. Martin