https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117364

Iain Sandoe <iains at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-10-30

--- Comment #1 from Iain Sandoe <iains at gcc dot gnu.org> ---
the code that the coroutines implementation generates is like this:


  <retval> = Promise::get_return_object (_2);
  Coro (_Coro_frameptr);
  return <retval>;

This is because the return entity must be fully constructed before the
coroutine is started (Coro (_Coro_frameptr);) - and the later has potentially
indirect access to that entity.

We have to construct the entity in the return slot to avoid a copy (which would
break C++17 copy elision rules)

This does not seem morally different from NVRO.

At present, I do not have a handle on where the actual issue is - since
Rainer's and Eric's reports are from completely different phases in the
lowering.

Reply via email to