This patch updates the atomic support for TS18508, namely: – The atomic intrinsics now take a STAT= argument – Add the new atomics atomic_{add,and,or,xor} and their fetch variants atomic_fetch_{add,and,or,xor} – and compare and swap (atomic_cas) In addition, the previous implementation (for -fcoarray=single) used simple assignments; the patch changes those to using real atomic operations, which makes the atomic operations thread safe. Build and regtested on x86-64-gnu-linux. OK for the trunk? As next step, library calls have to be added for -fcoarray=lib. For coarrays, I also a have still on my to do list: Adding a type-conversion test case for -fcorray=lib; implementing in the library the support for vector subscripts; and fixing an issue with nonallocatable polymorphic dummy coarrays and select type. For full F2008 support, the following is needed as well: locking and critical blocks – and allocatable/pointer components of derived types. For TS18508 much more is needed, in particular co_reduce/co_broadcast and team support. Tobias