From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21383 invoked by alias); 16 Feb 2011 10:33:12 -0000 Received: (qmail 21372 invoked by uid 22791); 16 Feb 2011 10:33:12 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-px0-f175.google.com (HELO mail-px0-f175.google.com) (209.85.212.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 16 Feb 2011 10:33:06 +0000 Received: by pxi17 with SMTP id 17so216954pxi.20 for ; Wed, 16 Feb 2011 02:33:04 -0800 (PST) MIME-Version: 1.0 Received: by 10.142.203.12 with SMTP id a12mr358024wfg.122.1297852384363; Wed, 16 Feb 2011 02:33:04 -0800 (PST) Received: by 10.143.33.5 with HTTP; Wed, 16 Feb 2011 02:33:04 -0800 (PST) In-Reply-To: <4D5B1310.5070406@andihellmund.com> References: <4D5B1310.5070406@andihellmund.com> Date: Wed, 16 Feb 2011 10:59:00 -0000 Message-ID: Subject: Re: need volatile for asm? From: Drasko DRASKOVIC To: Andi Hellmund Cc: kevin diggs , gcc-help@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes 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 X-SW-Source: 2011-02/txt/msg00230.txt.bz2 On Wed, Feb 16, 2011 at 12:58 AM, Andi Hellmund wrote: > On 02/16/2011 12:11 AM, kevin diggs wrote: > A possible way to verify the need of volatile would be to compile the code > at a high optimization level, e.g. -O3 and check the assembly code (-S > option) if the inline assembly was removed or NOT. Would this be portable check, guaranteeing that compilation on other machine with other gcc version will not do opposite ? And anyway, why not always putting it to volatile ? Once you started embedding asm code, I guess you had a good reason for it to appear in the output code... BR, Drasko