public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "iains at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/104177] coroutine frame is not being allocated with the correct alignment
Date: Fri, 28 Jan 2022 20:49:03 +0000	[thread overview]
Message-ID: <bug-104177-4-3fR49fNrBX@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-104177-4@http.gcc.gnu.org/bugzilla/>

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).

  parent reply	other threads:[~2022-01-28 20:49 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-22  1:59 [Bug c++/104177] New: [diagnostic] basic.align#9 should emit diagnostic for unsupported alignas ldalessandro at gmail dot com
2022-01-22  2:02 ` [Bug c++/104177] " ldalessandro at gmail dot com
2022-01-22  2:04 ` pinskia at gcc dot gnu.org
2022-01-22  2:05 ` pinskia at gcc dot gnu.org
2022-01-22  2:07 ` ldalessandro at gmail dot com
2022-01-22  2:22 ` pinskia at gcc dot gnu.org
2022-01-22  3:48 ` pinskia at gcc dot gnu.org
2022-01-22  3:48 ` pinskia at gcc dot gnu.org
2022-01-22  4:08 ` [Bug c++/104177] coroutine frame is not being allocated with the correct alignment pinskia at gcc dot gnu.org
2022-01-22  4:14 ` pinskia at gcc dot gnu.org
2022-01-22  4:18 ` pinskia at gcc dot gnu.org
2022-01-22  4:19 ` pinskia at gcc dot gnu.org
2022-01-22  4:20 ` pinskia at gcc dot gnu.org
2022-01-28 20:49 ` iains at gcc dot gnu.org [this message]
2022-01-28 21:10 ` ldalessandro at gmail dot com
2023-01-21  6:50 ` davidledger at live dot com.au
2023-01-21  6:51 ` davidledger at live dot com.au
2023-01-23  7:30 ` pinskia at gcc dot gnu.org
2023-01-23  7:33 ` pinskia at gcc dot gnu.org
2023-01-23  7:39 ` pinskia at gcc dot gnu.org
2023-01-23  9:02 ` davidledger at live dot com.au
2023-08-10  7:37 ` pinskia at gcc dot gnu.org
2024-04-30 19:42 ` pinskia at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-104177-4-3fR49fNrBX@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).