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

2011-12-19 Thread Aldy Hernandez
Richard, Jason, are you ok with just unsetting DECL_WEAK? For now, yes. I will come up with a suitable testcase for Patrick's case. Once there's a testcase, we can figure out why the other patch didn't work. Jason Hi Jason. I have made a testcase from Patrick's, and am committing the p

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

2011-12-15 Thread Jason Merrill
On 12/15/2011 09:22 AM, Aldy Hernandez wrote: Richard, Jason, are you ok with just unsetting DECL_WEAK? For now, yes. I will come up with a suitable testcase for Patrick's case. Once there's a testcase, we can figure out why the other patch didn't work. Jason

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

2011-12-15 Thread Aldy Hernandez
Richard, Jason, are you ok with just unsetting DECL_WEAK? I will come up with a suitable testcase for Patrick's case. 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 ==

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

2011-12-14 Thread Patrick Marlier
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.

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

2011-12-14 Thread Aldy Hernandez
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_traitsIcESa

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

2011-12-13 Thread Patrick Marlier
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_DEC

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

2011-12-13 Thread Aldy Hernandez
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

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

2011-12-13 Thread Richard Henderson
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)) > -

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

2011-12-13 Thread Jason Merrill
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

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

2011-12-13 Thread Aldy Hernandez
On 12/13/11 14:42, Richard Henderson wrote: On 12/13/2011 12:41 PM, Aldy Hernandez wrote: The TM clone is marked weak as the original decl was weak, but it is no longer external or public. I suggested to just clear the DECL_WEAK bit on the clone, but Jason mentioned that unsetting DECL_EXTERN

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

2011-12-13 Thread Richard Henderson
On 12/13/2011 12:41 PM, Aldy Hernandez wrote: > The TM clone is marked weak as the original decl was weak, but it is no > longer external or public. I suggested to just clear the DECL_WEAK bit on > the clone, but Jason mentioned that unsetting DECL_EXTERNAL is more optimal-- > so that the clone

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

2011-12-13 Thread Aldy Hernandez
IPA's function_and_variable_visibility is dying, because for a C++ virtual inlined TM clone, we have zapped the DECL_EXTERNAL and TREE_PUBLIC bits while building the clone in ipa_tm_create_version. The assert fails here in function_and_variable_visibility(): gcc_assert ((!DECL_WEAK (node