Open
Description
Bugzilla Link | 50372 |
Version | trunk |
OS | All |
Reporter | LLVM Bugzilla Contributor |
CC | @zygoloid |
Extended Description
I am not sure if it is OK to mark this with a bug. It is like a feature more to me. I mark this with bugzilla since I found this: #44911 , which tells an optimization instead of a bug.
The motivation example comes from: https://godbolt.org/z/c4zx9fE88.
The key codes is:
cppcoro::task<int> simple() noexcept {
// 552 byte coroutine frame
char dummy[500];
for (int i = 0;i < 500; i++)
dummy[i] = rand()%8;
consume(dummy[rand()%500]);
co_await std::experimental::suspend_always{};
co_return 10;
}
Here we can find that the dummy
isn't used across suspend point. So the dummy could show as a stack variable. If compilers could optimize this, we could get a smaller coroutine frame.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
In Progress