From: Martin Liska Date: Mon, 4 Feb 2019 12:19:48 +0000 (+0100) Subject: Bail out when ipa_fn_summaries does not contain entry for callee (PR ipa/88958). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1d546c60983797f7090739e50d4bbccc95515d34;p=gcc.git Bail out when ipa_fn_summaries does not contain entry for callee (PR ipa/88958). 2019-02-04 Martin Liska PR ipa/88958 * ipa-fnsummary.c (estimate_edge_devirt_benefit): Bail out when ipa_fn_summaries does not contain entry for callee. 2019-02-04 Martin Liska PR ipa/88958 * gcc.dg/ipa/pr88958.c: New test. From-SVN: r268516 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1c9b1c77929..f55dfcd39fb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-02-04 Martin Liska + + PR ipa/88958 + * ipa-fnsummary.c (estimate_edge_devirt_benefit): Bail + out when ipa_fn_summaries does not contain entry for callee. + 2019-02-04 Eric Botcazou * config/sparc/sparc.h: Remove superfluous blank lines. diff --git a/gcc/ipa-fnsummary.c b/gcc/ipa-fnsummary.c index 535b3f22d49..057b364b379 100644 --- a/gcc/ipa-fnsummary.c +++ b/gcc/ipa-fnsummary.c @@ -2582,6 +2582,9 @@ estimate_edge_devirt_benefit (struct cgraph_edge *ie, if (avail < AVAIL_AVAILABLE) return false; isummary = ipa_fn_summaries->get (callee); + if (isummary == NULL) + return false; + return isummary->inlinable; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8df6a0546d1..231cd55ca30 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-02-04 Martin Liska + + PR ipa/88958 + * gcc.dg/ipa/pr88958.c: New test. + 2019-02-04 Jakub Jelinek * gcc.dg/debug/dwarf2/inline5.c: Handle also @, ; or | comment diff --git a/gcc/testsuite/gcc.dg/ipa/pr88958.c b/gcc/testsuite/gcc.dg/ipa/pr88958.c new file mode 100644 index 00000000000..8253a893cf6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/pr88958.c @@ -0,0 +1,13 @@ +void f (void) +{ +} +__attribute__((__optimize__("O2"))) +void g (void f()) +{ + f(); +} +__attribute__((__optimize__("O2"))) +void h (void) +{ + g(f); +}