From: Martin Liska Date: Wed, 23 Oct 2019 08:55:05 +0000 (+0200) Subject: Do not ICE in IPA inliner. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ae94bb0ee262e43ee391513210311594abf84e07;p=gcc.git Do not ICE in IPA inliner. 2019-10-23 Martin Liska PR ipa/91969 * ipa-inline.c (recursive_inlining): Do not print when curr->count is not initialized. 2019-10-23 Martin Liska PR ipa/91969 * g++.dg/ipa/pr91969.C: New test. From-SVN: r277309 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2445523f274..85cd7a023c2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-10-23 Martin Liska + + PR ipa/91969 + * ipa-inline.c (recursive_inlining): Do not print + when curr->count is not initialized. + 2019-10-23 Richard Biener * tree-vect-slp.c (vect_build_slp_tree_2): Do not build diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index 681801a9aec..ce146e0fc07 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -1610,7 +1610,7 @@ recursive_inlining (struct cgraph_edge *edge, { fprintf (dump_file, " Inlining call of depth %i", depth); - if (node->count.nonzero_p ()) + if (node->count.nonzero_p () && curr->count.initialized_p ()) { fprintf (dump_file, " called approx. %.2f times per call", (double)curr->count.to_gcov_type () diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fd272807d0b..482ff0ccabc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-10-23 Martin Liska + + PR ipa/91969 + * g++.dg/ipa/pr91969.C: New test. + 2019-10-22 Marc Glisse PR c++/85746 diff --git a/gcc/testsuite/g++.dg/ipa/pr91969.C b/gcc/testsuite/g++.dg/ipa/pr91969.C new file mode 100644 index 00000000000..90006720f1d --- /dev/null +++ b/gcc/testsuite/g++.dg/ipa/pr91969.C @@ -0,0 +1,38 @@ +/* PR ipa/91969 */ +/* { dg-options "-fdump-ipa-inline -O3" } */ + +enum by +{ +}; +class A +{ +public: + class B + { + public: + virtual void m_fn2 (by) = 0; + }; + virtual int m_fn1 (); + B *cf; +}; +by a; +class C : A, A::B +{ + void m_fn2 (by); +}; +void C::m_fn2 (by) { cf->m_fn2 (a); } + +struct a +{ + virtual ~a (); +}; + +struct b +{ + virtual void d (...); +}; + +struct c : a, b +{ + void d (...) {} +};