This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
inline assembly uses a different nameset
- From: Matt Young <wz6b at arrl dot net>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 25 Dec 2002 21:04:28 -0800
- Subject: inline assembly uses a different nameset
- Reply-to: wz6b at arrl dot net
Source:
asm("sub $0x0c,%esp");
asm ("push %0" : : "o" (v));
asm("call %0" :: "m"(printf));
asm("add $0x10,%esp");
printf(v);
Disassembly:
0x80483f8 <main+30>: sub $0xc,%esp
0x80483fb <main+33>: pushl 0x80494a0
0x8048401 <main+39>: call 0x8048490 <_IO_stdin_used+32>
0x8048406 <main+44>: add $0x10,%esp
0x8048409 <main+47>: sub $0xc,%esp
0x804840c <main+50>: pushl 0x80494a0
0x8048412 <main+56>: call 0x8048268 <printf>
0x8048417 <main+61>: add $0x10,%esp
Note the two different results for the value of printf=