From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by sourceware.org (Postfix) with ESMTPS id A52A83858036 for ; Thu, 4 Nov 2021 09:45:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A52A83858036 Received: by mail-ed1-x530.google.com with SMTP id g10so19117143edj.1 for ; Thu, 04 Nov 2021 02:45:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SzirarVnGJIn5KInYo4DsIRM2pGcPJTPa6hWUGdG3rM=; b=YRvUTdfBZhv+SvF2Ly5tGqWvDYkTx89ic7iXjZbakj6S+hiCOruq43T2vQp+CfYGHQ GsjOgOiDnIOi6D02rzD3g9PDntzWoBPbunuUbF8Ipc+QeyQhc8IuRnzxprWfm6oQlLmi ADqVspJakcAqKhx3WD6SI+J8Ng2j/1k5NjViGuPHHUWjvVnGCv/34vhy1bBZQPulNgvj ts+MhodqjBbSxmBEvAReH/3w3g0XvYPnZapuSKiy6LazImnlty6HuwglLu7aZRf6ZyPb vuOWLTSREeduT6DppbM5bECxfnzVeLUOM3Hh6uJKMddQAbE3VnbqyOw0emrW00molQ9y t9kA== X-Gm-Message-State: AOAM532988Qdclxz07r9vBVd1x4mFTmk5FpHIY5CTTrNuACNA8ie26q9 TLIfWuSJnIx0NXHk4NqLG5FZiP/Qfd4LedBjCOI= X-Google-Smtp-Source: ABdhPJx0+biOUcU/uBstUFEnqfQCRuGcLjpvy+iy0w6u7CZDrmtiArauy9UhUfkGQshrzWAIsQSUEifs3iLCABLygJM= X-Received: by 2002:aa7:c501:: with SMTP id o1mr67063452edq.99.1636019103658; Thu, 04 Nov 2021 02:45:03 -0700 (PDT) MIME-Version: 1.0 References: <20211103150415.1211388-1-hjl.tools@gmail.com> <87v91917mb.fsf@igel.home> In-Reply-To: From: Oleh Derevenko Date: Thu, 4 Nov 2021 11:44:52 +0200 Message-ID: Subject: Re: [PATCH] x86: Optimize atomic_compare_and_exchange_[val|bool]_acq [BZ #28537] To: "H.J. Lu" Cc: Andreas Schwab , Arjan van de Ven via Libc-alpha , Arjan van de Ven Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Nov 2021 09:45:06 -0000 Hi On Thu, Nov 4, 2021 at 10:58 AM Oleh Derevenko 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