From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3CE04385841A; Thu, 25 Aug 2022 13:01:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3CE04385841A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661432501; bh=zSUPhj2pdnD1JWvay/mgXN9YCRT4ZlyUOIOjA1fc/X4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=hwDm0vQSLNULJ7Wjt7M3rPiZL9nFEIu8WtVdh7UbVN9ubdUi1vbdYHeNdio8XTfmg /VOhIqga8DHtXnHA8lPLsb4LFt95uwQ3FzYSZMQjkhw69YnhpcLwbMEvv1xS6ijuAb 9XedkslwruhF2RRbV9ed74e88qN7eIcXHsK6eNVo= From: "sen2403 at hotmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/91299] LTO inlines a weak definition in presence of a non-weak definition from an ELF file Date: Thu, 25 Aug 2022 13:01:40 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Version: 8.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sen2403 at hotmail dot com X-Bugzilla-Status: WAITING 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=3D91299 --- Comment #12 from Eason Lai --- Hope this information could help. I added "-fopt-info-inline-optimized-missed=3Dinline.txt" in the CFLAGS to = see what happens between -Os and -O1. Here is the output when using "-O1": missed: not inlinable: main/5 -> get_t/4, function not inline candidate Here is the output when using "-Os": main.c:13:9: missed: not inlinable: main/5 -> get_t/4, function body can = be overwritten at link time optimized: Inlined get_t/4 into main/5 which now has time 3.000000 and siz= e 4, net change of +0. It happens in ipa-inline.c::inline_small_functions when using "-O2" or abov= e.=