This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PR middle-end/51411: handle transaction_safe virtual inlined methods


On 12/14/2011 07:56 AM, Aldy Hernandez wrote:

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.

This is actually good, because we were missing a testcase for the original patch that zapped DECL_EXTERNAL and TREE_PUBLIC. Do you mind reducing a testcase for me so we don't regress with this patch? I know it'll be a bit challenging...

See attached. Probably not completely reduced...
A call to _ZGTtNKSs7compareERKSs is done but the clone is not created (the original function _ZNKSs7compareERKSs is defined in libstdc++). I am not sure how to add the rule for the testsuite.


Perhaps we can try unsetting (hee hee hee) DECL_WEAK as originally
proposed. Does this fix your problem?

Yep it does! ;)


Patrick.


Index: trans-mem.c =================================================================== --- trans-mem.c (revision 182290) +++ trans-mem.c (working copy) @@ -4259,6 +4259,7 @@ ipa_tm_create_version (struct cgraph_nod { DECL_EXTERNAL (new_decl) = 0; TREE_PUBLIC (new_decl) = 0; + DECL_WEAK (new_decl) = 0; }

tree_function_versioning (old_decl, new_decl, NULL, false, NULL,

Attachment: _ZGTtNKSs7compareERKSs.i
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]