https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53991
--- Comment #8 from andysem at mail dot ru --- We have a similar problem in Boost.Atomic: https://svn.boost.org/trac/boost/ticket/10204 There we mark all boost::atomic<> functions as always_inline to make sure the compiler sees the memory order arguments as constants as opposed to runtime values (otherwise the compiler just ignores memory order arguments and acts as if seq_cst was specified). As I understand, atomic intrinsics are transaction_unsafe, so should be Boost.Atomic functions as well, yet we still want them always_inline. Given this I don't quite understand the reason why a transaction_unsafe function can't be inlined into the caller; the caller is unsafe anyway, isn't it? Is there a solution for this problem on the source code level, except removing always_inline?