re PR c++/58678 (pykde4-4.11.2 link error (devirtualization too trigger happy))

PR c++/58678
	* ipa-devirt.c (ipa_devirt): Don't check DECL_COMDAT.

From-SVN: r215168
This commit is contained in:
Jason Merrill 2014-09-11 08:12:28 -04:00 committed by Jason Merrill
parent 8aed2f2f63
commit 89632536fc
3 changed files with 21 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2014-09-11 Jason Merrill <jason@redhat.com>
PR c++/58678
* ipa-devirt.c (ipa_devirt): Don't check DECL_COMDAT.
2014-09-11 Georg-Johann Lay <avr@gjlay.de>
PR target/63223

View File

@ -3952,8 +3952,7 @@ ipa_devirt (void)
/* Don't use an implicitly-declared destructor (c++/58678). */
struct cgraph_node *non_thunk_target
= likely_target->function_symbol ();
if (DECL_ARTIFICIAL (non_thunk_target->decl)
&& DECL_COMDAT (non_thunk_target->decl))
if (DECL_ARTIFICIAL (non_thunk_target->decl))
{
if (dump_file)
fprintf (dump_file, "Target is artificial\n\n");

View File

@ -0,0 +1,15 @@
// PR c++/58678
// { dg-options "-O3 -flto -shared -fPIC -Wl,--no-undefined" }
// { dg-do link { target { gld && fpic } } }
struct A {
virtual ~A();
};
struct B : A {
virtual int m_fn1();
};
void fn1(B* b) {
delete b;
}
int main() {}