From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 343943858434; Sat, 1 Apr 2023 05:28:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 343943858434 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680326894; bh=WzYdQ71mx7PMZ+yQC0ElrVxFdXP6t5IKdQYz33N8738=; h=From:To:Subject:Date:In-Reply-To:References:From; b=L+rX+nuotzDgItwSALblcXNCsTe+6Te3wocy6bNs05TvOZLpOe5tP+c18OpXydge/ UTgVYi70nxhjEWfMM0m1iUD2J6epDtgkS1uysGlUTMPdQIbk9cUgZFqXfTIv6X/nb6 lzKpSgsvhJc8HAGw2eJPkF+E3JQ/kcdRoxd/NFOY= 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: Sat, 01 Apr 2023 05:28:12 +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 #17 from CVS Commits --- The master branch has been updated by Iain D Sandoe : https://gcc.gnu.org/g:fc4cde2e6aa4d6ebdf7f70b7b4359fb59a1915ae commit r13-6964-gfc4cde2e6aa4d6ebdf7f70b7b4359fb59a1915ae 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.=