Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2736984pxj; Sun, 6 Jun 2021 12:10:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIoo5ZH8CDSvDBuEswpIM5e4P+v9s89GXGAaIoF7OIxgmmzIqIfEg2XdzpcPXe0WIUVP6l X-Received: by 2002:a05:6402:157:: with SMTP id s23mr16941269edu.282.1623006658982; Sun, 06 Jun 2021 12:10:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623006658; cv=none; d=google.com; s=arc-20160816; b=cnhPvMFXpxZnpu7jqjfMjLWVHi4gKmmnVN10XlCmqTd5FkV9LPfNxtnam5cyeJeJ4T Hlnguf6cmTNMnW2+mc4eKBaEwfkHqwvM/aTquSGbHq4v7ioUfKC0SvS3totej0WZolF/ Q1mD2oi7TADHQd0fqFFbBHY6Tqww1kc3IplsZkC3B8zEmFlsQE5VoQd6gZTBHlzcOOxN 4ZpXMdQLYErWe++F8P16n1/dQAHt25Fz+NXRKxZPzRQJ5SmYu1ZuObfhAuZm2OIi7jbJ aCed2ClHqp+kQvcWXcHMVcwRRn9WOZVC5+N67ipm0z1kZ4gHx/1VQ0mxbEbTiahS3QoD btVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=YS8eaynsQwFvijuPsj/1jC8f6dWmG8W4kj7cfSywJII=; b=lLKYHkgADP37qAnPPYgHVR/US4qCNQo5LS1CSn7+D3EqyOCeKqpoCww+rVRLb4InAs AYhYRBneYCjKn8S96xIeTz5ah1oVPOj5fqEfOFfYAdmnfIEGo/B//8c1hL9P2VKwIbGk gydSvnxgKAQ67vVrH+2MNbCo/Tv2qQNINEQIeLj8cKioros7ChoeeZILvQsGaRvgYa+J yB+/uQ209z3VIKO9rO366HlLIALGo/Ta/r2NtrLMTNst5xxnw5nCcYsFIUIb5fiyjTxj lilNPcjezZH4um377ZYaaJqttfeTi8I7VTl724CN3oe5aX34jAY3OuHMUwpwpZY6t44d tpbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IFoz5fTD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s6si1965240ejs.567.2021.06.06.12.10.28; Sun, 06 Jun 2021 12:10:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IFoz5fTD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229885AbhFFTIx (ORCPT + 99 others); Sun, 6 Jun 2021 15:08:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:60900 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229799AbhFFTIx (ORCPT ); Sun, 6 Jun 2021 15:08:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F03EE61008; Sun, 6 Jun 2021 19:07:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623006423; bh=d2HVLIJRxM3MJUJzNoNPukJKGJ4n+a/NjzxsdmX/Ht4=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=IFoz5fTDF3rbV7e6pETWK8GY2s/H+L/kS0UI7rnuoNfu9HZxd4zyy0MpexWZs6N3D 0BpMxhG304kW9LgPnT6+2UvT0VdoBSOL1auWyA9WxCp/YzIVl9sYJWL8LPIRu9VSES MdbjpHpWMk9Yo0A9qX1SO7rIHCZS8IBmPqBRHpwBcIAw1ND2I8mwwgnfJ+yxxaB7A9 uWsBgQq91qun47ev3o3GYyis6LRyTGCD+Qeg2R3ms1VWrvEy6r6mLKgAnBU7yhn/zM ZSMRrbCw4DTWio+HsE3p7F2QTrrMtHgV0f/rTa5utI+g9P0J/KV9egbeygelPlWHt6 vLV8G9aXndgTA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id BCD105C014A; Sun, 6 Jun 2021 12:07:02 -0700 (PDT) Date: Sun, 6 Jun 2021 12:07:02 -0700 From: "Paul E. McKenney" To: Segher Boessenkool Cc: Linus Torvalds , Alan Stern , Peter Zijlstra , Will Deacon , Andrea Parri , Boqun Feng , Nick Piggin , David Howells , Jade Alglave , Luc Maranget , Akira Yokosawa , Linux Kernel Mailing List , linux-toolchains@vger.kernel.org, linux-arch Subject: Re: [RFC] LKMM: Add volatile_if() Message-ID: <20210606190702.GL4397@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20210604205600.GB4397@paulmck-ThinkPad-P17-Gen-1> <20210604214010.GD4397@paulmck-ThinkPad-P17-Gen-1> <20210605145739.GB1712909@rowland.harvard.edu> <20210606001418.GH4397@paulmck-ThinkPad-P17-Gen-1> <20210606012903.GA1723421@rowland.harvard.edu> <20210606044333.GI4397@paulmck-ThinkPad-P17-Gen-1> <20210606131740.GU18427@gate.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210606131740.GU18427@gate.crashing.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 06, 2021 at 08:17:40AM -0500, Segher Boessenkool wrote: > On Sat, Jun 05, 2021 at 09:43:33PM -0700, Paul E. McKenney wrote: > > So gcc might some day note a do-nothing asm and duplicate it for > > the sole purpose of collapsing the "then" and "else" clauses. I > > guess I need to keep my paranoia for the time being, then. :-/ > > Or a "do-something" asm, even. What it does is make sure it is executed > on the real machine exactly like on the abstract machine. That is how C > is defined, what a compiler *does*. > > The programmer does not have any direct control over the generated code. I am not looking for direct control, simply sufficient influence. ;-) > > Of course, there is no guarantee that gcc won't learn about > > assembler constants. :-/ > > I am not sure what you call an "assembler constant" here. But you can > be sure that GCC will not start doing anything here. GCC does not try > to understand what you wrote in an inline asm, it just fills in the > operands and that is all. It can do all the same things to it that it > can do to any other code of course: duplicate it, deduplicate it, > frobnicate it, etc. Apologies, that "assembler constants" should have been "assembler comments". Thanx, Paul