From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24818 invoked by alias); 16 Feb 2011 11:18:24 -0000 Received: (qmail 24807 invoked by uid 22791); 16 Feb 2011 11:18:23 -0000 X-SWARE-Spam-Status: No, hits=-0.5 required=5.0 tests=AWL,BAYES_00,RCVD_NUMERIC_HELO,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from lo.gmane.org (HELO lo.gmane.org) (80.91.229.12) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 16 Feb 2011 11:18:17 +0000 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PpfOg-0004uO-Ed for gcc-help@gcc.gnu.org; Wed, 16 Feb 2011 12:18:14 +0100 Received: from 79.161.10.130 ([79.161.10.130]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 16 Feb 2011 12:18:14 +0100 Received: from david by 79.161.10.130 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 16 Feb 2011 12:18:14 +0100 To: gcc-help@gcc.gnu.org From: David Brown Subject: Re: need volatile for asm? Date: Wed, 16 Feb 2011 12:12:00 -0000 Message-ID: References: <4D5B1310.5070406@andihellmund.com> <4D5BAE09.7060808@andihellmund.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7 In-Reply-To: <4D5BAE09.7060808@andihellmund.com> 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/msg00232.txt.bz2 On 16/02/2011 11:59, Andi Hellmund wrote: > > Would this be portable check, guaranteeing that compilation on other > > machine with other gcc version will not do opposite ? > > You are right, this is definitely NOT portable > >> 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... > > Good point. > There are certainly times when you want to use embedded assembly, but don't always want it to appear on the output code - then gcc's ability to optimise and rearrange inline assembly is very nice. But this isn't one of the cases :-)