Commit 90097c67 by Richard Guenther Committed by Richard Biener

re PR middle-end/41257 (Bogus error '*.LTHUNK0' aliased to undefined symbol '_ZN1CD1Ev')

2009-09-10  Richard Guenther  <rguenther@suse.de>

	PR middle-end/41257
	* cgraphunit.c (cgraph_emit_thunks): Emit thunks only for
	reachable nodes.
	(cgraph_finalize_compilation_unit): Compute reachability
	before emitting thunks.  Properly process aliases before
	possibly removing unreachable nodes.

	* g++.dg/torture/pr41257-2.C: New testcase.

From-SVN: r151592
parent c7a3980a
2009-09-10 Richard Guenther <rguenther@suse.de> 2009-09-10 Richard Guenther <rguenther@suse.de>
PR middle-end/41257
* cgraphunit.c (cgraph_emit_thunks): Emit thunks only for
reachable nodes.
(cgraph_finalize_compilation_unit): Compute reachability
before emitting thunks. Properly process aliases before
possibly removing unreachable nodes.
2009-09-10 Richard Guenther <rguenther@suse.de>
PR middle-end/41254 PR middle-end/41254
* tree.c (struct free_lang_data_d): Add worklist member. * tree.c (struct free_lang_data_d): Add worklist member.
(find_decls_types_r): Push onto the worklist instead of recursing. (find_decls_types_r): Push onto the worklist instead of recursing.
......
...@@ -1036,7 +1036,8 @@ cgraph_emit_thunks (void) ...@@ -1036,7 +1036,8 @@ cgraph_emit_thunks (void)
emitted, but we cannot know that until the inliner and other emitted, but we cannot know that until the inliner and other
IPA passes have run (see the sequencing of the call to IPA passes have run (see the sequencing of the call to
cgraph_mark_functions_to_output in cgraph_optimize). */ cgraph_mark_functions_to_output in cgraph_optimize). */
if (!DECL_EXTERNAL (n->decl)) if (n->reachable
&& !DECL_EXTERNAL (n->decl))
lang_hooks.callgraph.emit_associated_thunks (n->decl); lang_hooks.callgraph.emit_associated_thunks (n->decl);
} }
} }
...@@ -1047,35 +1048,45 @@ cgraph_emit_thunks (void) ...@@ -1047,35 +1048,45 @@ cgraph_emit_thunks (void)
void void
cgraph_finalize_compilation_unit (void) cgraph_finalize_compilation_unit (void)
{ {
timevar_push (TV_CGRAPH);
/* Do not skip analyzing the functions if there were errors, we /* Do not skip analyzing the functions if there were errors, we
miss diagnostics for following functions otherwise. */ miss diagnostics for following functions otherwise. */
/* Emit size functions we didn't inline. */ /* Emit size functions we didn't inline. */
finalize_size_functions (); finalize_size_functions ();
/* Emit thunks, if needed. */
if (lang_hooks.callgraph.emit_associated_thunks)
cgraph_emit_thunks ();
/* Call functions declared with the "constructor" or "destructor" /* Call functions declared with the "constructor" or "destructor"
attribute. */ attribute. */
cgraph_build_cdtor_fns (); cgraph_build_cdtor_fns ();
/* Mark alias targets necessary and emit diagnostics. */
finish_aliases_1 ();
if (!quiet_flag) if (!quiet_flag)
{ {
fprintf (stderr, "\nAnalyzing compilation unit\n"); fprintf (stderr, "\nAnalyzing compilation unit\n");
fflush (stderr); fflush (stderr);
} }
/* Gimplify and lower all functions, compute reachability and
remove unreachable nodes. */
cgraph_analyze_functions ();
/* Emit thunks for reachable nodes, if needed. */
if (lang_hooks.callgraph.emit_associated_thunks)
cgraph_emit_thunks ();
/* Mark alias targets necessary and emit diagnostics. */ /* Mark alias targets necessary and emit diagnostics. */
finish_aliases_1 (); finish_aliases_1 ();
/* Gimplify and lower all functions. */ /* Gimplify and lower thunks. */
timevar_push (TV_CGRAPH);
cgraph_analyze_functions (); cgraph_analyze_functions ();
timevar_pop (TV_CGRAPH);
/* Finally drive the pass manager. */
cgraph_optimize (); cgraph_optimize ();
timevar_pop (TV_CGRAPH);
} }
......
2009-09-10 Richard Guenther <rguenther@suse.de>
PR middle-end/41257
* g++.dg/torture/pr41257-2.C: New testcase.
2009-09-09 Paolo Carlini <paolo.carlini@oracle.com> 2009-09-09 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/28293 PR c++/28293
......
/* { dg-do link } */
struct A
{
virtual ~A();
};
struct B : virtual A
{
virtual ~B() {}
};
int main()
{
return 0;
}
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