From: Marek Polacek Date: Thu, 26 Feb 2015 18:59:50 +0000 (+0000) Subject: re PR ipa/65008 (ICE: in estimate_edge_growth, at ipa-inline.h:298 with -O2) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1cf06f1e2512b55a55f837b43c1ff235a9be1992;p=gcc.git re PR ipa/65008 (ICE: in estimate_edge_growth, at ipa-inline.h:298 with -O2) PR ipa/65008 * ipa-inline.c (early_inliner): Recompute inline parameters. * g++.dg/ipa/pr65008.C: New test. From-SVN: r221025 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f651903d8e8..4fa8ad66478 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-02-26 Marek Polacek + + PR ipa/65008 + * ipa-inline.c (early_inliner): Recompute inline parameters. + 2015-02-26 Bill Schmidt PR target/65171 diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index 025f7fc5f6b..c445f0a7a5d 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -2559,6 +2559,19 @@ early_inliner (function *fun) { timevar_push (TV_INTEGRATION); todo |= optimize_inline_calls (current_function_decl); + /* optimize_inline_calls call above might have introduced new + statements that don't have inline parameters computed. */ + for (edge = node->callees; edge; edge = edge->next_callee) + { + if (inline_edge_summary_vec.length () > (unsigned) edge->uid) + { + struct inline_edge_summary *es = inline_edge_summary (edge); + es->call_stmt_size + = estimate_num_insns (edge->call_stmt, &eni_size_weights); + es->call_stmt_time + = estimate_num_insns (edge->call_stmt, &eni_time_weights); + } + } inline_update_overall_summary (node); inlined = false; timevar_pop (TV_INTEGRATION); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c9789d99b4f..be82a66b687 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-02-26 Marek Polacek + + PR ipa/65008 + * g++.dg/ipa/pr65008.C: New test. + 2015-02-26 Tom de Vries * lib/profopt.exp (profopt-target-cleanup): New proc. diff --git a/gcc/testsuite/g++.dg/ipa/pr65008.C b/gcc/testsuite/g++.dg/ipa/pr65008.C new file mode 100644 index 00000000000..29b3a2f161f --- /dev/null +++ b/gcc/testsuite/g++.dg/ipa/pr65008.C @@ -0,0 +1,19 @@ +// PR ipa/65008 +// { dg-do compile } +// { dg-options "-O2" } + +struct A +{ + A (); + virtual void foo () {} +}; + +static inline int __attribute__ ((always_inline)) call_foo (A *a) +{ + a->foo (); +} + +A::A () +{ + call_foo (this); +}