------- Comment #6 from vvv at ru dot ru 2009-04-28 21:18 ------- Let's compile file test.c //#file test.c
extern int F(int m); void func(int x) { int u = F(x); while (u) u = F(u)*3+1; } # gcc -o t.out test.c -c -O2 # objdump -d t.out t.out: file format elf64-x86-64 Disassembly of section .text: 0000000000000000 <func>: 0: 48 83 ec 08 sub $0x8,%rsp 4: e8 00 00 00 00 callq 9 <func+0x9> 9: 85 c0 test %eax,%eax b: 89 c7 mov %eax,%edi d: 74 0e je 1d <func+0x1d> f: 90 nop 10: e8 00 00 00 00 callq 15 <func+0x15> 15: 8d 7c 40 01 lea 0x1(%rax,%rax,2),%edi 19: 85 ff test %edi,%edi 1b: 75 f3 jne 10 <func+0x10> 1d: 48 83 c4 08 add $0x8,%rsp 21: 0f 1f 80 00 00 00 00 nopl 0x0(%rax) <---- nonoptimal 28: c3 retq -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39942