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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-01-28

--- Comment #13 from Iain Sandoe <iains at gcc dot gnu.org> ---

the design that is agreed (by the coroutine "ABI group", at least) is this:

If the frame requires greater than pointer alignment * 2, we should place the
padding **BEFORE** the (resume*)() and (destroy*)() members - and the frame
pointer will continue to point to the (resume*)() member.  So that, from the
point of view of a continuing caller - there is no difference between such
frames and ones less-aligned.

This requires:
1. keeping some accounting information on the side so that the correct memory
can be freed.

2. having an allocator that honours alignment > 2 * pointer (well. I'd guess
most do that, but we really need the aligned allocator change, however [as
noted in the thread referenced] that change did not make C++20).  We can, of
course, follow clang.

3. ensuring that excess and user alignments are honoured in the placement of
frame entries (I wonder if we actually need to honour anything larger than then
stack would allow).

----

Fro my part, I completely agree that GCC coroutines should support fields will
suitable alignment for larger vector objects.  It's just a question of finding
time to implement the changes, as with all projects ....

The idea is that coroutines form different compilers should be inter-callable
(even though the frame layout might be completely different beyond that
specified for ABI).

Reply via email to