From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 36B503858D35; Sun, 29 Jan 2023 19:16:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 36B503858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675019801; bh=f2PvApm+WOisz9ssBV58pYEgyIQG1U/eXYp3oU05+Ts=; h=From:To:Subject:Date:From; b=gSRGAhyyeF/ZLKFpqnQSsO6KJBgZjSLdp1qdeTNOq3bH+878u8yT8GZvLyiqnV/kH rTveJpWIA/fVvt/0x6fYJNzbTOSunn3fF5VarHR8QE2/N6Xx3TAThf+xR062c+6NzG EmnWayRw65ctdJt+A59KFg8MSZKgaJNrxfrocHA0= From: "david.bolvansky at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/108593] New: No inlining after function cloning Date: Sun, 29 Jan 2023 19:16: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: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: david.bolvansky 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108593 Bug ID: 108593 Summary: No inlining after function cloning Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: david.bolvansky at gmail dot com Target Milestone: --- int __attribute__ ((noinline)) foo (int arg) { return 2 * arg; } int bar (int arg) { return foo (5); } results in: foo.constprop.0: mov eax, 10 ret foo: lea eax, [rdi+rdi] ret bar: jmp foo.constprop.0 But ... why foo.constprop.0 is not inlined fully into bar? Maybe foo.constprop.0 inherits noinline attribute from foo?=20 If so, gcc should drop attributes from cloned functions..=