[RFC] ipa: duplicate ipa_size_summary for cloned nodes

Message ID 20191218034116.100185-1-luoxhu@linux.ibm.com
State New
Headers show
Series
  • [RFC] ipa: duplicate ipa_size_summary for cloned nodes
Related show

Commit Message

luoxhu Dec. 18, 2019, 3:41 a.m.
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  <luoxhu@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(+)

-- 
2.21.0.777.g83232e3864

Comments

Jan Hubicka Dec. 18, 2019, 3:08 p.m. | #1
> 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  <luoxhu@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);

> +    *dst_size = *src_size;

>      ipa_update_overall_fn_summary (dst);

> +  }


Thanks for spotting this! It is quite bad bug.
The summaries are supposed to be copied by duplicate method. However it
seems that the default duplicate implementation doesn't do the copy (I
wonder why) and moreover copy constructor is broken not copying
correctly stack use.  I think we are fine with the default copy
constructor as follows

Does it fix your testcase?

Index: ipa-fnsummary.h
===================================================================
--- ipa-fnsummary.h	(revision 279523)
+++ ipa-fnsummary.h	(working copy)
@@ -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 <ip
   *ipa_fn_summaries;
 
 class ipa_size_summary_t:
-  public fast_function_summary <ipa_size_summary *, va_gc>
+  public fast_function_summary <ipa_size_summary *, va_heap>
 {
 public:
   ipa_size_summary_t (symbol_table *symtab):
-    fast_function_summary <ipa_size_summary *, va_gc> (symtab) {}
+    fast_function_summary <ipa_size_summary *, va_heap> (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> ())
-      ipa_size_summary_t (symtab);
-    summary->disable_insertion_hook ();
-    return summary;
+    *dst_data = *src_data;
   }
 };
 extern fast_function_summary <ipa_size_summary *, va_heap>
Index: ipa-fnsummary.c
===================================================================
--- ipa-fnsummary.c	(revision 279523)
+++ ipa-fnsummary.c	(working copy)
@@ -672,8 +672,7 @@ static void
 ipa_fn_summary_alloc (void)
 {
   gcc_checking_assert (!ipa_fn_summaries);
-  ipa_size_summaries = new fast_function_summary <ipa_size_summary *, va_heap>
-							 (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);
 }
Jan Hubicka Dec. 18, 2019, 3:48 p.m. | #2
> 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  <luoxhu@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? 

Index: ipa-fnsummary.h
===================================================================
--- ipa-fnsummary.h	(revision 279523)
+++ ipa-fnsummary.h	(working copy)
@@ -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 <ip
   *ipa_fn_summaries;
 
 class ipa_size_summary_t:
-  public fast_function_summary <ipa_size_summary *, va_gc>
+  public fast_function_summary <ipa_size_summary *, va_heap>
 {
 public:
   ipa_size_summary_t (symbol_table *symtab):
-    fast_function_summary <ipa_size_summary *, va_gc> (symtab) {}
+    fast_function_summary <ipa_size_summary *, va_heap> (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> ())
-      ipa_size_summary_t (symtab);
-    summary->disable_insertion_hook ();
-    return summary;
+    *dst_data = *src_data;
   }
 };
 extern fast_function_summary <ipa_size_summary *, va_heap>
Index: ipa-fnsummary.c
===================================================================
--- ipa-fnsummary.c	(revision 279523)
+++ ipa-fnsummary.c	(working copy)
@@ -672,8 +672,7 @@ static void
 ipa_fn_summary_alloc (void)
 {
   gcc_checking_assert (!ipa_fn_summaries);
-  ipa_size_summaries = new fast_function_summary <ipa_size_summary *, va_heap>
-							 (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);
 }
luoxhu Dec. 19, 2019, 1:46 a.m. | #3
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  <luoxhu@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 :)

Xiong Hu
> 

> Index: ipa-fnsummary.h

> ===================================================================

> --- ipa-fnsummary.h	(revision 279523)

> +++ ipa-fnsummary.h	(working copy)

> @@ -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 <ip

>     *ipa_fn_summaries;

>   

>   class ipa_size_summary_t:

> -  public fast_function_summary <ipa_size_summary *, va_gc>

> +  public fast_function_summary <ipa_size_summary *, va_heap>

>   {

>   public:

>     ipa_size_summary_t (symbol_table *symtab):

> -    fast_function_summary <ipa_size_summary *, va_gc> (symtab) {}

> +    fast_function_summary <ipa_size_summary *, va_heap> (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> ())

> -      ipa_size_summary_t (symtab);

> -    summary->disable_insertion_hook ();

> -    return summary;

> +    *dst_data = *src_data;

>     }

>   };

>   extern fast_function_summary <ipa_size_summary *, va_heap>

> Index: ipa-fnsummary.c

> ===================================================================

> --- ipa-fnsummary.c	(revision 279523)

> +++ ipa-fnsummary.c	(working copy)

> @@ -672,8 +672,7 @@ static void

>   ipa_fn_summary_alloc (void)

>   {

>     gcc_checking_assert (!ipa_fn_summaries);

> -  ipa_size_summaries = new fast_function_summary <ipa_size_summary *, va_heap>

> -							 (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);

>   }

>
Jan Hubicka Dec. 19, 2019, 12:22 p.m. | #4
> 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  <luoxhu@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
Martin Jambor Jan. 3, 2020, 3:27 p.m. | #5
Hi,

On Thu, Dec 19 2019, Jan Hubicka wrote:
>> 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  <luoxhu@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!


Unfortunately, this has caused Ada LTO bootstrap to fail when the system
compiler is GCC 4.8.5.  Ada LTO bootstrap seems to be fine when the
system compiler is GCC 7.4.1.  I do not know what is the minimal version
which works.

Not sure to what extent this is a problem but we should at least
document it, I guess.  For what it's worth the warnings and errors that
lead to the bootstrap failure are copied below.

Martin


/home/mjambor/gcc/mine/src/gcc/ada/gnatvsn.adb:57:4: warning: type of ‘gnatvsn__version_string’ does not match original declaration [-Wlto-type-mismatch]
   57 |    Version_String : char_array (0 .. Ver_Len_Max - 1);
      |    ^
/home/mjambor/gcc/mine/src/gcc/version.c:34:12: note: array types have different bounds
   34 | const char version_string[] = BASEVER DATESTAMP DEVPHASE REVISION;
      |            ^
/home/mjambor/gcc/mine/src/gcc/version.c:34:12: note: ‘version_string’ was previously declared here
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-except.adb:1663:17: warning: type of ‘ada__exceptions__to_stderr__put_char_stderr__2’ does not match original declaration [-Wlto-type-mismatch]
 1663 |       procedure Put_Char_Stderr (C : Character);
      |                 ^
/home/mjambor/gcc/mine/src/gcc/ada/cio.c:126:1: note: type mismatch in parameter 1
  126 | put_char_stderr (int c)
      | ^
/home/mjambor/gcc/mine/src/gcc/ada/cio.c:126:1: note: type ‘int’ should match type ‘character’
/home/mjambor/gcc/mine/src/gcc/ada/cio.c:126:1: note: ‘put_char_stderr’ was previously declared here
/home/mjambor/gcc/mine/src/gcc/ada/raise-gcc.c:542:18: warning: type of ‘__gnat_others_value’ does not match original declaration [-Wlto-type-mismatch]
  542 | extern const int __gnat_others_value;
      |                  ^
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:303:4: note: type ‘character’ should match type ‘const int’
  303 |    Others_Value : constant Character := 'O';
      |    ^
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:303:4: note: ‘ada__exceptions__exception_propagation__others_valueXn’ was previously declared here
/home/mjambor/gcc/mine/src/gcc/ada/raise-gcc.c:545:18: warning: type of ‘__gnat_all_others_value’ does not match original declaration [-Wlto-type-mismatch]
  545 | extern const int __gnat_all_others_value;
      |                  ^
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:306:4: note: type ‘character’ should match type ‘const int’
  306 |    All_Others_Value : constant Character := 'A';
      |    ^
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:306:4: note: ‘ada__exceptions__exception_propagation__all_others_valueXn’ was previously declared here
/home/mjambor/gcc/mine/src/gcc/ada/raise-gcc.c:548:18: warning: type of ‘__gnat_unhandled_others_value’ does not match original declaration [-Wlto-type-mismatch]
  548 | extern const int __gnat_unhandled_others_value;
      |                  ^
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:309:4: note: type ‘character’ should match type ‘const int’
  309 |    Unhandled_Others_Value : constant Character := 'U';
      |    ^
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:309:4: note: ‘ada__exceptions__exception_propagation__unhandled_others_valueXn’ was previously declared here
/home/mjambor/gcc/mine/src/gcc/ada/init.c:100:13: warning: type of ‘ada__exceptions__raise_from_signal_handle ’ does not match original declaration [-Wlto-type-mismatch]
  100 | extern void Raise_From_Signal_Handler (struct Exception_Data *, const char *);
      |             ^
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-except.adb:1088:4: note: type mismatch in parameter 2
 1088 |    procedure Raise_From_Signal_Handler
      |    ^
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-except.adb:1088:4: note: ‘ada__exceptions__raise_from_signal_handler’ was previously declared here
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-except.adb:1088:4: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
/home/mjambor/gcc/mine/src/gcc/ada/init.c:89:30: warning: type of ‘storage_error’ does not match original declaration [-Wlto-type-mismatch]
   89 | extern struct Exception_Data storage_error;
      |                              ^
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/s-stalib.ads:179:4: note: type ‘struct exception’ should match type ‘struct Exception_Data’
  179 |    Storage_Error_Def : aliased Exception_Data :=
      |    ^
/home/mjambor/gcc/mine/src/gcc/ada/raise.h:38:8: note: the incompatible type is defined here
   38 | struct Exception_Data
      |        ^
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/s-stalib.ads:179:4: note: ‘system__standard_library__storage_error_def’ was previously declared here
  179 |    Storage_Error_Def : aliased Exception_Data :=
      |    ^
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/s-stalib.ads:179:4: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
/home/mjambor/gcc/mine/src/gcc/ada/init.c:86:30: warning: type of ‘constraint_error’ does not match original declaration [-Wlto-type-mismatch]
   86 | extern struct Exception_Data constraint_error;
      |                              ^
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/s-stalib.ads:152:4: note: type ‘struct exception’ should match type ‘struct Exception_Data’
  152 |    Constraint_Error_Def : aliased Exception_Data :=
      |    ^
/home/mjambor/gcc/mine/src/gcc/ada/raise.h:38:8: note: the incompatible type is defined here
   38 | struct Exception_Data
      |        ^
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/s-stalib.ads:152:4: note: ‘system__standard_library__constraint_error_def’ was previously declared here
  152 |    Constraint_Error_Def : aliased Exception_Data :=
      |    ^
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/s-stalib.ads:152:4: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
/home/mjambor/gcc/mine/src/gcc/ada/init.c:88:30: warning: type of ‘program_error’ does not match original declaration [-Wlto-type-mismatch]
   88 | extern struct Exception_Data program_error;
      |                              ^
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/s-stalib.ads:170:4: note: type ‘struct exception’ should match type ‘struct Exception_Data’
  170 |    Program_Error_Def : aliased Exception_Data :=
      |    ^
/home/mjambor/gcc/mine/src/gcc/ada/raise.h:38:8: note: the incompatible type is defined here
   38 | struct Exception_Data
      |        ^
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/s-stalib.ads:170:4: note: ‘system__standard_library__program_error_def’ was previously declared here
  170 |    Program_Error_Def : aliased Exception_Data :=
      |    ^
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/s-stalib.ads:170:4: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
/home/mjambor/gcc/mine/src/gcc/ada/raise-gcc.c:900:13: warning: type of ‘__gnat_language_for’ does not match original declaration [-Wlto-type-mismatch]
  900 | extern char Language_For (_Unwind_Ptr eid);
      |             ^
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:708:4: note: type mismatch in parameter 1
  708 |    function Language_For (E : SSL.Exception_Data_Ptr) return Character is
      |    ^
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:708:4: note: type ‘struct system__standard_library__exception_data *’ should match type ‘_Unwind_Ptr’
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:708:4: note: ‘ada__exceptions__exception_propagation__language_forXn’ was previously declared here
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:708:4: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
/home/mjambor/gcc/mine/src/gcc/ada/raise-gcc.c:899:13: warning: type of ‘__gnat_is_handled_by_others’ does not match original declaration [-Wlto-type-mismatch]
  899 | extern bool Is_Handled_By_Others (_Unwind_Ptr eid);
      |             ^
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:699:4: note: return value type mismatch
  699 |    function Is_Handled_By_Others (E : SSL.Exception_Data_Ptr) return Boolean is
      |    ^
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:699:4: note: type ‘boolean’ should match type ‘bool’
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:699:4: note: ‘ada__exceptions__exception_propagation__is_handled_by_othersXn’ was previously declared here
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:699:4: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
/home/mjambor/gcc/mine/src/gcc/ada/raise-gcc.c:902:14: warning: type of ‘__gnat_foreign_data_for’ does not match original declaration [-Wlto-type-mismatch]
  902 | extern void *Foreign_Data_For (_Unwind_Ptr eid);
      |              ^
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:688:4: note: type mismatch in parameter 1
  688 |    function Foreign_Data_For
      |    ^
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:688:4: note: type ‘struct system__standard_library__exception_data *’ should match type ‘_Unwind_Ptr’
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:688:4: note: ‘ada__exceptions__exception_propagation__foreign_data_forXn’ was previously declared here
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:688:4: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
/home/mjambor/gcc/mine/src/gcc/ada/raise-gcc.c:907:30: warning: type of ‘system__exceptions__foreign_exceptio ’ does not match original declaration [-Wlto-type-mismatch]
  907 | extern struct Exception_Data Foreign_Exception;
      |                              ^
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/s-except.ads:61:4: note: type ‘struct exception’ should match type ‘struct Exception_Data’
   61 |    Foreign_Exception : exception;
      |    ^
/home/mjambor/gcc/mine/src/gcc/ada/raise.h:38:8: note: the incompatible type is defined here
   38 | struct Exception_Data
      |        ^
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/s-except.ads:61:4: note: ‘system__exceptions__foreign_exception’ was previously declared here
   61 |    Foreign_Exception : exception;
      |    ^
/home/mjambor/gcc/mine/src/gcc/ada/libgnat/s-except.ads:61:4: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
/home/mjambor/gcc/mine/src/gcc/ada/bindo-diagnostics.adb: In function ‘bindo__diagnostics__diagnose_cycle’:
/home/mjambor/gcc/mine/src/gcc/ada/bindo-diagnostics.adb:395:7: warning: ‘current_edge’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  395 |       Output_Transition
      |       ^
/home/mjambor/gcc/mine/src/gcc/ada/bindo-diagnostics.adb:346:7: note: ‘current_edge’ was declared here
  346 |       Current_Edge : Library_Graph_Edge_Id;
      |       ^
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: DWARF error: could not find abbrev number 13216
/tmp/gnatbind.Y7G8bN.ltrans9.ltrans.o: in function `system__assertions__raise_assert_failure':
<artificial>:(.text+0x4c8e): undefined reference to `__gnat_debug_raise_assert_failure'
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: DWARF error: could not find abbrev number 10781
/tmp/gnatbind.Y7G8bN.ltrans0.ltrans.o: in function `ada__exceptions__complete_occurrence':
<artificial>:(.text+0x2019): undefined reference to `__gnat_debug_raise_exception'
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: /tmp/gnatbind.Y7G8bN.ltrans0.ltrans.o: in function `__gnat_notify_unhandled_exception':
<artificial>:(.text+0x764b): undefined reference to `__gnat_unhandled_exception'
collect2: error: ld returned 1 exit status
/home/mjambor/gcc/mine/src/gcc/ada/gcc-interface/Make-lang.in:677: recipe for target 'gnatbind' failed
make[2]: *** [gnatbind] Error 1
make[2]: Leaving directory '/home/mjambor/gcc/mine/b-obj/gcc'
Makefile:4744: recipe for target 'all-stage2-gcc' failed
make[1]: *** [all-stage2-gcc] Error 2
make[1]: Leaving directory '/home/mjambor/gcc/mine/b-obj'
Makefile:23726: recipe for target 'stage2-bubble' failed
make: *** [stage2-bubble] Error 2
Martin Jambor Jan. 9, 2020, 5:17 p.m. | #6
Hello again,

On Fri, Jan 03 2020, Martin Jambor wrote:
> Hi,

>

> On Thu, Dec 19 2019, Jan Hubicka wrote:

>>> 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  <luoxhu@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!

>

> Unfortunately, this has caused Ada LTO bootstrap to fail when the system

> compiler is GCC 4.8.5.  Ada LTO bootstrap seems to be fine when the

> system compiler is GCC 7.4.1.  I do not know what is the minimal version

> which works.

>


Scratch that, I was bootstrapping a wrong source directory, Ada LTO
bootstrap is broken also with GCC 7.5 and 6.3 as the system compiler,
this also breaks on compile farm's gcc67, for example, and it is now
reported as PR 93214.

Sorry about the confusion,

Martin


> For what it's worth the warnings and errors that

> lead to the bootstrap failure are copied below.

>

> Martin

>

>

> /home/mjambor/gcc/mine/src/gcc/ada/gnatvsn.adb:57:4: warning: type of ‘gnatvsn__version_string’ does not match original declaration [-Wlto-type-mismatch]

>    57 |    Version_String : char_array (0 .. Ver_Len_Max - 1);

>       |    ^

> /home/mjambor/gcc/mine/src/gcc/version.c:34:12: note: array types have different bounds

>    34 | const char version_string[] = BASEVER DATESTAMP DEVPHASE REVISION;

>       |            ^

> /home/mjambor/gcc/mine/src/gcc/version.c:34:12: note: ‘version_string’ was previously declared here

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-except.adb:1663:17: warning: type of ‘ada__exceptions__to_stderr__put_char_stderr__2’ does not match original declaration [-Wlto-type-mismatch]

>  1663 |       procedure Put_Char_Stderr (C : Character);

>       |                 ^

> /home/mjambor/gcc/mine/src/gcc/ada/cio.c:126:1: note: type mismatch in parameter 1

>   126 | put_char_stderr (int c)

>       | ^

> /home/mjambor/gcc/mine/src/gcc/ada/cio.c:126:1: note: type ‘int’ should match type ‘character’

> /home/mjambor/gcc/mine/src/gcc/ada/cio.c:126:1: note: ‘put_char_stderr’ was previously declared here

> /home/mjambor/gcc/mine/src/gcc/ada/raise-gcc.c:542:18: warning: type of ‘__gnat_others_value’ does not match original declaration [-Wlto-type-mismatch]

>   542 | extern const int __gnat_others_value;

>       |                  ^

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:303:4: note: type ‘character’ should match type ‘const int’

>   303 |    Others_Value : constant Character := 'O';

>       |    ^

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:303:4: note: ‘ada__exceptions__exception_propagation__others_valueXn’ was previously declared here

> /home/mjambor/gcc/mine/src/gcc/ada/raise-gcc.c:545:18: warning: type of ‘__gnat_all_others_value’ does not match original declaration [-Wlto-type-mismatch]

>   545 | extern const int __gnat_all_others_value;

>       |                  ^

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:306:4: note: type ‘character’ should match type ‘const int’

>   306 |    All_Others_Value : constant Character := 'A';

>       |    ^

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:306:4: note: ‘ada__exceptions__exception_propagation__all_others_valueXn’ was previously declared here

> /home/mjambor/gcc/mine/src/gcc/ada/raise-gcc.c:548:18: warning: type of ‘__gnat_unhandled_others_value’ does not match original declaration [-Wlto-type-mismatch]

>   548 | extern const int __gnat_unhandled_others_value;

>       |                  ^

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:309:4: note: type ‘character’ should match type ‘const int’

>   309 |    Unhandled_Others_Value : constant Character := 'U';

>       |    ^

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:309:4: note: ‘ada__exceptions__exception_propagation__unhandled_others_valueXn’ was previously declared here

> /home/mjambor/gcc/mine/src/gcc/ada/init.c:100:13: warning: type of ‘ada__exceptions__raise_from_signal_handle ’ does not match original declaration [-Wlto-type-mismatch]

>   100 | extern void Raise_From_Signal_Handler (struct Exception_Data *, const char *);

>       |             ^

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-except.adb:1088:4: note: type mismatch in parameter 2

>  1088 |    procedure Raise_From_Signal_Handler

>       |    ^

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-except.adb:1088:4: note: ‘ada__exceptions__raise_from_signal_handler’ was previously declared here

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-except.adb:1088:4: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used

> /home/mjambor/gcc/mine/src/gcc/ada/init.c:89:30: warning: type of ‘storage_error’ does not match original declaration [-Wlto-type-mismatch]

>    89 | extern struct Exception_Data storage_error;

>       |                              ^

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/s-stalib.ads:179:4: note: type ‘struct exception’ should match type ‘struct Exception_Data’

>   179 |    Storage_Error_Def : aliased Exception_Data :=

>       |    ^

> /home/mjambor/gcc/mine/src/gcc/ada/raise.h:38:8: note: the incompatible type is defined here

>    38 | struct Exception_Data

>       |        ^

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/s-stalib.ads:179:4: note: ‘system__standard_library__storage_error_def’ was previously declared here

>   179 |    Storage_Error_Def : aliased Exception_Data :=

>       |    ^

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/s-stalib.ads:179:4: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used

> /home/mjambor/gcc/mine/src/gcc/ada/init.c:86:30: warning: type of ‘constraint_error’ does not match original declaration [-Wlto-type-mismatch]

>    86 | extern struct Exception_Data constraint_error;

>       |                              ^

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/s-stalib.ads:152:4: note: type ‘struct exception’ should match type ‘struct Exception_Data’

>   152 |    Constraint_Error_Def : aliased Exception_Data :=

>       |    ^

> /home/mjambor/gcc/mine/src/gcc/ada/raise.h:38:8: note: the incompatible type is defined here

>    38 | struct Exception_Data

>       |        ^

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/s-stalib.ads:152:4: note: ‘system__standard_library__constraint_error_def’ was previously declared here

>   152 |    Constraint_Error_Def : aliased Exception_Data :=

>       |    ^

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/s-stalib.ads:152:4: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used

> /home/mjambor/gcc/mine/src/gcc/ada/init.c:88:30: warning: type of ‘program_error’ does not match original declaration [-Wlto-type-mismatch]

>    88 | extern struct Exception_Data program_error;

>       |                              ^

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/s-stalib.ads:170:4: note: type ‘struct exception’ should match type ‘struct Exception_Data’

>   170 |    Program_Error_Def : aliased Exception_Data :=

>       |    ^

> /home/mjambor/gcc/mine/src/gcc/ada/raise.h:38:8: note: the incompatible type is defined here

>    38 | struct Exception_Data

>       |        ^

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/s-stalib.ads:170:4: note: ‘system__standard_library__program_error_def’ was previously declared here

>   170 |    Program_Error_Def : aliased Exception_Data :=

>       |    ^

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/s-stalib.ads:170:4: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used

> /home/mjambor/gcc/mine/src/gcc/ada/raise-gcc.c:900:13: warning: type of ‘__gnat_language_for’ does not match original declaration [-Wlto-type-mismatch]

>   900 | extern char Language_For (_Unwind_Ptr eid);

>       |             ^

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:708:4: note: type mismatch in parameter 1

>   708 |    function Language_For (E : SSL.Exception_Data_Ptr) return Character is

>       |    ^

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:708:4: note: type ‘struct system__standard_library__exception_data *’ should match type ‘_Unwind_Ptr’

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:708:4: note: ‘ada__exceptions__exception_propagation__language_forXn’ was previously declared here

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:708:4: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used

> /home/mjambor/gcc/mine/src/gcc/ada/raise-gcc.c:899:13: warning: type of ‘__gnat_is_handled_by_others’ does not match original declaration [-Wlto-type-mismatch]

>   899 | extern bool Is_Handled_By_Others (_Unwind_Ptr eid);

>       |             ^

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:699:4: note: return value type mismatch

>   699 |    function Is_Handled_By_Others (E : SSL.Exception_Data_Ptr) return Boolean is

>       |    ^

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:699:4: note: type ‘boolean’ should match type ‘bool’

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:699:4: note: ‘ada__exceptions__exception_propagation__is_handled_by_othersXn’ was previously declared here

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:699:4: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used

> /home/mjambor/gcc/mine/src/gcc/ada/raise-gcc.c:902:14: warning: type of ‘__gnat_foreign_data_for’ does not match original declaration [-Wlto-type-mismatch]

>   902 | extern void *Foreign_Data_For (_Unwind_Ptr eid);

>       |              ^

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:688:4: note: type mismatch in parameter 1

>   688 |    function Foreign_Data_For

>       |    ^

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:688:4: note: type ‘struct system__standard_library__exception_data *’ should match type ‘_Unwind_Ptr’

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:688:4: note: ‘ada__exceptions__exception_propagation__foreign_data_forXn’ was previously declared here

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/a-exexpr.adb:688:4: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used

> /home/mjambor/gcc/mine/src/gcc/ada/raise-gcc.c:907:30: warning: type of ‘system__exceptions__foreign_exceptio ’ does not match original declaration [-Wlto-type-mismatch]

>   907 | extern struct Exception_Data Foreign_Exception;

>       |                              ^

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/s-except.ads:61:4: note: type ‘struct exception’ should match type ‘struct Exception_Data’

>    61 |    Foreign_Exception : exception;

>       |    ^

> /home/mjambor/gcc/mine/src/gcc/ada/raise.h:38:8: note: the incompatible type is defined here

>    38 | struct Exception_Data

>       |        ^

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/s-except.ads:61:4: note: ‘system__exceptions__foreign_exception’ was previously declared here

>    61 |    Foreign_Exception : exception;

>       |    ^

> /home/mjambor/gcc/mine/src/gcc/ada/libgnat/s-except.ads:61:4: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used

> /home/mjambor/gcc/mine/src/gcc/ada/bindo-diagnostics.adb: In function ‘bindo__diagnostics__diagnose_cycle’:

> /home/mjambor/gcc/mine/src/gcc/ada/bindo-diagnostics.adb:395:7: warning: ‘current_edge’ may be used uninitialized in this function [-Wmaybe-uninitialized]

>   395 |       Output_Transition

>       |       ^

> /home/mjambor/gcc/mine/src/gcc/ada/bindo-diagnostics.adb:346:7: note: ‘current_edge’ was declared here

>   346 |       Current_Edge : Library_Graph_Edge_Id;

>       |       ^

> /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: DWARF error: could not find abbrev number 13216

> /tmp/gnatbind.Y7G8bN.ltrans9.ltrans.o: in function `system__assertions__raise_assert_failure':

> <artificial>:(.text+0x4c8e): undefined reference to `__gnat_debug_raise_assert_failure'

> /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: DWARF error: could not find abbrev number 10781

> /tmp/gnatbind.Y7G8bN.ltrans0.ltrans.o: in function `ada__exceptions__complete_occurrence':

> <artificial>:(.text+0x2019): undefined reference to `__gnat_debug_raise_exception'

> /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: /tmp/gnatbind.Y7G8bN.ltrans0.ltrans.o: in function `__gnat_notify_unhandled_exception':

> <artificial>:(.text+0x764b): undefined reference to `__gnat_unhandled_exception'

> collect2: error: ld returned 1 exit status

> /home/mjambor/gcc/mine/src/gcc/ada/gcc-interface/Make-lang.in:677: recipe for target 'gnatbind' failed

> make[2]: *** [gnatbind] Error 1

> make[2]: Leaving directory '/home/mjambor/gcc/mine/b-obj/gcc'

> Makefile:4744: recipe for target 'all-stage2-gcc' failed

> make[1]: *** [all-stage2-gcc] Error 2

> make[1]: Leaving directory '/home/mjambor/gcc/mine/b-obj'

> Makefile:23726: recipe for target 'stage2-bubble' failed

> make: *** [stage2-bubble] Error 2

Patch

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);
+    *dst_size = *src_size;
     ipa_update_overall_fn_summary (dst);
+  }
 }