https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93224

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Reduced test-case:

#include <atomic>

int main()
{
  long double value;
  if constexpr (std::atomic_ref<long double>::is_always_lock_free)
  {
    bool ok;
    const auto mo = std::memory_order_relaxed;
    std::atomic_ref<long double> a(value);

    a.exchange(1.0l);
    auto expected = 1.0l;
    ok = a.compare_exchange_strong(expected, 204.8l, mo);
    expected = a.load() + 2;
    ok = a.compare_exchange_strong(expected, 1.0l, mo);
    a.fetch_add(3.2l);
    if ( a != 208.0l )
      __builtin_abort ();
  }

  return 0;
}

Reply via email to