https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104187
--- Comment #8 from Dávid Bolvanský <david.bolvansky at gmail dot com> ---
So this works in Clang now
int foo(int x, int y) { // any compiler will happily inline this function
return x / y;
}
int test(int x, int y) {
int r = 0;
[[clang::noinline]] r += foo(x, y); // for some reason we don't want any
inlining here
return r;
}
foo(int, int): # @foo(int, int)
mov eax, edi
cdq
idiv esi
ret
test(int, int): # @test(int, int)
jmp foo(int, int) # TAILCALL
foo(int, int): # @foo(int, int)
mov eax, edi
cdq
idiv esi
ret
test(int, int): # @test(int, int)
jmp foo(int, int) # TAILCALL