[PATCH] x86: Optimize atomic_compare_and_exchange_[val|bool]_acq [BZ #28537]

Oleh Derevenko oleh.derevenko@gmail.com
Thu Nov 4 09:44:52 GMT 2021


Hi

On Thu, Nov 4, 2021 at 10:58 AM Oleh Derevenko <oleh.derevenko@gmail.com> wrote:
> Also, another problem, blindly taking
>  __typeof (*(mem)) oldmem = ...
> could declare the "oldmem" variable with const and/or volatile
> (depending on the actual parameter to the macro) and make either an
> assignment to const (a compile error) or an assignment to volatile
> (unnecessary forced store into memory with following retrieval from
> there).

Well, const cannot appear in the target, of course. But volatile can.

-- 

Oleh Derevenko
-- Skype with underscore


More information about the Libc-alpha mailing list