Message ID | 20140410132744.GC1817@tucnak.redhat.com |
---|---|
State | New |
Headers | show |
On 04/10/2014 09:27 AM, Jakub Jelinek wrote: > The following patch copies that flag in the C++ FE, another alternative > is to do that in cgraph_add_thunk function (apparently only called by > use_thunk, thus practically the same spot, or it can be done in > function_and_variable_visibility. I think Honza and I agreed yesterday to copy it in function_and_variable_visibility. Jason
--- gcc/cp/method.c.jj 2014-03-27 08:06:11.000000000 +0100 +++ gcc/cp/method.c 2014-04-10 12:06:42.691968389 +0200 @@ -387,6 +387,7 @@ use_thunk (tree thunk_fndecl, bool emit_ thunk_node = cgraph_add_thunk (funcn, thunk_fndecl, function, this_adjusting, fixed_offset, virtual_value, virtual_offset, alias); + thunk_node->forced_by_abi = funcn->forced_by_abi; if (DECL_ONE_ONLY (function)) symtab_add_to_same_comdat_group (thunk_node, funcn); --- gcc/testsuite/g++.dg/lto/pr60567_0.C.jj 2014-04-10 12:04:07.227797680 +0200 +++ gcc/testsuite/g++.dg/lto/pr60567_0.C 2014-04-10 12:06:18.063099605 +0200 @@ -0,0 +1,23 @@ +// PR lto/60567 +// { dg-lto-do link } +// { dg-lto-options { { -flto -fno-use-linker-plugin } } } +// { dg-extra-ld-options "-r -nostdlib" } + +#pragma implementation +struct S {}; + +#pragma interface +struct T +{ + virtual void foo (const S &) = 0; +}; + +struct U +{ + virtual void bar (const S &) = 0; +}; + +struct V : public T, public U +{ + virtual void bar (const S &) {} +};