<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/59315>59315</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[PowerPC] fatal error: error in backend: failed to perform tail call elimination on a call site marked musttail
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
pkubaj
</td>
</tr>
</table>
<pre>
FreeBSD 13.1-RELEASE
powerpc (only 32-bit)
LLVM 16.0 snapshot from llvm-devel port (version 16.0.d20221107)
```
namespace std {
inline namespace {
template < class a > a *addressof(a &);
template < class b > b c(b d, int) {
b e(d);
return e;
}
} // namespace
namespace experimental {
inline namespace ah {
template < typename... > struct coroutine_traits;
template < typename = void > class coroutine_handle;
template <> class coroutine_handle<> {
public:
void *address() { return f; }
static coroutine_handle from_address(void *);
void *f;
};
template < typename g > class coroutine_handle : public coroutine_handle<> {
public:
static coroutine_handle h(g &i) {
coroutine_handle j;
j.f = __builtin_coro_promise(addressof(i), alignof(g), true);
return j;
}
};
struct k {
bool await_ready() noexcept { return false; }
void await_suspend(coroutine_handle<>) noexcept;
void await_resume() noexcept;
};
} // ah
} // experimental
} // std
namespace aa::ab {
template < class promise_type >
using coroutine_handle = std::experimental::coroutine_handle< promise_type >;
using std::experimental::k;
} // ab
namespace aa {
template < class > class l;
}
namespace std {
namespace {
template < class m > class n {
public:
n(m);
};
} // namespace
} // std
namespace aa::ab {
template < class ac > class o {
public:
l< ac > get_return_object() {
auto p = coroutine_handle< o >::h(*this);
return p;
}
k initial_suspend();
k final_suspend() noexcept;
};
struct q {
template < class r > void return_value(r);
};
template < class ac > struct s : o< ac >, q {};
} // ab
namespace std::experimental {
template < class ac, class... ad >
struct coroutine_traits< aa::l< ac >, ad... > {
using promise_type = aa::ab::s< ac >;
};
} // experimental
namespace aa {
template < class ac > class v {
ab::coroutine_handle< ab::o< ac > > t;
public:
v(ab::coroutine_handle< ab::o< ac > > ai) : t(ai) {}
bool await_ready() { return 0; }
ab::coroutine_handle< void > await_suspend(ab::coroutine_handle< void >) {
return t;
}
void await_resume() {}
};
template < class > class l {
ab::coroutine_handle< ab::o< bool > > t;
public:
l(ab::coroutine_handle< ab::o< bool > > ai) : t(ai) {}
~l() {}
auto operator co_await() { return v{std::c(t, {})}; }
};
class w {
friend class x;
int y;
bool z;
l< bool > u();
};
class x {
w *ae;
l< bool > u();
};
} // aa
using aa::w;
using aa::x;
aa::l< bool > w::u() {
auto af = false;
std::n ag(y);
if (z)
co_return af;
}
aa::l< bool > x::u() { co_await ae->u(); }
```
Build with:
```/usr/local/llvm-devel/bin/clang-16 -cc1 -triple powerpc-portbld-freebsd13.1 -emit-obj -O1 -std=c++20 async_lock-f23be9.cpp```
Builds fine with `-O0` and `-O3`, fails with `-O1` and `-O2`.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysWE-P4y4S_TTkUnJk4-n8OeSQdDqnWc1oR9prhG2c0MHgBZzunsN-9hX4H46ddM_oJ824EwxF1av3qiBEa3YSlG7Q0w497WekMmepNuWlSsjrLJHZx-agKN392kMUz6Pg3y_fX7a_XlC4R-G2lG9UlSkgvJKCf0CMg4QZhNf16-_f__MviBbzELQgpT5LA7mSBXB-LYKMXimHUipjl1-p0kwKN3ue4RDjKAqXnaXBcxE2_9xXQQqqS5JS0CYDtNzVw0xwJij0b7s3hhYlJ4YCip8h5URrIIDiF_vEW5Jlimotc4RXdmBhfYjvL03c0gRShFcJZAg_AxMWgn5DgAQowqvMNwWgqKmUANoNoeW--wAIHxA-9P7fBkvfS6pYQYUh_EHU5HwncPNRUjttPp-7CLRRVWoglUpWhgl6NIowo6dDbxcDivdwlSxzJmpAegtnIjJOJy08mu5edk6XVcJZiuIm-c1uXZ4QXjVYt3jmKN5BByWANsSwdLSPY-Kxt9LaHeaoHc0HSXqMyekBGIDiLdQh_XHkdyM5I7w6WaqyG9rBeO6rFxzA6zx3K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