上面可以看到isFn2()函数会被函数main所调用( call a <__Z5isFn2PFvvE> ),并且在O0优化下是不会被内联的。内联函数
但在O3优化下,情况又有所不同:
00000000 <__Z3fn1v>: 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: c9 leave 4: c3 ret 5: 8d 76 00 lea 0x0(%esi),%esi 00000008 <__Z3fn2v>: 8: 55 push %ebp 9: 89 e5 mov %esp,%ebp b: c9 leave c: c3 ret d: 8d 76 00 lea 0x0(%esi),%esi 00000010 <__Z5isFn2PFvvE>: 10: 55 push %ebp 11: 89 e5 mov %esp,%ebp 13: 81 7d 08 08 00 00 00 cmpl $0x8,0x8(%ebp) <--------------------------- 1a: 0f 94 c0 sete %al 1d: c9 leave 1e: c3 ret 1f: 90 nop 00000020 <_main>: 20: 55 push %ebp 21: 89 e5 mov %esp,%ebp 23: 83 e4 f0 and $0xfffffff0,%esp 26: 56 push %esi 27: 53 push %ebx 28: 83 ec 08 sub $0x8,%esp 2b: e8 00 00 00 00 call 30 <_main+0x10> 30: bb e8 03 00 00 mov $0x3e8,%ebx 35: eb 0b jmp 42 <_main+0x22> 37: 90 nop 38: be 08 00 00 00 mov $0x8,%esi 3d: ff d6 call *%esi 3f: 4b dec %ebx 40: 74 12 je 54 <_main+0x34> 42: 81 fe 08 00 00 00 cmp $0x8,%esi <--------------------------- 48: 75 ee jne 38 <_main+0x18> 4a: be 00 00 00 00 mov $0x0,%esi 4f: ff d6 call *%esi 51: 4b dec %ebx 52: 75 ee jne 42 <_main+0x22> 54: 31 c0 xor %eax,%eax 56: 83 08 add $0x8,%esp 59: 5b pop %ebx 5a: 5e pop %esi 5b: c9 leave 5c: c3 ret 5d: 90 nop 5e: 90 nop 5f: 90 nop
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-34432-4.html
在短短十个月内连阿里在美股票市场都能在一百二十美金跌破发行价
一是日本经过明治维新全民造舰的浪潮