From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CE7A3385DC03; Thu, 9 Apr 2020 20:40:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CE7A3385DC03 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1586464846; bh=1orPKHjRkObza/NczyfEa4oDnUk+SakpsR0WbjkJkkg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=yurZ0QeKQDPzuilYnkRkFQnfg/vo6Z9ul0XZT6+0mHhoN/1pBii1pbusuL2OgrqSU W/ErjHlBlfZAM+YCwn9Xh3mYSs6bVKSScPnrqALmqg3KecpNb6BfYzdmP3eOC+36AS myPsO6Rb6RCxWHBHs9sBsdMXN9aSKP/pm5Oz1YG0= From: "iains at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/94359] new test case g++.dg/coroutines/torture/symmetric-transfer-00-basic.C fails Date: Thu, 09 Apr 2020 20:40:46 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: iains at gcc dot gnu.org X-Bugzilla-Status: NEW 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: attachments.created 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: Thu, 09 Apr 2020 20:40:46 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94359 --- Comment #11 from Iain Sandoe --- Created attachment 48251 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D48251&action=3Dedit Patch for testing coroutines: Fix compile error with symmetric transfers [PR94359] For symmetric transfers to work with C++20 coroutines, it is currently necessary to tail call the callee coroutine from resume method of the caller coroutine. The current codegen marks these resume calls as "MUST_TAIL_CALL" to indicate that the tail call is required for correctness, in the general case. Unfortunately, several targets have ABI constraints that prevent an indirect tail-call, which results in the PRs compile error. The change here tests the target sibcall hook for the resume expression and only marks it as requiring a tail call if that's supported. This doesn't fix the underlying problem; that really a solution is needed to allow the tail-calls (or equivalent) to take place - but that will be deferred until next stage 1. The test case is 'xfail-run-if'd for the targets mentioned in this PR since we still want to test that the compile proceeds without error. At compile-time we can't tell if missing the tail-call will cause a specific code to fail, so that most likely a warning for this case would produce a lot of false positives. gcc/cp/ChangeLog: 2020-04-09 Iain Sandoe PR c++/94359 * coroutines.cc (build_actor_fn): Check that the target can support the resume tail-call before mandating it. gcc/testsuite/ChangeLog: 2020-04-09 Iain Sandoe PR c++/94359 * g++.dg/coroutines/torture/symmetric-transfer-00-basic.C: Expect a run fail for targets without indirect tail-calls.=