From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 61C6C3851C07; Mon, 22 Jun 2020 18:51:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 61C6C3851C07 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1592851917; bh=3bBArzhujTOXW4TK32HZkCEqxBbgsPlTuirlsRB7je8=; h=From:To:Subject:Date:From; b=qBG31YDzdR/uqwYblUKerBm5fEfTxt7v6Fzcg/gKMkIahyezNl3gtjKU49FNXAWnL CZZ6HuKWjcIJ4V2Ec+ZA/cJTyrBl7SqcOZ5ERfFWhU8loIJCoonXIG4b2T9tM3ZjJs lHUsdXS5R1yxom6kaQ+gHfK1YcdxlcJZlWw1USyM= From: "victor.burckel at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/95822] New: [coroutines] compiler internal error with local object with noexcept false destructor Date: Mon, 22 Jun 2020 18:51:57 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 10.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: victor.burckel at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jun 2020 18:51:57 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95822 Bug ID: 95822 Summary: [coroutines] compiler internal error with local object with noexcept false destructor Product: gcc Version: 10.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: victor.burckel at gmail dot com Target Milestone: --- It seems that when a coroutine contains a local object whose destructor is marked as noexcept(false), gcc reaches an unexpected state and aborts. When compiling the following code with gcc10.1.0 (-std=3Dc++20 -fcoroutines= ), I get a compiler internal error:=20 > internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:2830 Making the destructor noexcept fixes the error. I got the error when using boost log within a couroutine. It uses a record_pump whose destructor is not noexcept. I managed to reproduce with godbolt (both gcc10.1 and gcc trunk give me the assertion) https://godbolt.org/z/6JtKsU #include struct task { struct promise_type { auto initial_suspend() noexcept { return std::suspend_always{}; } auto final_suspend() noexcept { return std::suspend_always{}; } void return_void() {} task get_return_object() { return task{}; } void unhandled_exception() noexcept {} }; ~task() noexcept {} bool await_ready() const noexcept { return false; } void await_suspend(std::coroutine_handle<>) noexcept {} void await_resume() noexcept {} }; struct Error { ~Error() noexcept(false) {} }; task g(); task f() { Error error; co_await g(); }=