https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78158
--- Comment #5 from Dmitry Vyukov <dvyukov at google dot com> --- I may be missing something, but can't we just always emit calls into tsan runtime under tsan? They accept the memory order value and can work with constants and runtime values.