From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 29CD6388700F; Sat, 6 Jun 2020 16:51:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 29CD6388700F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1591462271; bh=qtt8ncYWIKQKQk78cceSwJ5lYFd6XjUgT3IJuKT1uNU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=q5M30BDcm4TNRdrOgeWF7J+DNxD2zEQ0meUGGIJ56hjiGPdZwDxX18/EE1bfFDmaG XUwbu3uOosjb9VF2uJsERMQqf6iqLjZ+DMrlSO3gH0WgpJSy4vw/qRhBP4WeXFESuy fOQXDKNprSIRY/y9pdiPBYJOopA+s4TCBvDp0mF8= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/94829] ICE in poplevel, at cp/decl.c:585 since r10-6063-g49789fd08378e3ff Date: Sat, 06 Jun 2020 16:51:11 +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: 10.0 X-Bugzilla-Keywords: error-recovery, ice-on-invalid-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: 10.2 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: Sat, 06 Jun 2020 16:51:11 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94829 --- Comment #5 from CVS Commits --- The releases/gcc-10 branch has been updated by Iain D Sandoe : https://gcc.gnu.org/g:03da87235697eab344cde609d81d3f405f450c42 commit r10-8259-g03da87235697eab344cde609d81d3f405f450c42 Author: Iain Sandoe Date: Sat Jun 6 09:48:31 2020 +0100 coroutines: Improve error recovery [PR94817, PR94829, PR95087]. When we have completely missing key information (e.g. the coroutine_traits) or a partially transformed function body, we need to try and balance returning useful information about failures with the possibility that some part of the diagnostics machinery or following code will not be able to handle the state. The PRs (and revised testcase) point to cases where that processing has failed. This revises the process to avoid special handling for the ramp, and falls back on the same code used for regular function fails. There are test-cases (in addition to the ones for the PRs) that now cover all early exit points [where the transforms are considered to have failed in a manner that does not allow compilation to continue]. Diagnosing bad uses of 'return' in coroutines is somewhat tricky, since the user can use the keyword before we know that the function is a coroutine (where such returns are not permitted). At present, we are just doing a check for any use of 'return' and erroring on that. However, we can't then pass the function body on, since it will contain unlowered coroutine trees. This avoids the issue by dropping the entire function body under that circumstance. Backport c7100843831147a034fe37d231c54ac53ceace45 and a1bb808504643e6c3c0df0fdd68a941ed2a64c7f0 gcc/cp/ChangeLog: PR c++/94817 PR c++/94829 PR c++/95087 * coroutines.cc (morph_fn_to_coro): Set unformed outline functions to error_mark_node. For early error returns suppress warnings about missing ramp return values. Fix reinstatement of the function body on pre-existing initial error. If we see an early fatal error, drop the erroneous function body. * decl.c (finish_function): Use the normal error path for fails in the ramp function, do not try to compile the helpers if the transform fails. gcc/testsuite/ChangeLog: PR c++/94817 PR c++/94829 PR c++/95087 * g++.dg/coroutines/coro-missing-final-suspend.C: New test. * g++.dg/coroutines/coro-missing-initial-suspend.C: New test. * g++.dg/coroutines/coro-missing-promise-yield.C: Check for continuation of compilation. * g++.dg/coroutines/coro-missing-promise.C: Likewise. * g++.dg/coroutines/coro-missing-ret-value.C: Likewise * g++.dg/coroutines/coro-missing-ret-void.C: Likewise * g++.dg/coroutines/coro-missing-ueh-3.C: Likewise * g++.dg/coroutines/pr94817.C: New test. * g++.dg/coroutines/pr94829.C: New test. * g++.dg/coroutines/co-return-syntax-08-bad-return.C: Adjust the testcase to do the compile (rather than an -fsyntax-only parse). * g++.dg/coroutines/coro1-ret-int-yield-int.h (MISSING_INITIAL_SUSPEND, MISSING_FINAL_SUSPEND): New.=