From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 83A233858D1E; Wed, 4 May 2022 22:31:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 83A233858D1E From: "pavel.morozkin at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/105488] New: Function definition is not generated OR function is not inlined Date: Wed, 04 May 2022 22:31:41 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 11.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pavel.morozkin at gmail dot com 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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, 04 May 2022 22:31:41 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105488 Bug ID: 105488 Summary: Function definition is not generated OR function is not inlined Product: gcc Version: 11.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: pavel.morozkin at gmail dot com Target Milestone: --- Note: probably this is a duplicate. This code: inline void f(void) { } int main(void) { f(); } leads to this code: .file "t609.c" .text .def __main; .scl 2; .type 32; .endef .globl main .def main; .scl 2; .type 32; .endef .seh_proc main main: pushq %rbp .seh_pushreg %rbp movq %rsp, %rbp .seh_setframe %rbp, 0 subq $32, %rsp .seh_stackalloc 32 .seh_endprologue call __main call f movl $0, %eax addq $32, %rsp popq %rbp ret .seh_endproc .ident "GCC: (GNU) 11.1.0" .def f; .scl 2; .type 32; .endef Here we see that "call f" is present, while "f:" is absent. As a result: $ gcc t609.c ld: /tmp/cc8z1GjU.o:t609.c:(.text+0xe): undefined reference to `f' collect2: error: ld returned 1 exit status I think that: - either function definition is not generated, - either function is not inlined.=