From 44fca83228acc96c19c51e52b5c0448e09329170 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Thu, 19 Dec 2019 09:20:09 +0100 Subject: [PATCH] ipa: duplicate ipa_size_summary for cloned nodes * ipa-fnsummary.h (ipa_size_summary): Remove copy consturctor. (ipa_size_summary_t): Add duplicate method; move to heap. * ipa-fnsumary.c (ipa_fn_summary_alloc): Fix allocation. From-SVN: r279563 --- gcc/ChangeLog | 7 +++++++ gcc/ipa-fnsummary.c | 3 +-- gcc/ipa-fnsummary.h | 21 +++++++++------------ 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e52d05634d3..3b703386ddd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2019-12-19 Jan Hubicka + Luo Xiong Hu PR ipa/92794 diff --git a/gcc/ipa-fnsummary.c b/gcc/ipa-fnsummary.c index a54703fb347..5486f6496bd 100644 --- a/gcc/ipa-fnsummary.c +++ b/gcc/ipa-fnsummary.c @@ -672,8 +672,7 @@ static void ipa_fn_summary_alloc (void) { gcc_checking_assert (!ipa_fn_summaries); - ipa_size_summaries = new fast_function_summary - (symtab); + ipa_size_summaries = new ipa_size_summary_t (symtab); ipa_fn_summaries = ipa_fn_summary_t::create_ggc (symtab); ipa_call_summaries = new ipa_call_summary_t (symtab); } diff --git a/gcc/ipa-fnsummary.h b/gcc/ipa-fnsummary.h index e43003212a8..a0ac0b7d556 100644 --- a/gcc/ipa-fnsummary.h +++ b/gcc/ipa-fnsummary.h @@ -99,11 +99,6 @@ public: : estimated_self_stack_size (0), self_size (0), size (0) { } - /* Copy constructor. */ - ipa_size_summary (const ipa_size_summary &s) - : estimated_self_stack_size (0), self_size (s.self_size), size (s.size) - { - } }; /* Function inlining information. */ @@ -226,18 +221,20 @@ extern GTY(()) fast_function_summary *ipa_fn_summaries; class ipa_size_summary_t: - public fast_function_summary + public fast_function_summary { public: ipa_size_summary_t (symbol_table *symtab): - fast_function_summary (symtab) {} + fast_function_summary (symtab) + { + disable_insertion_hook (); + } - static ipa_size_summary_t *create_ggc (symbol_table *symtab) + virtual void duplicate (cgraph_node *, cgraph_node *, + ipa_size_summary *src_data, + ipa_size_summary *dst_data) { - class ipa_size_summary_t *summary = new (ggc_alloc ()) - ipa_size_summary_t (symtab); - summary->disable_insertion_hook (); - return summary; + *dst_data = *src_data; } }; extern fast_function_summary -- 2.30.2