From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CCEAD3851C0C; Sat, 6 Jun 2020 14:36:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CCEAD3851C0C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1591454168; bh=2Hl5/xwnDE8/IjqdS1k0QyPbLCodXWYE+MMIyoiwQTk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DWllrDfIV61CxyFQIQKbxj08Zzyck+RDGMzkOMghrEU1uAuRRo0RctUaW4SBhj1OX iFHokqk/OjspLl/PMVKpvvwOkxDb8ytzMn5uiTGDIMMMnalLY3TkjMk1GmDRwEn4vJ UiVrfBo340G6iDquv4J+0aJ0GvwCYsKUrtEIopCk= From: "bugdal at aerifal dot cx" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/95558] Invalid IPA optimizations based on weak definition Date: Sat, 06 Jun 2020 14:36:08 +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: unknown X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: bugdal at aerifal dot cx 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: Sat, 06 Jun 2020 14:36:08 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95558 --- Comment #2 from Rich Felker --- Wow. It's interesting that we've never seen this lead to incorrect codegen before, though. All weak dummies should be affected, but only in some cases does the pure get used to optimize out the external call. This suggests there's a major missed optimization around pure functions too= , in addition to the wrong application of pure (transfering it from the weak definition to the external declaration) that's the bug.=