This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: inline assembly uses a different nameset


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]