For
int callee(void);
int caller(void) { return callee()+1; }
gcc and clang generate (https://gcc.godbolt.org/z/R6ZKZA):
clang:
caller: # @caller
push rax
call callee
inc eax
pop rcx
ret
gcc:
caller: # @caller
push rax
call callee
inc eax
pop rcx
ret
Why are the push/pop instructions around the call needed?