RESOLVED FIXED 266649
Failure memory order cannot be release or acq_rel.
https://bugs.webkit.org/show_bug.cgi?id=266649
Summary Failure memory order cannot be release or acq_rel.
Seija K.
Reported 2023-12-19 11:15:14 PST
It is undefined behavior and clang now enforces this.
Attachments
Alexey Proskuryakov
Comment 1 2023-12-20 09:59:46 PST
Mark Lam
Comment 2 2023-12-20 10:14:46 PST
(In reply to Seija K. from comment #0) > It is undefined behavior and clang now enforces this. Can you please point us to the C++ spec where it says that using release or acq_rel for the failure memory order is undefined behavior? Thanks.
Radar WebKit Bug Importer
Comment 3 2023-12-22 08:29:21 PST
Mark Lam
Comment 4 2023-12-22 08:32:03 PST
(In reply to Mark Lam from comment #2) > Can you please point us to the C++ spec where it says that using release or > acq_rel for the failure memory order is undefined behavior? Thanks. From https://en.cppreference.com/w/cpp/atomic/atomic/compare_exchange: ``` If failure is stronger than success or(until C++17) is one of std::memory_order_release and std::memory_order_acq_rel, the behavior is undefined. ``` Also, from that link, there's a table that says for `compare_exchange_strong`'s "load operation" in the failure mode, to use: ``` * std::memory_order_acquire if order is std::memory_order_acq_rel * std::memory_order_relaxed if order is std::memory_order_release * otherwise order ```
EWS
Comment 5 2023-12-22 13:05:12 PST
Committed 272461@main (d2ba4a07e209): <https://commits.webkit.org/272461@main> Reviewed commits have been landed. Closing PR #22049 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.