public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "marxin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/103868] ICE at end of coroutine when using asio
Date: Tue, 04 Jan 2022 08:31:35 +0000	[thread overview]
Message-ID: <bug-103868-4-adv8tBmwvY@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103868-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Created attachment 52116
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52116&action=edit
Partially reduced test-case

The test-case fails with the following on master:

$ ./xgcc -B. /tmp/x.ii -c -std=c++20 -w
during RTL pass: expand
/tmp/x.ii: In function ‘void
malloy::test::client_ws_handler_coro(client_ws_handler_coro<false>(malloy::error_code,
std::shared_ptr<malloy::websocket::connection<true>
>)::_ZN6malloy4test22client_ws_handler_coroILb0EEEN5boost4asio9awaitableIvNS3_15any_io_executorEEENS2_6system10error_codeESt10shared_ptrINS_9websocket10connectionILb1EEEE.Frame*)’:
/tmp/x.ii:1035:70: internal compiler error: in make_decl_rtl, at varasm.c:1446
 1035 |   auto size = co_await conn->read(*buffer, boost::asio::use_awaitable);
      |                                                                      ^
0x8f7d91 make_decl_rtl(tree_node*)
        /home/marxin/Programming/gcc/gcc/varasm.c:1446
0xe7ede7 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /home/marxin/Programming/gcc/gcc/expr.c:10550
0xe87d77 expand_expr
        /home/marxin/Programming/gcc/gcc/expr.h:301
0xe87d77 expand_expr_addr_expr_1
        /home/marxin/Programming/gcc/gcc/expr.c:8427
0xe7e2c4 expand_expr_addr_expr
        /home/marxin/Programming/gcc/gcc/expr.c:8548
0xe7e2c4 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /home/marxin/Programming/gcc/gcc/expr.c:11764
0xe8aa46 store_expr(tree_node*, rtx_def*, int, bool, bool)
        /home/marxin/Programming/gcc/gcc/expr.c:6087
0xe8c25d expand_assignment(tree_node*, tree_node*, bool)
        /home/marxin/Programming/gcc/gcc/expr.c:5819
0xd4b07a expand_gimple_stmt_1
        /home/marxin/Programming/gcc/gcc/cfgexpand.c:3930
0xd4b07a expand_gimple_stmt
        /home/marxin/Programming/gcc/gcc/cfgexpand.c:4028
0xd5155c expand_gimple_basic_block
        /home/marxin/Programming/gcc/gcc/cfgexpand.c:6069
0xd53727 execute
        /home/marxin/Programming/gcc/gcc/cfgexpand.c:6795
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Note it uses coroutines and -fconcepts.

$ (gdb) p debug_tree(decl)
 <var_decl 0x7ffff7434d80 _Coro_promise
    type <record_type 0x7ffff7462bd0 promise_type sizes-gimplified cxx-odr-p
type_5 type_6 QI
        size <integer_cst 0x7ffff75f3048 constant 8>
        unit-size <integer_cst 0x7ffff75f3060 constant 1>
        align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7ffff7462b28
        fields <function_decl 0x7ffff7140000 __dt  type <method_type
0x7ffff713b2a0>
            public abstract external autoinline decl_3 decl_8 QI
/tmp/x.ii:982:7 align:16 warn_if_not_align:0 context <record_type
0x7ffff7462b28 awaitable_frame>
            full-name "constexpr boost::asio::detail::awaitable_frame<void,
boost::asio::any_io_executor>::~awaitable_frame() noexcept (<uninstantiated>)"
            not-really-extern chain <function_decl 0x7ffff7140200 __dt_base >>
context <namespace_decl 0x7ffff7338e40 detail>
        full-name "std::__n4861::coroutine_traits<boost::asio::awaitable<void>,
boost::system::error_code, std::shared_ptr<malloy::websocket::connection<true>
> >::promise_type"
        X() X(constX&) this=(X&) n_parents=1 use_template=1 interface-unknown
        pointer_to_this <pointer_type 0x7ffff7469498> chain <type_decl
0x7ffff7450d10 awaitable_frame>>
    addressable used read QI /tmp/x.ii:1035:70 size <integer_cst 0x7ffff75f3048
8> unit-size <integer_cst 0x7ffff75f3060 1>
    align:8 warn_if_not_align:0>
$1 = void

  parent reply	other threads:[~2022-01-04  8:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-30 14:55 [Bug c++/103868] New: " ashenglandelbro at protonmail dot com
2021-12-30 14:59 ` [Bug c++/103868] " ashenglandelbro at protonmail dot com
2022-01-03  9:43 ` marxin at gcc dot gnu.org
2022-01-04  8:31 ` marxin at gcc dot gnu.org [this message]
2022-01-04  8:32 ` marxin at gcc dot gnu.org
2022-04-18 14:05 ` iains at gcc dot gnu.org
2022-04-28 12:51 ` cvs-commit at gcc dot gnu.org
2022-04-28 12:58 ` iains at gcc dot gnu.org
2023-05-29 10:06 ` jakub 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-103868-4-adv8tBmwvY@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).