From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 47123 invoked by alias); 13 Sep 2019 08:15:22 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 46748 invoked by uid 89); 13 Sep 2019 08:15:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=him, Ltd, ltd X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 13 Sep 2019 08:15:19 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E035710A1B; Fri, 13 Sep 2019 08:15:17 +0000 (UTC) Received: from zarquon.pink (unknown [10.33.36.135]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1058F600CE; Fri, 13 Sep 2019 08:15:16 +0000 (UTC) Subject: Re: About machine description for atomic_exchange To: William Tambe , Oleg Endo Cc: gcc-help References: From: Andrew Haley Openpgp: preference=signencrypt Message-ID: Date: Fri, 13 Sep 2019 08:15:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-09/txt/msg00043.txt.bz2 On 9/12/19 4:04 PM, William Tambe wrote: > Is there an example, not necessarily for atomic_exchange, that I can follow ? > > Also, is this behavior related to GCC memory model ? ie: > (MEM_VOLATILE_P (operands[1])) for atomic_exchange always TRUE > regardless of whether the memory operand was declared using > "volatile" I've been thinking about this, and have been unable to come up with a use for a non-volatile atomic_exchange. If you had such a thing you'd also have undefined behaviour if an other thread accessed the operand racily. -- Andrew Haley (he/him) Java Platform Lead Engineer Red Hat UK Ltd. https://keybase.io/andrewhaley EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671