From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp002.apm-internet.net (smtp002.apm-internet.net [85.119.248.221]) by sourceware.org (Postfix) with ESMTPS id D45583858C62 for ; Thu, 6 Oct 2022 22:47:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D45583858C62 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sandoe.co.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=sandoe.co.uk Received: (qmail 81453 invoked from network); 6 Oct 2022 22:47:27 -0000 X-APM-Out-ID: 16650964478144 X-APM-Authkey: 257869/1(257869/1) 4 Received: from unknown (HELO ?192.168.1.95?) (81.138.1.83) by smtp002.apm-internet.net with SMTP; 6 Oct 2022 22:47:27 -0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Subject: Re: [PATCH RFC] c++: fix broken conversion in coroutines From: Iain Sandoe In-Reply-To: <44f278ec-e4c2-91db-aae1-6e5b4809a652@redhat.com> Date: Thu, 6 Oct 2022 23:47:26 +0100 Cc: GCC Patches Content-Transfer-Encoding: quoted-printable Message-Id: <3B7C7594-02B1-49B5-9BF6-21AE24101CE0@sandoe.co.uk> References: <20220930220623.2161990-1-jason@redhat.com> <219253A3-8202-4286-9621-982BC5CD24DF@sandoe.co.uk> <44f278ec-e4c2-91db-aae1-6e5b4809a652@redhat.com> To: Jason Merrill X-Mailer: Apple Mail (2.3608.120.23.2.7) X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,KAM_COUK,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > On 6 Oct 2022, at 22:44, Jason Merrill wrote: >=20 > On 10/3/22 23:53, Jason Merrill wrote: >> On 9/30/22 18:50, Iain Sandoe wrote: >>> Hi Jason, >>>=20 >>>> On 30 Sep 2022, at 23:06, Jason Merrill wrote: >>>>=20 >>>> You can't use CONVERT_EXPR to convert between two class types, and = it was >>>> breaking copy elision. >>>>=20 >>>> Unfortunately, this patch breaks symmetric-transfer-00-basic.C, = where >>>> susp_type is Loopy::handle_type. How is this supposed to = work? >>>=20 >>> We are trying to save a type-erased handle (which the symmetric = transfer makes >>> and indirect call through, nothing else). >> The problem is you're treating one class directly as another class = here, without the indirection involved in usual type-erasure idioms. >> It does seem that the gimplifier handles this fine, but it doesn't = correspond to anything in the language and much of the front end assumes = that CONVERT_EXPR is only used for scalars. VIEW_CONVERT_EXPR would = better express that we're not doing anything to the value, just cheating = the type system. That's still dodgy from a language perspective, but = probably safe enough in this case. >=20 > So I'm applying = this:<0001-c-fix-broken-conversion-in-coroutines.patch> thanks, I have not had any cycles to look at this. however, when I next do - was planning on looking at the: cont =3D handle.from_address(await_suspend().address()) approach, since both .address() and .from_address() are constexpr, = cp_fold_function should turn that into essentially a NOP. Iain