我有一個非常簡單的測試程序:問題有關反彙編輸出
void test()
{
int a = 15;
int b = 17;
int c, d;
c = a + b;
d = a | c;
printf("%d", d);
}
我產生那麼目標文件,然後我disassemly目標文件看指令字的ADD和OR操作如下:
sparc-elf-objdump -d test.o
產生的disassemly如下所示:
test.o: file format elf32-sparc
Disassembly of section .text:
00000000 <test>:
0: 11 00 00 00 sethi %hi(0), %o0
4: 90 12 20 00 mov %o0, %o0 ! 0 <test>
8: 92 10 20 2f mov 0x2f, %o1
c: 82 13 c0 00 mov %o7, %g1
10: 40 00 00 00 call 10 <test+0x10>
14: 9e 10 40 00 mov %g1, %o7
18: 01 00 00 00 nop
正如你可以看到,他們的既不是ADD指令,也不是查找的OR指令。 Anyeone爲什麼會這樣?相當混亂......
非常感謝, 吉姆
烏夫,completley忘了我有優化,謝謝你留下我... – Jim