https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71761
--- Comment #6 from Konstantin Kharlamov ---
Thanks, okay, so, for the record: comment #3 seems no longer relevant, since
the function `find_tail_calls()`, when analyzing g(), gets executed till its
end. No early returns anywhere. Tested with: GC
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71761
--- Comment #5 from Marc Glisse ---
The case "struct token { int i; };" was fixed in gcc-7.
>= f (); [return slot optimization] [tail call]
That's all you should see at this point, it is later that it gives up.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71761
Konstantin Kharlamov changed:
What|Removed |Added
CC||Hi-Angel at yandex dot ru
--- Com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71761
--- Comment #3 from Marc Glisse ---
For clang, this seems based on size: up to size 16 they get jmp, starting from
17 they get a call.
For gcc, we give up on anything more complicated than a "register":
/* If the LHS of our call is not just a
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71761
--- Comment #2 from Ivan Sorokin ---
I compared this with clang.
1) typedef int token;
Both GCC and clang optimize this to a single jump.
2) struct token {int a};
clang optimizes this into a single jump. GCC generates:
subq$8, %rsp
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71761
Marc Glisse changed:
What|Removed |Added
Keywords||missed-optimization
Status|UNC