From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 730D83858006; Mon, 17 Jan 2022 17:32:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 730D83858006 From: "hubicka at kam dot mff.cuni.cz" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/95558] [9/10/11/12 Regression] Invalid IPA optimizations based on weak definition Date: Mon, 17 Jan 2022 17:32:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 10.1.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka at kam dot mff.cuni.cz 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: 9.5 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: Mon, 17 Jan 2022 17:32:10 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95558 --- Comment #8 from hubicka at kam dot mff.cuni.cz --- > > Do weak aliases fall under some implicit ODR here? >=20 > The whole definition of "weak" is that it entitles you to make a definiti= on > that will be exempt from ODR, where a non-weak definition, if any, replac= es it. I fixed recently bug in pure-const discovery which made us to add attributes to weaks while it should not, so perhaps this bug is gone. For non-inline functions we should handle those as interposable. Concerning warning, I we make difference between may and must warnings. I think this is still useful do be diagnosed for user to consider (perhaps there is a reason why all overwritters has to be weak), so I think we should porduce may form of warning. I will take a look.=