diff options
author | Richard Guenther <rguenther@suse.de> | 2009-12-11 10:56:17 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2009-12-11 10:56:17 +0000 |
commit | 5d96330ac864e99e367c7ffcb88a685342a1e38c (patch) | |
tree | 73d4585314a2a4fb760d1416fc5ccc094be034d5 /gcc/lto-symtab.c | |
parent | f7dc4e3dc72e84cbce662e2635ae5eff52c311b2 (diff) | |
download | gcc-5d96330ac864e99e367c7ffcb88a685342a1e38c.zip gcc-5d96330ac864e99e367c7ffcb88a685342a1e38c.tar.gz gcc-5d96330ac864e99e367c7ffcb88a685342a1e38c.tar.bz2 |
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
Diffstat (limited to 'gcc/lto-symtab.c')
-rw-r--r-- | gcc/lto-symtab.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/lto-symtab.c b/gcc/lto-symtab.c index ab96b48..79eb3e4 100644 --- a/gcc/lto-symtab.c +++ b/gcc/lto-symtab.c @@ -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. */ |