From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp001-out.apm-internet.net (smtp001-out.apm-internet.net [85.119.248.222]) by sourceware.org (Postfix) with ESMTPS id 726B63856DC3 for ; Wed, 12 Oct 2022 06:34:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 726B63856DC3 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 44958 invoked from network); 12 Oct 2022 06:34:46 -0000 X-APM-Out-ID: 16655564864495 X-APM-Authkey: 257869/1(257869/1) 2 Received: from unknown (HELO ?192.168.1.95?) (81.138.1.83) by smtp001.apm-internet.net with SMTP; 12 Oct 2022 06:34:46 -0000 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Subject: Re: [PATCH] coroutines: Use cp_build_init_expr consistently. From: Iain Sandoe In-Reply-To: Date: Wed, 12 Oct 2022 07:34:45 +0100 Cc: GCC Patches Content-Transfer-Encoding: quoted-printable Message-Id: References: <20221011215831.67154-1-iain@sandoe.co.uk> <44bcfe36-d570-c8d4-7980-4e8b2a2aac60@redhat.com> <9403FB3B-D300-4F62-B5D8-8BA83BB66F42@sandoe.co.uk> 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 12 Oct 2022, at 00:19, Jason Merrill wrote: >=20 > On 10/11/22 18:17, Iain Sandoe wrote: >> Hi Jason >>> On 11 Oct 2022, at 23:06, Jason Merrill wrote: >>>=20 >>> On 10/11/22 17:58, Iain Sandoe wrote: >>>> Now we have the TARGET_EXPR_ELIDING_P flag, it is important to = ensure it >>>> is set properly on target exprs. The code here has a mixture of = APIs used >>>> to build inits. This patch changes that to use = cp_build_init_expr() where >>>> possible, since that handles setting the flag. >>>=20 >>> Hmm, I wouldn't expect this to be necessary, since = cp_build_modify_expr calls cp_build_init_expr for INIT_EXPR. You are, of course, right.. >>> Perhaps the similarity of the function names is a trap... >> not sure exactly what trap you mean. >=20 > The names are close, but cp_build_modify_expr is a lot more = complicated; it handles conversions and overloaded operators. This is one of the tricky parts about synthesizing AST from scratch - = knowing which API is the =E2=80=9Cright one=E2=80=9D to use in each case = - e.g. here: cp_build_modify_expr or cp_build_init_expr or even build2 = (INIT_EXPR.. So, it seems that where there could be a mismatch to be diagnosed, I = should use cp_build_modify_expr, but maybe in some of the cases where = there is no checking needed (e.g. set a guard var to true) it would be = appropriate to use one of the simpler forms. >> It seems that on my local set of additional tests (for some of the = open prs) there are some >> progressions from this change, That=E2=80=99s a spurious observation, because cp_build_init_expr does = not do the diagnostics. patch withdrawn. thanks for the explanations, Iain