From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3249 invoked by alias); 2 Aug 2002 22:34:28 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 3242 invoked from network); 2 Aug 2002 22:34:27 -0000 Received: from unknown (HELO mail-out2.apple.com) (17.254.0.51) by sources.redhat.com with SMTP; 2 Aug 2002 22:34:27 -0000 Received: from mailgate2.apple.com (A17-129-100-225.apple.com [17.129.100.225]) by mail-out2.apple.com (8.11.3/8.11.3) with ESMTP id g72MYQA24582 for ; Fri, 2 Aug 2002 15:34:26 -0700 (PDT) Received: from scv3.apple.com (scv3.apple.com) by mailgate2.apple.com (Content Technologies SMTPRS 4.2.1) with ESMTP id for ; Fri, 2 Aug 2002 15:34:26 -0700 Received: from johada (johada.apple.com [17.201.20.167]) by scv3.apple.com (8.11.3/8.11.3) with ESMTP id g72MYQT11352 for ; Fri, 2 Aug 2002 15:34:26 -0700 (PDT) Date: Fri, 02 Aug 2002 15:34:00 -0000 Mime-Version: 1.0 (Apple Message framework v472) Content-Type: text/plain; charset=US-ASCII; format=flowed Subject: asm load/store From: Dale Johannesen To: gcc-help@gcc.gnu.org Content-Transfer-Encoding: 7bit Message-Id: X-SW-Source: 2002-08/txt/msg00017.txt.bz2 Is it true that an asm() that is actually a load or store, and for which it's impossible to figure out exactly which memory it touches by examining the arguments, must be declared "volatile" to work correctly? It would be nice to have something that doesn't disable the optimizer so completely yet gets the semantics right. I suppose the declaration to clobber "memory" started out as an attempt to model a store, but it doesn't work, and from the current docs is apparently not expected to work: asm (clobbers memory) store (non-asm) asm (clobbers memory, identical to above) cse removes the 2nd asm (sharing it with the first). If it thought that clobbering memory==store, it could not do that.