From: Martin Liska Date: Mon, 16 Jul 2018 13:33:23 +0000 (+0200) Subject: Revert one more symbol_summary::get to ::get_create (PR ipa/86529). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c4d0acf8f7af9c0ab1023b1e09cb17ae9b537204;p=gcc.git Revert one more symbol_summary::get to ::get_create (PR ipa/86529). 2018-07-16 Martin Liska PR ipa/86529 * ipa-pure-const.c (malloc_candidate_p): Revert ::get to ::get_create. 2018-07-16 Martin Liska PR ipa/86529 * g++.dg/ipa/pr86529.C: New test. From-SVN: r262695 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a0f3c523e47..41ea59b7aef 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-07-16 Martin Liska + + PR ipa/86529 + * ipa-pure-const.c (malloc_candidate_p): Revert ::get + to ::get_create. + 2017-07-16 Claudiu Zissulescu * config/arc/arcHS.md: Update ARCHS scheduling rules. diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c index dede783bd5f..a9a8863d907 100644 --- a/gcc/ipa-pure-const.c +++ b/gcc/ipa-pure-const.c @@ -958,8 +958,7 @@ malloc_candidate_p (function *fun, bool ipa) cgraph_edge *cs = node->get_edge (call_stmt); if (cs) { - ipa_call_summary *es = ipa_call_summaries->get (cs); - gcc_assert (es); + ipa_call_summary *es = ipa_call_summaries->get_create (cs); es->is_return_callee_uncaptured = true; } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cdbc0b85cc0..a4053c9b127 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-07-16 Martin Liska + + PR ipa/86529 + * g++.dg/ipa/pr86529.C: New test. + 2018-07-16 Tom de Vries PR debug/86455 diff --git a/gcc/testsuite/g++.dg/ipa/pr86529.C b/gcc/testsuite/g++.dg/ipa/pr86529.C new file mode 100644 index 00000000000..d753295b0a4 --- /dev/null +++ b/gcc/testsuite/g++.dg/ipa/pr86529.C @@ -0,0 +1,44 @@ +// { dg-do compile } +// { dg-options "-fipa-pure-const -std=c++11" } + +namespace std { +class type_info { +public: + bool operator==(type_info); +}; +class c { +public: + c(int) {} + type_info b; + virtual void *d() { + if (b == typeid(int)) + return e(); + return nullptr; + } + int *e() noexcept; +}; +class h { +public: + template h(g, f j) { new c(j); } +}; +class k { +protected: + int n; + k() : i(0, n) {} + h i; +}; +class F : k { + public: + F(int, int) {} + template friend F l(const f &); +}; +template F l(const f &p1) { F x(int(), p1); return x; } +template F m() { l(int()); return F(0, 0); } +class D { + F p; + +public: + D() : p(m()) {} +}; +} // namespace std +std::D a;