Commit 5d96330a by Richard Guenther Committed by Richard Biener

re PR middle-end/42320 (link error with -flto (undefined reference to 'non-virtual thunk ...))

2009-12-11  Richard Guenther  <rguenther@suse.de>

	PR lto/42320
	* lto-symtab.c (lto_symtab_resolve_can_prevail_p): Properly
	detect non-prevailing decls.

	* g++.dg/lto/20091210-1_0.h: New testcase.
	* g++.dg/lto/20091210-1_0.C: Likewise.
	* g++.dg/lto/20091210-1_1.C: Likewise.

From-SVN: r155155
parent f7dc4e3d
2009-12-11 Richard Guenther <rguenther@suse.de>
PR lto/42320
* lto-symtab.c (lto_symtab_resolve_can_prevail_p): Properly
detect non-prevailing decls.
2009-12-10 Jakub Jelinek <jakub@redhat.com>
PR c++/42317
......@@ -371,7 +371,10 @@ lto_symtab_resolve_replaceable_p (lto_symtab_entry_t e)
static bool
lto_symtab_resolve_can_prevail_p (lto_symtab_entry_t e)
{
if (!TREE_STATIC (e->decl))
/* The C++ frontend ends up neither setting TREE_STATIC nor
DECL_EXTERNAL on virtual methods but only TREE_PUBLIC.
So do not reject !TREE_STATIC here but only DECL_EXTERNAL. */
if (DECL_EXTERNAL (e->decl))
return false;
/* For functions we need a non-discarded body. */
......
2009-12-11 Richard Guenther <rguenther@suse.de>
PR lto/42320
* g++.dg/lto/20091210-1_0.h: New testcase.
* g++.dg/lto/20091210-1_0.C: Likewise.
* g++.dg/lto/20091210-1_1.C: Likewise.
2009-12-10 Jakub Jelinek <jakub@redhat.com>
PR c++/42317
......
// { dg-lto-do link }
#include "20091210-1_0.h"
void Base::f() {}
struct Base1 {
virtual ~Base1() {}
};
struct Base2 {
virtual void f() = 0;
};
struct Base : Base1, Base2 {
virtual void f();
};
#include "20091210-1_0.h"
struct Foo : Base {
virtual void g();
};
void Foo::g() {}
int main() {}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment