Hi, this patch fixes an inconsistency seen in g++.dg/lto/20081125_0.C testcase where we have same body alias of dtor. The alias is DECL_VIRTUAL while the dtor itself is not. symtab_node::fixup_same_cpp_alias_visibility copies DECL_VIRTUAL_P from the alias target dropping the flag that is wrong.
I checked and the code copying flag was instroduced in https://gcc.gnu.org/ml/gcc-patches/2011-06/msg00903.html which was my initial commit implementing the same body aliases as real aliases. I have no recollection why the code is there but it is wrong (basically everything in symtab_node::fixup_same_cpp_alias_visibility is wrong and should be done by C++ FE instead, but this is more wrong in a sense of leading to a wrong code). Bootstrapped/regtested x86_64-linux, will commit it after re-testing with Firefox. Honza * symtab.c (symtab_node::fixup_same_cpp_alias_visibility): Do not copy DECL_VIRTUAL_P. Index: symtab.c =================================================================== --- symtab.c (revision 231581) +++ symtab.c (working copy) @@ -1363,7 +1363,6 @@ symtab_node::fixup_same_cpp_alias_visibi DECL_EXTERNAL (decl) = DECL_EXTERNAL (target->decl); DECL_VISIBILITY (decl) = DECL_VISIBILITY (target->decl); } - DECL_VIRTUAL_P (decl) = DECL_VIRTUAL_P (target->decl); if (TREE_PUBLIC (decl)) { tree group;