From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C62B9386197D; Fri, 18 Jun 2021 10:46:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C62B9386197D From: "iains 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: Fri, 18 Jun 2021 10:46:37 +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: diagnostic, lto X-Bugzilla-Severity: normal X-Bugzilla-Who: iains at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jun 2021 10:46:37 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101118 --- Comment #2 from Iain Sandoe --- hmm.=20 __D.9984.3.4 means that this is a frame variable that is a 'promoted' tempo= rary (promoted because its lifetime had to be extended across a suspend point by copying it into the frame). So, I am supposing that this issue is because such a temporary would almost certainly not have the same DECL_UID (from which the __D.xxxx is created) in different TUs. Which seems to imply that we need to find a way to disambiguate the frame variable names for LTO. This is, I would expect, another case of something with local visibility becoming globally visible for LTO (but that's supposition, not analysed). the coros testsuite runs torture tests thus: .... PASS: g++.dg/coroutines/torture/alloc-00-gro-on-alloc-fail.C -O2 -flto -flto-partition=3Dnone (test for excess errors) PASS: g++.dg/coroutines/torture/alloc-00-gro-on-alloc-fail.C -O2 -flto -flto-partition=3Dnone execution test PASS: g++.dg/coroutines/torture/alloc-00-gro-on-alloc-fail.C -O2 -flto (= test for excess errors) PASS: g++.dg/coroutines/torture/alloc-00-gro-on-alloc-fail.C -O2 -flto=20 execution test so there is some coverage of LTO - but not multiple TUs :(.=