From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A2E79385737E; Wed, 20 Jul 2022 07:23:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A2E79385737E From: "amonakov at gcc dot gnu.org" 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: Wed, 20 Jul 2022 07:23:31 +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: amonakov at gcc dot gnu.org 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: cc 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: Wed, 20 Jul 2022 07:23:31 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D91299 Alexander Monakov changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |amonakov at gcc dot gnu.org --- Comment #9 from Alexander Monakov --- I can reproduce it with gcc-10.2. Why is main 'overwritable', but foo is 'available'? cat /tmp/cchaUSjV.ltrans0.o.079i.inline ;; Function main (main, funcdef_no=3D0, decl_uid=3D4385, cgraph_uid=3D1, symbol_order=3D1) (executed once) weakdef.c:5:5: note: Inlining foo/0 to main/1 with frequency 1.00 foo/0 (foo) @0x7f51a512d168 Type: function definition analyzed Visibility: preempted_reg external public weak References: Referring: Function foo/0 is inline copy in main/1 Availability: available Unit id: 2 Function flags: count:1073741824 (estimated locally) body nonfreeing_fn Called by: main/1 (inlined) (1073741824 (estimated locally),1.00 per call) Calls: main/1 (main) @0x7f51a512d000 Type: function definition analyzed Visibility: externally_visible prevailing_def public References: Referring: Availability: overwritable Unit id: 2 Function flags: count:1073741824 (estimated locally) body only_called_at_startup nonfreeing_fn executed_once Called by: Calls: foo/0 (inlined) (1073741824 (estimated locally),1.00 per call)=