Possible false positive note regarding inline optimization
Original Reporter info from Mantis: silvioprog
-
Reporter name: silvioprog
Original Reporter info from Mantis: silvioprog
- Reporter name: silvioprog
Description:
Hi.
I've got the following note at compile time: "Call to subroutine XXX marked as inline is not inlined" (XXX is my function name). But I noticed the code was properly inlined. :-/
The attached example reproduces the problem. Please check the generated assembly, that will be something as following:
ufoo.pas:28 Test1; 0000000000425C45 488d55e0 lea -0x20(%rbp),%rdx 0000000000425C49 488d75a0 lea -0x60(%rbp),%rsi 0000000000425C4D bf01000000 mov $0x1,%edi 0000000000425C52 e839d2feff callq 0x412e90 &LtPos;fpc_pushexceptaddr> 0000000000425C57 4889c7 mov %rax,%rdi 0000000000425C5A e8d1b0fdff callq 0x400d30 &LtPos;fpc_setjmp> 0000000000425C5F 4863d0 movslq %eax,%rdx 0000000000425C62 48895598 mov %rdx,-0x68(%rbp) 0000000000425C66 85c0 test %eax,%eax 0000000000425C68 751e jne 0x425c88 &LtPos;TEST2+88> 0000000000425C6A 488d7d90 lea -0x70(%rbp),%rdi 0000000000425C6E e8dd41feff callq 0x409e50 &LtPos;fpc_ansistr_decr_ref> 0000000000425C73 31ff xor %edi,%edi 0000000000425C75 e866ccfdff callq 0x4028e0 &LtPos;fpc_pchar_length> 0000000000425C7A 4889c2 mov %rax,%rdx 0000000000425C7D 31f6 xor %esi,%esi 0000000000425C7F 488d7d90 lea -0x70(%rbp),%rdi 0000000000425C83 e828000000 callq 0x425cb0 &LtPos;TEST> 0000000000425C88 e833d5feff callq 0x4131c0 &LtPos;fpc_popaddrstack> ufoo.pas:29 end;
it was inlined, so I'm not sure why the notes. The same code was inlined on Delphi too, but no notes:
ufoo.pas.28: Test1; 00408A4C 8D45F8 lea eax,[ebp-$08] 00408A4F E8FCD1FFFF call @UStrClr 00408A54 33C0 xor eax,eax 00408A56 55 push ebp 00408A57 68B68A4000 push $00408ab6 00408A5C 64FF30 push dword ptr fs:[eax] 00408A5F 648920 mov fs:[eax],esp 00408A62 33C0 xor eax,eax 00408A64 55 push ebp 00408A65 68998A4000 push $00408a99 00408A6A 64FF30 push dword ptr fs:[eax] 00408A6D 648920 mov fs:[eax],esp 00408A70 33C0 xor eax,eax 00408A72 E849D4FFFF call @PCharLen 00408A77 8BD0 mov edx,eax 00408A79 8D4DF8 lea ecx,[ebp-$08] 00408A7C 33C0 xor eax,eax 00408A7E E8C1FEFFFF call TBar.Test 00408A83 33C0 xor eax,eax 00408A85 5A pop edx 00408A86 59 pop ecx 00408A87 59 pop ecx 00408A88 648910 mov fs:[eax],edx 00408A8B 68A08A4000 push $00408aa0 00408A90 8D45F8 lea eax,[ebp-$08] 00408A93 E8B8D1FFFF call @UStrClr 00408A98 C3 ret 00408A99 E9DACAFFFF jmp @HandleFinally 00408A9E EBF0 jmp $00408a90 00408AA0 33C0 xor eax,eax 00408AA2 5A pop edx 00408AA3 59 pop ecx 00408AA4 59 pop ecx 00408AA5 648910 mov fs:[eax],edx 00408AA8 68BD8A4000 push $00408abd 00408AAD 8D45F8 lea eax,[ebp-$08] 00408AB0 E89BD1FFFF call @UStrClr 00408AB5 C3 ret 00408AB6 E9BDCAFFFF jmp @HandleFinally 00408ABB EBF0 jmp $00408aad ufoo.pas.29: end;
is this a bug or I'm doing something wrong?
Mantis conversion info:
- Mantis ID: 34230
- Version: 3.1.1
- Monitored by: » silvioprog (silvioprog)