From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13659 invoked by alias); 24 May 2006 05:37:39 -0000 Received: (qmail 13649 invoked by uid 22791); 24 May 2006 05:37:38 -0000 X-Spam-Check-By: sourceware.org Received: from yosemite.airs.com (HELO yosemite.airs.com) (205.217.158.180) by sourceware.org (qpsmtpd/0.31) with SMTP; Wed, 24 May 2006 05:37:36 +0000 Received: (qmail 31067 invoked by uid 10); 24 May 2006 05:37:35 -0000 Received: (qmail 9791 invoked by uid 500); 24 May 2006 05:37:28 -0000 Mail-Followup-To: gcc-help@gcc.gnu.org, stsp@aknet.ru To: Stas Sergeev Cc: gcc-help@gcc.gnu.org Subject: Re: problem passing constants to inline asm References: <4471F10E.2010500@aknet.ru> From: Ian Lance Taylor Date: Wed, 24 May 2006 05:37:00 -0000 In-Reply-To: <4471F10E.2010500@aknet.ru> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes 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 X-SW-Source: 2006-05/txt/msg00235.txt.bz2 Stas Sergeev writes: > I am trying to write something like this: > > asm volatile (".space %0\n" :: "i"(sizeof(var))); > > but this doesn't work because "i" prepends the number > with the $ sign. > I've only found the following hack to cheat gcc: > > asm volatile (".space %0\n" :: "m"(*(long*)sizeof(var))); > > but that's quite nasty and doesn't work with -O0. > > So, what is the right way of passing the constants to those > "Special Dot Symbols" of gas? Try %c0. Ian