https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118430
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Must have decided that val escapes and can be referenced by the call
tail_call2.
I am not 100% sure if this is valid or not.
Rewriting the code like:
int tail_call1(int opcode) {
{
int val;
printf("%d\n", opcode);
non_tail_call(&val); // Trigger the bug by passing in a local.
}
[[gnu::musttail]]
return tail_call2(opcode);
}
Will cause the val not be escaping for tail_call2 as it goes out of scope
before the call to tail_call2.