This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: inline assembly uses a different nameset
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: wz6b at arrl dot net
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 26 Dec 2002 15:05:28 +0000
- Subject: Re: inline assembly uses a different nameset
- References: <200212252104.28405.wz6b@arrl.net>
Matt Young wrote:
Source:
asm("sub $0x0c,%esp");
asm ("push %0" : : "o" (v));
asm("call %0" :: "m"(printf));
asm("add $0x10,%esp");
printf(v);
Look at the output of -S, and you'll see that the assembly insert refers
to a variable initialized with the address of printf.
btw, you should use a single insert for a block of assembler, not
several different inserts. gcc might rearrange things otherwise.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
The voices in my head said this was stupid too
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org