Furthermore you can actually see a variant of the problem with this test code even on non-MIPS: $ uname -m x86_64 $ cat - >main.cc <<EOT #include <atomic> int main(void) { // a fancy type that needs -mcx16 struct Foo { unsigned __int128 x; }; std::atomic<Foo> y; y.is_lock_free(); } EOT $ g++ -std=c++11 main.cc /tmp/h43jh.o: In function `std::atomic<main::Foo>::is_lock_free() const’: main.cc:(text+0x57): undefined reference to `__atomic_is_lock_free’ collect2: error: ld returned 1 exit status $ echo $? 1 $ echo $? 0 The compiler can see the atomic and its use are dead code and removes them. |