https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70191
--- Comment #3 from Alexey Lapshin <alexey.lapshin at oracle dot com> --- Please note : that is not the case of using correct -march. That is old code compatibility issue. Check the scenario on that page : https://gcc.gnu.org/wiki/Atomic/GCCMM/LIbrary It is OK to compile the user library for non-nehalem(calls to __atomic_load_16 would be inserted). It is OK to compile user code for nehalem(cmpxchg16b would be inlined) Link those two and run them on a nehalem. The problem is exactly with this scenario. When old code and new would be run on nehalem then different locking mechanism would be used. New code - cmpxchg16b. Old code - locking code from libatomic. To work correctly libatomic library should check for cmpxchg16b at run-time and use this version if available. This is not work currently on Solaris.