Building A Compiler Optimizing C++ Atomic Accesses