This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ipa/61659] [4.9/4.10 Regression] Extra undefined symbol because of devirtualization
- From: "hubicka at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 30 Jun 2014 17:15:15 +0000
- Subject: [Bug ipa/61659] [4.9/4.10 Regression] Extra undefined symbol because of devirtualization
- Auto-submitted: auto-generated
- References: <bug-61659-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61659
Jan Hubicka <hubicka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at redhat dot com
--- Comment #7 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Jason, it seems that the symbol in question is getting into symtab as:
_ZN6parserIiE9getOptionEv/21 (void parser<DataType>::getOption() [with DataType
= int]) @0x7ffff6c665c0
Type: function
Visibility: external public virtual
References:
Referring:
Availability: not_available
First run: 0
Function flags:
Called by: _ZN4list19getExtraOptionNamesEv/1 (1.00 per call) (can throw
external)
Calls:
I think it should be declared comdat that would make us to output the body.
Perhaps it somehow misses import/export decl?
The devirtualization happens as part of normal folding in early inline. We
inline:
void generic_parser_base::getExtraOptionNames() (struct generic_parser_base *
const this)
{
int (*__vtbl_ptr_type) () * _3;
int (*__vtbl_ptr_type) () _4;
<bb 2>:
_3 = this_2(D)->_vptr.generic_parser_base;
_4 = *_3;
OBJ_TYPE_REF(_4;(struct generic_parser_base)this_2(D)->0) (this_2(D));
return;
}
to
virtual void list::getExtraOptionNames() (struct list * const this)
{
struct generic_parser_base * _2;
<bb 2>:
_2 = &this_1(D)->Parser.D.2262.D.2251;
generic_parser_base::getExtraOptionNames (_2);
return;
}
this makes base type known and given the visibility we just fold it.