Open
Description
struct Slice {
const char* data;
unsigned long size;
~Slice();
};
Slice get_s_impl();
Slice get_s() { return get_s_impl(); }
clang produces:
get_s():
push rbx
mov rbx, rdi
call get_s_impl()
mov rax, rbx
pop rbx
ret
icc recognized tail call and produces:
get_s():
..B1.1: # Preds ..B1.0
jmp get_s_impl() #7.24
g++ also missed such tail call optimization.
If delete ~Slice;
, g++ & clang recognize the tail call, but icc fails.