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