[Bug gold/12919] icf fails to fold one of the component of std::sort
http://sourceware.org/bugzilla/show_bug.cgi?id=12919 Ian Lance Taylor changed: What|Removed |Added Summary|icf falis to fold one of|icf fails to fold one of |the component of std::sort |the component of std::sort -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug gold/12919] icf fails to fold one of the component of std::sort
http://sourceware.org/bugzilla/show_bug.cgi?id=12919 Sriraman Tallam changed: What|Removed |Added AssignedTo|ian at airs dot com |tmsriram at google dot com -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug gold/12919] icf fails to fold one of the component of std::sort
http://sourceware.org/bugzilla/show_bug.cgi?id=12919 --- Comment #1 from Vincenzo Innocente 2011-09-21 16:50:18 UTC --- any news on a solution of this kind of problem? -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug gold/12919] icf fails to fold one of the component of std::sort
http://sourceware.org/bugzilla/show_bug.cgi?id=12919 --- Comment #2 from Sriraman Tallam 2011-09-21 16:52:53 UTC --- Sorry, I did not get a chance to look at this yet. I will take a look at it this week. Thanks, -Sri. On Wed, Sep 21, 2011 at 9:50 AM, vincenzo.innocente at cern dot ch wrote: > http://sourceware.org/bugzilla/show_bug.cgi?id=12919 > > --- Comment #1 from Vincenzo Innocente > 2011-09-21 16:50:18 UTC --- > any news on a solution of this kind of problem? > > -- > Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email > --- You are receiving this mail because: --- > You are on the CC list for the bug. > You are the assignee for the bug. > -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug gold/12919] icf fails to fold one of the component of std::sort
http://sourceware.org/bugzilla/show_bug.cgi?id=12919 Sriraman Tallam changed: What|Removed |Added CC||iant at google dot com --- Comment #3 from Sriraman Tallam 2011-09-21 18:57:08 UTC --- It is about pre-emptible symbols and libstdcxx makes namespace std as visiblity default. It is working as intended. Let me explain with an example first. If you have two functions foo and bar, calling zip and zap. If foo and bar are in a shared object and exported in the dynamic symbol table, it is not correct to fold foo and bar even though zip and zap get folded. Simple reason, zip and zap can be pre-empted by another definition in the executable. So, the ICF algorithm would only fold foo and bar if they both called functions with the same name. Here, the 3 introsort_loop functions essentially point to different move_median* functions (the functions differ in their names), for A, B and C. The move_median functions themselves get folded, but since they are exported, icf thinks they can be pre-empted and in theory they can. So, it will not fold the introsort_loop functions. However, if you were to link this into an executable, the introsort_loop functions would be folded. However, pre-emption of these functions maybe never happens in practice. So, I could add a flag to icf that disables preemption and the introsort_loop functions would be folded. I am not sure if this is the right thing to do. -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug gold/12919] icf fails to fold one of the component of std::sort
http://sourceware.org/bugzilla/show_bug.cgi?id=12919 --- Comment #4 from Sriraman Tallam 2011-09-21 18:58:03 UTC --- It is about pre-emptible symbols and libstdcxx makes namespace std as visiblity default. It is working as intended. Let me explain with an example first. If you have two functions foo and bar, calling zip and zap. If foo and bar are in a shared object and exported in the dynamic symbol table, it is not correct to fold foo and bar even though zip and zap get folded. Simple reason, zip and zap can be pre-empted by another definition in the executable. So, the ICF algorithm would only fold foo and bar if they both called functions with the same name. Here, the 3 introsort_loop functions essentially point to different move_median* functions (the functions differ in their names), for A, B and C. The move_median functions themselves get folded, but since they are exported, icf thinks they can be pre-empted and in theory they can. So, it will not fold the introsort_loop functions. However, if you were to link this into an executable, the introsort_loop functions would be folded. However, pre-emption of these functions maybe never happens in practice. So, I could add a flag to icf that disables preemption and the introsort_loop functions would be folded. I am not sure if this is the right thing to do. -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug gold/12919] icf fails to fold one of the component of std::sort
http://sourceware.org/bugzilla/show_bug.cgi?id=12919 Ian Lance Taylor changed: What|Removed |Added CC||ian at airs dot com --- Comment #5 from Ian Lance Taylor 2011-09-21 19:55:58 UTC --- I think you actually could combine functions within a .so. Although the symbols are preemptible, if one of them is actually preempted, it will be done by redirecting the PLT entry. So as long as you provide separate PLT entries for each symbol, you could arrange for all the PLT entries to point, by default, to the same code. -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug gold/12919] icf fails to fold one of the component of std::sort
http://sourceware.org/bugzilla/show_bug.cgi?id=12919 --- Comment #6 from Vincenzo Innocente 2011-09-21 19:58:07 UTC --- Thanks for the detailed analysis that indeed makes sense in the general case. In this specific example introsort_loop is not inlined just for choice of a gcc heuristics. My understanding was that with -fvisibility-inlines-hidden I made the 3 move_median_first and the 3 introsort_loop functions "internals" to the library and therefore neither visible nor preempt-able. maybe they need to be declared "inline" in gcc or even "hidden"? In any case I do not think that they are ment to be preempt-able! -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug gold/12919] icf fails to fold one of the component of std::sort
http://sourceware.org/bugzilla/show_bug.cgi?id=12919 --- Comment #7 from Sriraman Tallam 2011-09-21 21:25:45 UTC --- The std namespace is marked explicity with default visibility. So, these symbols are exported no matter what. If you do hide those symbols the folding will work. -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug gold/12919] icf fails to fold one of the component of std::sort
http://sourceware.org/bugzilla/show_bug.cgi?id=12919 Paolo Carlini changed: What|Removed |Added CC||pcarlini at gmail dot com -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug gold/12919] icf fails to fold one of the component of std::sort
http://sourceware.org/bugzilla/show_bug.cgi?id=12919 --- Comment #8 from Vincenzo Innocente 2011-09-22 08:13:26 UTC --- I made few more tests: adding inline keyword to __introsort in stl_algo.h makes no difference even if -fvisibility-inlines-hidden is used. nm -C libbha.so | sort | grep introsort 2190 W void std::__introsort_loop<__gnu_cxx::__normal_iterator > >, long>(__gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator > >, long) 2a10 W void std::__introsort_loop<__gnu_cxx::__normal_iterator > >, long>(__gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator > >, long) 3290 W void std::__introsort_loop<__gnu_cxx::__normal_iterator > >, long>(__gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator > >, long) what (with gcc 4.7, I think should be the same with 4.6.1) seems to work is -flto with "inline" added the three introsort are now folded c++ -flto -O2 -Wl,--icf=all,--print-icf-sections -shared -fPIC -fvisibility-inlines-hidden -ffunction-sections ICFproblem.cpp -o libbha.so nm -C libbha.so | sort | grep introsort 2210 t _ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPP1ASt6vectorIS3_SaIS3_lEvT_S9_T0_.local.43 2210 t _ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPP1BSt6vectorIS3_SaIS3_lEvT_S9_T0_.local.29 2210 t _ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPP1CSt6vectorIS3_SaIS3_lEvT_S9_T0_.local.15 funny enough w/o inline (original std_algo.h) there is just one symbol explicitly generated nm -C libbha.so | sort | grep introsort 09f0 t _ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPP1CSt6vectorIS3_SaIS3_lEvT_S9_T0_.local.15.2431 btw we need to make c++filt understanding "local" symbols :-( echo _ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPP1CSt6vectorIS3_SaIS3_lEvT_S9_T0_ | c++filt void std::__introsort_loop<__gnu_cxx::__normal_iterator > >, long>(__gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator > >, long) I will iterate with GCC folks on this. In any case, I support Ian's proposal to have, for .so libraries, just independent PLT entries and fold the "internal" ones. -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug gold/12919] icf fails to fold one of the component of std::sort
http://sourceware.org/bugzilla/show_bug.cgi?id=12919 --- Comment #9 from Vincenzo Innocente 2011-09-22 10:29:29 UTC --- I tried to add __attribute__ ((visibility ("hidden"))) to __introsort_loop no folding either even if now the symbol is "t" not "W". c++ -O2 -Wl,--icf=all,--print-icf-sections -shared -fPIC -fvisibility-inlines-hidden -ffunction-sections ICFproblem.cpp -o libbha.so nm -C libbha.so | grep intro 1fa0 t void std::__introsort_loop<__gnu_cxx::__normal_iterator > >, long>(__gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator > >, long) 2230 t void std::__introsort_loop<__gnu_cxx::__normal_iterator > >, long>(__gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator > >, long) 24c0 t void std::__introsort_loop<__gnu_cxx::__normal_iterator > >, long>(__gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator > >, long) -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug gold/12919] icf fails to fold one of the component of std::sort
http://sourceware.org/bugzilla/show_bug.cgi?id=12919 --- Comment #10 from Sriraman Tallam 2011-09-22 17:48:57 UTC --- On Thu, Sep 22, 2011 at 3:29 AM, vincenzo.innocente at cern dot ch wrote: > http://sourceware.org/bugzilla/show_bug.cgi?id=12919 > > --- Comment #9 from Vincenzo Innocente > 2011-09-22 10:29:29 UTC --- > I tried to add __attribute__ ((visibility ("hidden"))) to __introsort_loop > no folding either even if now the symbol is "t" not "W". Isn't it the case that __introsort_loop has references to pre-emptible functions like move_median*. So, it is important to make the referenced functions hidden than making introsort_loop itself hidden. It does not matter that introsort_loop is hidden or not. Now, it is the case that a hidden function in a shared object calls a pre-emptible function, right? Which means, the behaviour of the hidden function can still be changed by providing new definitions for the pre-emptible functions. > > > c++ -O2 -Wl,--icf=all,--print-icf-sections -shared -fPIC > -fvisibility-inlines-hidden -ffunction-sections ICFproblem.cpp -o libbha.so > > nm -C libbha.so | grep intro > 1fa0 t void > std::__introsort_loop<__gnu_cxx::__normal_iterator std::vector > >, > long>(__gnu_cxx::__normal_iterator std::vector > >, __gnu_cxx::__normal_iterator std::vector > >, long) > 2230 t void > std::__introsort_loop<__gnu_cxx::__normal_iterator std::vector > >, > long>(__gnu_cxx::__normal_iterator std::vector > >, __gnu_cxx::__normal_iterator std::vector > >, long) > 24c0 t void > std::__introsort_loop<__gnu_cxx::__normal_iterator std::vector > >, > long>(__gnu_cxx::__normal_iterator std::vector > >, __gnu_cxx::__normal_iterator std::vector > >, long) > > -- > Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email > --- You are receiving this mail because: --- > You are on the CC list for the bug. > You are the assignee for the bug. > -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug gold/12919] icf fails to fold one of the component of std::sort
http://sourceware.org/bugzilla/show_bug.cgi?id=12919 --- Comment #11 from Vincenzo Innocente 2011-09-23 11:15:33 UTC --- Indeed there is a long chain of function calls. So I removed the visibility from the namespace in stl_algo.h namespace std /* _GLIBCXX_VISIBILITY(default) */ and c++ -O2 -Wl,--icf=all,--print-icf-sections -shared -fPIC -fvisibility-inlines-hidden -ffunction-sections ICFproblem.cpp -o libbha.so -fno-inline -fvisibility=hidden no folding of the sorting stuff (even if now its all LOCAL HIDDEN) readelf -sW libbha.so | grep -v UND | c++filt | grep move_median 80: 43b0 149 FUNCLOCAL HIDDEN11 void std::__move_median_first<__gnu_cxx::__normal_iterator > > >(__gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator > >) 89: 4d60 149 FUNCLOCAL HIDDEN11 void std::__move_median_first<__gnu_cxx::__normal_iterator > > >(__gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator > >) 98: 56e0 149 FUNCLOCAL HIDDEN11 void std::__move_median_first<__gnu_cxx::__normal_iterator > > >(__gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator > >) [vinavx0] ~/public/ctest $ readelf -sW libbha.so | grep -v UND | c++filt | grep introsort 83: 4560 120 FUNCLOCAL HIDDEN11 void std::__introsort_loop<__gnu_cxx::__normal_iterator > >, long>(__gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator > >, long) 92: 4f10 120 FUNCLOCAL HIDDEN11 void std::__introsort_loop<__gnu_cxx::__normal_iterator > >, long>(__gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator > >, long) 101: 5890 120 FUNCLOCAL HIDDEN11 void std::__introsort_loop<__gnu_cxx::__normal_iterator > >, long>(__gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator > >, long) p.s. made void __attribute__ ((visibility ("default"))) go() in ICFproblem.cpp -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug gold/12919] icf fails to fold one of the component of std::sort
http://sourceware.org/bugzilla/show_bug.cgi?id=12919 --- Comment #12 from Vincenzo Innocente 2011-10-16 17:55:33 UTC --- apparently one can configure gcc "--disable-visibility" that will essentially remove the default visibility from namespace std w/o any other side-effect. I tried and indeed now everything fold together nicely as you can see below. I will continue to experiment with this option 13d0 t void std::__insertion_sort<__gnu_cxx::__normal_iterator > > >(__gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator > >) 13d0 t void std::__insertion_sort<__gnu_cxx::__normal_iterator > > >(__gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator > >) 13d0 t void std::__insertion_sort<__gnu_cxx::__normal_iterator > > >(__gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator > >) 1480 t void std::__final_insertion_sort<__gnu_cxx::__normal_iterator > > >(__gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator > >) 1480 t void std::__final_insertion_sort<__gnu_cxx::__normal_iterator > > >(__gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator > >) 1480 t void std::__final_insertion_sort<__gnu_cxx::__normal_iterator > > >(__gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator > >) 1510 t void std::__move_median_first<__gnu_cxx::__normal_iterator > > >(__gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator > >) 1510 t void std::__move_median_first<__gnu_cxx::__normal_iterator > > >(__gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator > >) 1510 t void std::__move_median_first<__gnu_cxx::__normal_iterator > > >(__gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator > >) -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug gold/12919] icf fails to fold one of the component of std::sort
http://sourceware.org/bugzilla/show_bug.cgi?id=12919 Vincenzo Innocente changed: What|Removed |Added Status|NEW |RESOLVED Resolution||INVALID --- Comment #13 from Vincenzo Innocente 2011-10-17 07:45:23 UTC --- No action required on the gold side, was a visibility issue in gcc. -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils