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++/101118] coroutines: unexpected ODR warning for coroutine frame type in LTO builds
Date: Fri, 03 Mar 2023 20:59:41 +0000	[thread overview]
Message-ID: <bug-101118-4-yMG1PwKFIU@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-101118-4@http.gcc.gnu.org/bugzilla/>

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2023-03-03

--- Comment #12 from Iain Sandoe <iains at gcc dot gnu.org> ---
Actually, comment #3 has it mostly :

here is the frame layout from the test case:

FRAME type decl
boost::asio::g<int,
void(|ds|int)>::_ZN5boost4asio1gIiFviEE2abIiEENS0_9awaitableIiiEET_.Frame
   {
     void (*)(|ds|boost::asio::g<int,
void(|ds|int)>::_ZN5boost4asio1gIiFviEE2abIiEENS0_9awaitableIiiEET_.Frame*)_Coro_resume_fn)(|ds|boost::asio::g<int,
void(|ds|int)>::_ZN5boost4asio1gIiFviEE2abIiEENS0_9awaitableIiiEET_.Frame*)
    void (*)(|ds|boost::asio::g<int,
void(|ds|int)>::_ZN5boost4asio1gIiFviEE2abIiEENS0_9awaitableIiiEET_.Frame*)_Coro_destroy_fn)(|ds|boost::asio::g<int,
void(|ds|int)>::_ZN5boost4asio1gIiFviEE2abIiEENS0_9awaitableIiiEET_.Frame*)
    boost::asio::d::promise_type _Coro_promise
     std::__n4861::coroutine_handle<boost::asio::d::z>_Coro_self_handle
     int ai
     short unsigned int _Coro_resume_index
     bool _Coro_frame_needs_free
     bool _Coro_initial_await_resume_called
     std::__n4861::suspend_always Is_1_1
     boost::asio::d::ae::await_transform::y Aw0_2_3
     boost::asio::g<int, void(|ds|int)>::ab::._anon_5 D.10232_2_3 
     boost::asio::d::ae::final_suspend::u Fs_1_4
  }

in the second case, 

     boost::asio::g<int, void(|ds|int)>::ab::._anon_5 D.10233_2_3

This is because I have used the DECL_UID as a convenient way to generate a
unique nane that is also very handy for debugging since it refers back to the
original function.

However, DECL_UIDs are not stable between TUs, obviously, since it depends on
how many there are before the specific case.

So .. for promotion of target expression temporaries to frame vars, one of:
 - a) we need to find a different way to name them
 - b) if it is permissible for an unnamed decl to have a DECL_VALUE_EXPR ()
perhaps the process can be adjusted to avoid naming these cases (although it
does assist in debuggability).

  parent reply	other threads:[~2023-03-03 20:59 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-18  7:43 [Bug c++/101118] New: " nilsgladitz at gmail dot com
2021-06-18 10:26 ` [Bug c++/101118] " rguenth at gcc dot gnu.org
2021-06-18 10:46 ` iains at gcc dot gnu.org
2021-06-18 15:18 ` nilsgladitz at gmail dot com
2021-06-18 15:39 ` iains at gcc dot gnu.org
2023-03-03 16:06 ` john at drouhard dot dev
2023-03-03 16:26 ` hubicka at gcc dot gnu.org
2023-03-03 16:33 ` iains at gcc dot gnu.org
2023-03-03 17:06 ` hubicka at ucw dot cz
2023-03-03 17:10 ` iains at gcc dot gnu.org
2023-03-03 19:21 ` iains at gcc dot gnu.org
2023-03-03 19:29 ` iains at gcc dot gnu.org
2023-03-03 20:59 ` iains at gcc dot gnu.org [this message]
2023-03-07 12:53 ` hubicka at ucw dot cz
2023-03-07 15:04 ` iains at gcc dot gnu.org
2023-03-07 16:18 ` hubicka at ucw dot cz
2023-03-07 16:27 ` iains at gcc dot gnu.org
2023-04-01  5:28 ` cvs-commit at gcc dot gnu.org
2023-04-30  8:27 ` cvs-commit at gcc dot gnu.org
2023-05-16 19:07 ` cvs-commit at gcc dot gnu.org
2023-05-16 19:11 ` iains 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-101118-4-yMG1PwKFIU@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).