[Bug c++/104177] coroutine frame is not being allocated with the correct alignment

davidledger at live dot com.au gcc-bugzilla@gcc.gnu.org
Sat Jan 21 06:50:12 GMT 2023


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

David Ledger <davidledger at live dot com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |davidledger at live dot com.au

--- Comment #15 from David Ledger <davidledger at live dot com.au> ---
This is a complete minimum reproduction, just to aid Iain Sandoe:

```CPP
#include <coroutine>
using namespace std;
#include <cstddef>
static char buffer[4];
template <typename a> struct b {
  struct promise_type {
    void *operator new(size_t) { return &buffer[3]; }
    void get_return_object();
    void unhandled_exception();
    suspend_always initial_suspend();
    suspend_always final_suspend() noexcept;
    suspend_always yield_value(a);
  };
};
b<max_align_t *> c() {
  max_align_t buffer[1];
  for (auto d : buffer)
    co_yield &d;
}
```


More information about the Gcc-bugs mailing list