From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C661C3857025; Tue, 16 May 2023 19:07:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C661C3857025 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684264026; bh=MykuNMD09NL/L10ZfyyjYye9BUlGn6vQ3+HvRKT6xIo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=xi1MQKD+w108QVzrPIv5Ex6VyQyA78ueINesZ56bsLHTkGQHLcMF5oLZWfV2j422i 3q0H/c8lRAt2H47QdIJ0MRCvbOdjMjbXsY1qlA4wTU5uHmEmPpy+TLNmfv/fOQaqSo NZDVx30QZsRQSGj5al85TzAyVI26hx4Q+ePpsLMc= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/101118] coroutines: unexpected ODR warning for coroutine frame type in LTO builds Date: Tue, 16 May 2023 19:07:06 +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.1.0 X-Bugzilla-Keywords: C++-coroutines, diagnostic, lto 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: 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=3D101118 --- Comment #19 from CVS Commits --- The releases/gcc-11 branch has been updated by Iain D Sandoe : https://gcc.gnu.org/g:72f004746d87f01e5e3872af3214e3fa1b48dfa8 commit r11-10788-g72f004746d87f01e5e3872af3214e3fa1b48dfa8 Author: Iain Sandoe Date: Thu Mar 30 13:14:23 2023 +0530 c++,coroutines: Stabilize names of promoted slot vars [PR101118]. When we need to 'promote' a value (i.e. store it in the coroutine frame= ) it is given a frame entry name. This was based on the DECL_UID for slot v= ars. However, when LTO is used, the names from multiple TUs become visible at the same time, and the DECL_UIDs usually differ between units. This leads = to a "ODR mismatch" warning for the frame type. The fix here is to use the current promoted temporaries count to produce the name, this is stable between TUs and computed per coroutine. Signed-off-by: Iain Sandoe PR c++/101118 gcc/cp/ChangeLog: * coroutines.cc (flatten_await_stmt): Use the current count of promoted temporaries to build a unique name for the frame entri= es. (cherry picked from commit fc4cde2e6aa4d6ebdf7f70b7b4359fb59a1915ae)=