> On 2019/12/18 23:48, Jan Hubicka wrote:
> >> The size_info of ipa_size_summary are created by r277424.  It should be
> >> duplicated for cloned nodes, otherwise self_size and 
> >> estimated_self_stack_size
> >> would be 0, causing param large-function-insns and large-function-growth 
> >> working
> >> inaccurate when ipa-inline.
> >>
> >> gcc/ChangeLog:
> >>
> >>    2019-12-18  Luo Xiong Hu  <luo...@linux.ibm.com>
> >>
> >>    * ipa-fnsummary.c (ipa_fn_summary_t::duplicate): Copy
> >>    ipa_size_summary for cloned nodes.
> >> ---
> >>   gcc/ipa-fnsummary.c | 5 +++++
> >>   1 file changed, 5 insertions(+)
> >>
> >> diff --git a/gcc/ipa-fnsummary.c b/gcc/ipa-fnsummary.c
> >> index a46b1445765..9a01be1708b 100644
> >> --- a/gcc/ipa-fnsummary.c
> >> +++ b/gcc/ipa-fnsummary.c
> >> @@ -868,7 +868,12 @@ ipa_fn_summary_t::duplicate (cgraph_node *src,
> >>    }
> >>       }
> >>     if (!dst->inlined_to)
> >> +  {
> >> +    class ipa_size_summary *src_size = ipa_size_summaries->get_create 
> >> (src);
> >> +    class ipa_size_summary *dst_size = ipa_size_summaries->get_create 
> >> (dst);
> > 
> > This is intended to happen by the default duplicate method of
> > ipa_size_summaries via to copy constructor. It seems there is a stupid
> > pasto and the copy constructor is unused since the default duplicate
> > implementation does nothing (wonder why).
> > 
> > I am testing the attached patch.  Does this help?
> 
> Yes, It works.  Thanks for your refine.  The default duplicate implementation 
> is in
> symbol-summary.h:template <class T>class function_summary_base::duplicate, I 
> tried
> to call duplicate in it, but it will cause a lot of errors as many classes 
> doesn't
> implement the virtual duplicate function.  Please commit your patch once 
> tested pass :)
Comitted, thanks!
Honza

Reply via email to