The current implementations of _Copy_conjoint_{jshorts,jints,jlongs}_atomic on Linux and BSD for AArch64 do not prevent the compiler from replacing the loops with memcpy which is free to copy byte by byte which can lead to tearing. Currently neither Clang nor GCC perform this optimization on AArch64 but there is nothing stopping them from doing it in the future. To fix this we either need to cast the pointer for each store to have volatile in it or use Atomic::store.
- links to
-
Review(master) openjdk/jdk/27647