From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4EFF43858410; Mon, 25 Mar 2024 10:40:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4EFF43858410 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1711363210; bh=mesunE7FBoUSdCGQkhxBH5laxrAT7SKJ9/bzP12fwlo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=eZ5ojfDtoNrPFlVmLneEXXSPQ+fM/Qp1yemsOYRl2GMWCGzzwpjy7AykBTj+EojPZ vFyJuk54UBs6BSu2W1QqxbSMwJMv5Nnh4lnfHvVhr0UnR5VrP2aTbeGi0cxemxGSE5 2kBFntHFT6Vvn3obtx1mqXBXnNEssYvb7RHuYJyU= From: "chfast at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/114452] Functions invoked through compile-time table of function pointers not inlined Date: Mon, 25 Mar 2024 10:40:09 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: chfast at gmail dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: DUPLICATE 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=3D114452 --- Comment #2 from Pawe=C5=82 Bylica --- I don't think this is related to lambdas. The following is also not optimiz= ed: using F =3D int (*)(int) noexcept; inline int impl(int x) noexcept { return x; } void test(int z[2]) noexcept { static constexpr F fs[]{ impl, impl, }; for (int i =3D 0; i < 2; ++i) { z[i] =3D fs[i](z[i]); } } https://godbolt.org/z/9hPbzo4Px=