From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4BABF384F00C; Sun, 4 Dec 2022 14:28:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4BABF384F00C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1670164116; bh=+h0i1zvG/R/TjJVr7xyaHcD5aWEhBcDuSOWcAkrLcOg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ZKwKeA+QjlQdyxUXfqwHdhJ3A/wK9CA2PKDb14l9T/YkpMYzbwSD7ThSR0NOjQBlI fOEGaQbztaBib/2uBjzdzLv5Abv5nvbx9px6e98qMKBLm3xCv2Myjz0Qo4Bq++acDd Qrrb/aoVJHyZUFxlbjPYKpubKYnwwaB1uvitGZiU= From: "avi at scylladb dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/105373] miscompile involving lambda coroutines and an object bitwise copied instead of via the copy constructor Date: Sun, 04 Dec 2022 14:28:34 +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: 11.3.1 X-Bugzilla-Keywords: C++-coroutines, c++-lambda, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: avi at scylladb dot com 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: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105373 --- Comment #17 from Avi Kivity --- This was apparently fixed by 58a7b1e354530d8dfe7d8fb859c8b8b5a9140f1f. At least, I no longer observe copying of __old4 in gimple. Instead, I see addresses taken, and if I squint I can see that object properly destroyed l= ater on. I can't test on my full-scale program due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98056. I note that one of the duplicates is titled "When constructing object, call= ing function and performing co_await in same statement, temporary is erroneously moved trivially", which is exactly what this PR is about, so it can be safe= ly marked as a duplicate as well. Please consider backporting https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D= 99576, this is a subtle code generation bug.=