https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119483
Bug ID: 119483
Summary: musttail vs noreturn discovery
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Keywords: tail-call
Severity: normal
Priority: P3
Component: ipa
Assignee: unassigned at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target Milestone: ---
Take:
```
[[gnu::noreturn]]
extern void x();
[[gnu::noinline]]
static int f(int)
{
x();
return 0;
}
int g(int);
int h(int t)
{
if (t == 1)
[[clang::musttail]]
return f(1);
[[clang::musttail]]
return g(t);
}
```
This fails with GCC and not clang because GCC discovers that x is noreturn and
then rejects the tail call.
Note this might be or might not be part of PR 119376, I have not checked fully
yet.