Message ID | 4EE7BA39.6050900@redhat.com |
---|---|
State | New |
Headers | show |
On 12/13/2011 03:48 PM, Aldy Hernandez wrote:
> Be that as it may, I gather this is what you want?
Yep, that's what I had in mind.
Jason
On 12/13/2011 12:48 PM, Aldy Hernandez wrote: > PR middle-end/51411 > * trans-mem.c (ipa_tm_create_version): Do not zap DECL_EXTERNAL. ... > /* ??? Is it worth trying to use make_decl_one_only? */ > if (DECL_DECLARED_INLINE_P (new_decl) && DECL_EXTERNAL (new_decl)) > - { > - DECL_EXTERNAL (new_decl) = 0; > - TREE_PUBLIC (new_decl) = 0; > - } > + DECL_EXTERNAL (new_decl) = 0; Yes, that's what we had in mind. Though of course the changelog doesn't match. r~
On 12/13/11 15:02, Richard Henderson wrote: > On 12/13/2011 12:48 PM, Aldy Hernandez wrote: >> PR middle-end/51411 >> * trans-mem.c (ipa_tm_create_version): Do not zap DECL_EXTERNAL. > ... >> /* ??? Is it worth trying to use make_decl_one_only? */ >> if (DECL_DECLARED_INLINE_P (new_decl)&& DECL_EXTERNAL (new_decl)) >> - { >> - DECL_EXTERNAL (new_decl) = 0; >> - TREE_PUBLIC (new_decl) = 0; >> - } >> + DECL_EXTERNAL (new_decl) = 0; > > Yes, that's what we had in mind. Though of course the changelog doesn't match. > > > r~ Ok, my English typing privileges have been revoked until further notice. I'm obviously typing cross-eyed right now. Here's what I have, but keep in mind that I'm going to watch Sesame Street so I'll be away from my keyboard for a few hours... PR middle-end/51411 * trans-mem.c (ipa_tm_create_version): Do not zap TREE_PUBLIC.
On 12/13/2011 04:04 PM, Aldy Hernandez wrote: > On 12/13/11 15:02, Richard Henderson wrote: >> On 12/13/2011 12:48 PM, Aldy Hernandez wrote: >>> PR middle-end/51411 >>> * trans-mem.c (ipa_tm_create_version): Do not zap DECL_EXTERNAL. >> ... >>> /* ??? Is it worth trying to use make_decl_one_only? */ >>> if (DECL_DECLARED_INLINE_P (new_decl)&& DECL_EXTERNAL (new_decl)) >>> - { >>> - DECL_EXTERNAL (new_decl) = 0; >>> - TREE_PUBLIC (new_decl) = 0; >>> - } >>> + DECL_EXTERNAL (new_decl) = 0; >> >> Yes, that's what we had in mind. Though of course the changelog >> doesn't match. >> >> >> r~ > > Ok, my English typing privileges have been revoked until further notice. > I'm obviously typing cross-eyed right now. > > Here's what I have, but keep in mind that I'm going to watch Sesame > Street so I'll be away from my keyboard for a few hours... > > PR middle-end/51411 > * trans-mem.c (ipa_tm_create_version): Do not zap TREE_PUBLIC. > This causes multiple definitions. Extract of output with velox/glob2 benchmark: src/AINicowar.o: In function `_ZGTtNSsD2Ev': ./include/c++/4.7.0/bits/basic_string.h:535: multiple definition of `_ZGTtNSsD2Ev' src/AICastor.o:./include/c++/4.7.0/bits/basic_string.h:535: first defined here src/AINicowar.o: In function `_ZGTtNKSs13get_allocatorEv': ./include/c++/4.7.0/bits/basic_string.h:1814: multiple definition of `_ZGTtNKSs13get_allocatorEv' src/AICastor.o:./include/c++/4.7.0/bits/basic_string.h:1814: first defined here src/AINicowar.o: In function `_ZGTtNKSs6_M_repEv': ./include/c++/4.7.0/bits/basic_string.h:297: multiple definition of `_ZGTtNKSs6_M_repEv' src/AICastor.o:./include/c++/4.7.0/bits/basic_string.h:297: first defined here src/AINicowar.o: In function `_ZGTtNSs4_Rep10_M_disposeERKSaIcE': ./include/c++/4.7.0/bits/basic_string.h:234: multiple definition of `_ZGTtNSs4_Rep10_M_disposeERKSaIcE' src/AICastor.o:./include/c++/4.7.0/bits/basic_string.h:234: first defined here src/AINicowar.o: In function `_ZGTtNSaIcED2Ev': ./include/c++/4.7.0/bits/allocator.h:112: multiple definition of `_ZGTtNSaIcED1Ev' src/AICastor.o:./include/c++/4.7.0/bits/allocator.h:112: first defined here src/AINicowar.o: In function `_ZGTtNSaIcEC2ERKS_': ./include/c++/4.7.0/bits/allocator.h:106: multiple definition of `_ZGTtNSaIcEC1ERKS_' ... Without the patch, it is ok. If I remove completely this part: if (DECL_DECLARED_INLINE_P (new_decl) && DECL_EXTERNAL (new_decl)) { DECL_EXTERNAL (new_decl) = 0; TREE_PUBLIC (new_decl) = 0; } It ends with *only* one undefined symbol: src/UnitsSkins.o: In function `_ZGTtStltIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_': ./include/c++/4.7.0/bits/basic_string.h:2568: undefined reference to `_ZGTtNKSs7compareERKSs' $ c++filt _ZNKSs7compareERKSs std::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const I am not sure the way to give you useful information. Patrick.
Index: testsuite/g++.dg/tm/pr51411.C =================================================================== --- testsuite/g++.dg/tm/pr51411.C (revision 0) +++ testsuite/g++.dg/tm/pr51411.C (revision 0) @@ -0,0 +1,7 @@ +// { dg-do compile } +// { dg-options "-fgnu-tm -O" } + +struct A +{ + __attribute__ ((transaction_safe)) virtual void virtfoo () { } +}; Index: trans-mem.c =================================================================== --- trans-mem.c (revision 182290) +++ trans-mem.c (working copy) @@ -4256,10 +4256,7 @@ ipa_tm_create_version (struct cgraph_nod /* Remap extern inline to static inline. */ /* ??? Is it worth trying to use make_decl_one_only? */ if (DECL_DECLARED_INLINE_P (new_decl) && DECL_EXTERNAL (new_decl)) - { - DECL_EXTERNAL (new_decl) = 0; - TREE_PUBLIC (new_decl) = 0; - } + DECL_EXTERNAL (new_decl) = 0; tree_function_versioning (old_decl, new_decl, NULL, false, NULL, NULL, NULL);