inline assembly uses a different nameset

Matt Young wz6b@arrl.net
Wed Dec 25 21:06:00 GMT 2002


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=



More information about the Gcc-bugs mailing list