Closed lewissbaker closed 6 years ago
Note that changes in the branch are currently causing test failures under Clang optimised builds.
Seems to be hitting a compiler bug in code-generation of when_all_ready()
body where it elides the allocation of one of the make_when_all_task
coroutines and allocates the coroutine-frame on the stack-frame of when_all_ready()
even though the lifetime of the coroutine extends beyond the when_all_ready()
stack-frame.
Have you filed a compiler but yet?
I have notified Gor via Slack but haven't filed to LLVM bug tracker yet. I was working on trying to reduce the 2000 line test-case to something a bit smaller first...
A workaround for this issue seems to be to declare when_all_ready()
as __attribute__((always_inline))
.
I'll test it more rigorously tonight and commit/merge if it passes all tests.
Ok, so marking when_all_ready
as forced-inline seems to fix the when_all_ready
issue under Clang (See commit 18d2b4d5aa7850a234a6125f6d03e192bc52dd30)
However, now I'm seeing a whole bunch of the shared_task
tests failing under clang optimised.
Needs further investigation...
I think the shared_task
tests may be failing due to this clang bug:
https://bugs.llvm.org/show_bug.cgi?id=35068
I may be able to modify the await_suspend()
method for shared_task_promise::final_suspend()
object slightly to work around the issue. I'll try this out and report back.
Added some work arounds for Clang atomic ref-counting issue but still seeing some tests fail.
Further investigation required.
This branch is now also running into troubles with bad codegen for when_all
under MSVC x64 optimised builds with VS 15.5 preview 3.
I've disabled the broken tests for MSVC for this compiler version for now.
This updates many of the operations to work on arbitrary awaitable types rather than only on
task
andshared_task
.