Код: Выделить всё
__attribute__((noinline)) void touch_noinline(int&) {}
void touch_external(int&);
int f(int x) {
touch_noinline(x);
return x;
}
int g(int x) {
touch_external(x);
return x;
}
< /code>
Но я был неправ: < /p>
touch_noinline(int&):
ret
f(int):
mov eax, edi
ret
g(int):
push rax
mov dword ptr [rsp + 4], edi
lea rdi, [rsp + 4]
call touch_external(int&)@PLT
mov eax, dword ptr [rsp + 4]
pop rcx
ret
Подробнее здесь: https://stackoverflow.com/questions/797 ... t-optimise
Мобильная версия