Skip to content

Coroutine transformation does not handle symetric transfer #739

@ARG-Helper

Description

@ARG-Helper

https://compiler-explorer.com/z/TPjEdMWxn transforms into https://compiler-explorer.com/z/o11zKTWKj

the first produces the output:

foo start
bar start

the second produces the output:

foo start
if(__f->__suspend_39_14.await_suspend(std::coroutine_handle<Task::promise_type>::from_address(static_cast<void *>(__f)).operator std::coroutine_handle<void>()).address()) {
        return;
      } 

should be

return __f->__suspend_39_14.await_suspend(std::coroutine_handle<Task::promise_type>::from_address(static_cast<void *>(__f)).operator std::coroutine_handle<void>()).resume();//should preform tail-call-optimisation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions