From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F404D3858CDB; Fri, 3 Mar 2023 16:33:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F404D3858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677861186; bh=64Bh6hMbgW9DHBFG2lt1vHarobv8p2C+1qpzrJrQckI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QO814M8l+QcKJrupIXcd7KohYMxVuBtAUsQkMyJ+6xGUyeK+BJAky5qEFd6+qEYnH 0x6bVClfygYTedX4JDb3MuKiXH7HLU9SQrVqluXXCrZ95ANsMNb0hUfITc8CO16+Fs 0E7sX8hlNFd0TNxGxirLgb7kPx9VF/Wdi8XhA5dg= 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, 03 Mar 2023 16:33:05 +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: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101118 --- Comment #7 from Iain Sandoe --- (In reply to Jan Hubicka from comment #6) from me there has been no progress on anything co-routines related, for a w= hile - I of not have any resources to work on it. > I am not really expert on coroutines. But this seems to be a type (not a > declaration we globalize during LTO) generated internally by the front-en= d.=20 > The name __D.9984.3.4 looks like it has a global counter in it. > ODR types are supposed to be literaly the same across units. >=20 > One way to silence this would be to not make these types ODR types since > they are not the usual C++ types anyway. > I wonder if this is a part of the cross-unit API that is supposed to be > same? I.e. is the coroutine in one compilation unit visible from the othe= r? >=20 > If so, perhaps the only problem is hte global counter 9984 and if the cou= nts > were generated internally for each such type, the ODR handling wlll be ha= ppy. the synthesised functions (actor, destroy) are intended to be TU-local. the ramp function is what remains of the user's original function after the coroutine body is outlined - so that has the original signature of the user= 's function. We do use counters to generate local symbol names for frame-promoted temporaries, so I suppose that there is a possibility that the name(s) that= are intended to be TU-local become visible across TUs in LTO; but those should = be the names of coroutine frame entries (i.e. fields in a structure, not themselves global symbols).=