From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 438263857807; Sun, 3 Oct 2021 19:22:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 438263857807 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/102454] coroutines: ICE in gimplify_var_or_parm_decl, at gimplify.c:2958 Date: Sun, 03 Oct 2021 19:22:54 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: iains at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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: Sun, 03 Oct 2021 19:22:54 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102454 --- Comment #5 from CVS Commits --- The releases/gcc-11 branch has been updated by Iain D Sandoe : https://gcc.gnu.org/g:a1ef1020c424d8f3ca1486ce12408819f4746fd6 commit r11-9063-ga1ef1020c424d8f3ca1486ce12408819f4746fd6 Author: Iain Sandoe Date: Mon Sep 27 20:21:40 2021 +0100 coroutines: Only set parm copy guard vars if we have exceptions [PR 102454]. For coroutines, we make copies of the original function arguments into the coroutine frame. Normally, these are destroyed on the proper exit from the coroutine when the frame is destroyed. However, if an exception is thrown before the first suspend point is reached, the cleanup has to happen in the ramp function. These cleanups are guarded such that they are only applied to any param copies actually made. The ICE is caused by an attempt to set the guard variable when there are no exceptions enabled (the guard var is not created in this case). Fixed by checking for flag_exceptions in this case too. While touching this code paths, also clean up the synthetic names used when a function parm is unnamed. Signed-off-by: Iain Sandoe PR c++/102454 gcc/cp/ChangeLog: * coroutines.cc (analyze_fn_parms): Clean up synthetic names for unnamed function params. (morph_fn_to_coro): Do not try to set a guard variable for param DTORs in the ramp, unless we have exceptions active. gcc/testsuite/ChangeLog: * g++.dg/coroutines/pr102454.C: New test. (cherry picked from commit fae627162d5f8cfb273b10349883eeb74baaa43f)=