https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63805
--- Comment #10 from Martin Sebor <msebor at gcc dot gnu.org> --- Since the manual says that "... The four non-arithmetic functions (load, store, exchange, and compare_exchange) all have a generic version as well. This generic version works on any data type." I believe the code in the small test case in comment #4 (and probably also the bigger test case in the description that I reduced the small one from) is valid.