From 5f1a9ebbc159cb2cad9605777f92e0c73f4cee76 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Fri, 4 Sep 2009 18:54:01 +0000 Subject: re PR middle-end/41257 (Bogus error '*.LTHUNK0' aliased to undefined symbol '_ZN1CD1Ev') 2009-09-04 Richard Guenther PR middle-end/41257 * (cgraph_finalize_compilation_unit): Move finalizing aliases after emitting tunks. Move emitting thunks and ctors from ... (cgraph_optimize): ... here. Remove redundant cgraph_analyze_functions. * varasm.c (find_decl_and_mark_needed): Remove no longer necessary check. (finish_aliases_1): Adjust check for thunk aliases. * g++.dg/torture/pr41257.C: New testcase. From-SVN: r151431 --- gcc/varasm.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'gcc/varasm.c') diff --git a/gcc/varasm.c b/gcc/varasm.c index d7f8611..864ab16 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -5395,13 +5395,7 @@ find_decl_and_mark_needed (tree decl, tree target) if (fnode) { - /* We can't mark function nodes as used after cgraph global info - is finished. This wouldn't generally be necessary, but C++ - virtual table thunks are introduced late in the game and - might seem like they need marking, although in fact they - don't. */ - if (! cgraph_global_info_ready) - cgraph_mark_needed_node (fnode); + cgraph_mark_needed_node (fnode); return fnode->decl; } else if (vnode) @@ -5571,7 +5565,7 @@ finish_aliases_1 (void) to bind locally. Of course this is a hack - to keep it working do the following (which is not strictly correct). */ && (! TREE_CODE (target_decl) == FUNCTION_DECL - || ! TREE_STATIC (target_decl)) + || ! DECL_VIRTUAL_P (target_decl)) && ! lookup_attribute ("weakref", DECL_ATTRIBUTES (p->decl))) error ("%q+D aliased to external symbol %qE", p->decl, p->target); -- cgit v1.1