From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5259F386F442; Sat, 6 Jun 2020 08:01:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5259F386F442 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1591430517; bh=LjJ2jDPrnmUV9yT1UFipoB2gmjP2mleyvoCP+v9Vroc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=JNfOkIQW06ta0Sj4zf63z+vMi4ZcYZXNRkrVpMPtDP4w3ULeuiHxnB5VvkTZ6D9it GTkHUd3tl6R4+DQLx0oOkaO4A4ye1ApiKDzJGNRzED6WEsaqbk1eEOBN3p7cpsMHJR FIBfJhiaTTGNCOXf/xWErQ8tagBl9hhnHD2jokOY= From: "amonakov at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/95558] Invalid IPA optimizations based on weak definition Date: Sat, 06 Jun 2020 08:01:57 +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: amonakov 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: cc component keywords 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 08:01:57 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95558 Alexander Monakov changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |amonakov at gcc dot gnu.or= g, | |marxin at gcc dot gnu.org Component|middle-end |ipa Keywords| |wrong-code --- Comment #1 from Alexander Monakov --- All functions are incorrectly discovered to be pure, and then the loop that only makes calls to non-weak pure functions is eliminated. Minimal testcase for the root issue, wrong warning with -O2 -Wsuggest-attribute=3Dpure: static void dummy(){} void weak() __attribute__((weak,alias("dummy"))); int foo() { weak(); return 0; }=