From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id CC000B70A8 for ; Tue, 30 Jun 2009 20:43:27 +1000 (EST) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B154FDDD0B for ; Tue, 30 Jun 2009 20:43:26 +1000 (EST) Subject: Re: Inline Assembly queries From: Benjamin Herrenschmidt To: David Howells In-Reply-To: <30098.1246291036@redhat.com> References: <30098.1246291036@redhat.com> Content-Type: text/plain Date: Tue, 30 Jun 2009 20:43:03 +1000 Message-Id: <1246358583.31413.11.camel@pasglop> Mime-Version: 1.0 Cc: gcc-help@gcc.gnu.org, linuxppc-dev@ozlabs.org, kernel mailz List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Mon, 2009-06-29 at 16:57 +0100, David Howells wrote: > kernel mailz wrote: > > > asm("sync"); > > Isn't gcc free to discard this as it has no dependencies, no indicated side > effects, and isn't required to be kept? I think this should probably be: > > asm volatile("sync"); It should also have a "memory" clobber or it's pointless since gcc would otherwise be free to move load and stores accross that barrier. Cheers, Ben.