From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A7DAF385843D; Wed, 21 Dec 2022 10:44:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A7DAF385843D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671619467; bh=llMd7zGJDGmN7uVIjv7gV2zmuqvNfv6C2jm12F3+PDM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=iNw5G1wwKh0rllTB928yQyXa31+LeGeOnhSSLIYVCjuZyHtkkXLNcPmbYSh/zQuH/ Y/JhdvfOfNDXea8X8baVsb5YLHy/FlAl9SrgNS/DB2eU3g5YtXDSmK1X6WBROe+1W+ WYO4gMkZhzs++NZ6HSU5gEMcXjDeN61Z6h8ouoFM= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/107931] [12/13 Regression] -Og causes always_inline to fail since r12-6677-gc952126870c92cf2 Date: Wed, 21 Dec 2022 10:44:27 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.3 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=3D107931 --- Comment #8 from Richard Biener --- Just to recap here, we inline fun3 via inline_always_inline_functions and then early_inline_small_functions bails on the call because foo4 doesn't yet have a function summary: /* We can encounter not-yet-analyzed function during early inlining on callgraphs with strongly connected components. */ ipa_fn_summary *s =3D ipa_fn_summaries->get (callee); if (s =3D=3D NULL || !s->inlinable || !e->inline_failed) continue; that's where the ordering constraint comes in. That's also a hard error in can_inline_edge_p which does else if (ipa_fn_summaries->get (callee) =3D=3D NULL || !ipa_fn_summaries->get (callee)->inlinable) {=20 e->inline_failed =3D CIF_FUNCTION_NOT_INLINABLE; inlinable =3D false; even if we'd try harder and re-do inline_always_inline_functions after each inline step (up to max early inliner iterations). Maybe for QOI we can handle this special case in ipa_reverse_postorder by putting address-taken nodes without any calls last (we don't seem to have indirect edges at this point to do a better job): diff --git a/gcc/ipa-utils.cc b/gcc/ipa-utils.cc index 67dd42f4faf..75e1387714e 100644 --- a/gcc/ipa-utils.cc +++ b/gcc/ipa-utils.cc @@ -294,7 +294,7 @@ ipa_reverse_postorder (struct cgraph_node **order) for (pass =3D 0; pass < 2; pass++) FOR_EACH_FUNCTION (node) if (!node->aux - && (pass + && ((pass && !(!node->callees && node->address_taken)) || (!node->address_taken && !node->inlined_to && !node->alias && !node->thunk @@ -346,7 +346,10 @@ ipa_reverse_postorder (struct cgraph_node **order) } free (stack); FOR_EACH_FUNCTION (node) - node->aux =3D NULL; + if (!node->aux) + order[order_pos++] =3D node; + else + node->aux =3D NULL; return order_pos; }=