From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2D7E13AAA0DB; Fri, 18 Jun 2021 15:39:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2D7E13AAA0DB 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 15:39:44 +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 15:39:45 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101118 --- Comment #4 from Iain Sandoe --- (In reply to Nils Gladitz from comment #3) > Thanks for looking into this! just speculation so far ... > Any idea what the potential implications are? Not yet. > I assume I can't just ignore the warning as this will likely break code? My expectations at present is that the front end actions on a coroutine are expected to produce functions and a frame type that are TU-local. At this point, it's not clear whether it is ever valid to merge these using= LTO (and I don't think that was specifically addressed in any of my discussions= in WG21 or with implementers on other compilers). > When I turn off LTO the diagnostic will go away but the ODR violations are > still there; could they still break something? I *think* the "ODR violation" is to do with not giving the frame types uniq= ue names per TU so that there is a [probably invalid] attempt to merge them. .. but, as noted above, I guess we should consider carefully if the frames = can ever be considered mergeable (which would imply that the actor and destroyer functions were also). If they are _never_ validly mergeable, then the ODR violation is not "real"= but the consequence of a naming scheme that is not good enough. As per my expectations when implementing that is the case (i.e. it should be OK).=