------- Comment #21 from ian at airs dot com 2008-04-23 22:33 -------
A patch like this seems like a decent workaround to me.
Honza, any opinions on this approach?
Ian
Index: cgraph.c
===================================================================
--- cgraph.c (revision 134283)
+++ cgraph.c (working copy)
@@ -615,6 +615,14 @@ cgraph_remove_node (struct cgraph_node *
kill_body = true;
}
+ /* We don't release the body of abstract functions, because they may
+ be needed when emitting debugging information. In particular
+ this will happen for C++ constructors/destructors. FIXME:
+ Ideally we would check to see whether there are any reachable
+ functions whose DECL_ABSTRACT_ORIGIN points to this decl. */
+ if (DECL_ABSTRACT (node->decl))
+ kill_body = false;
+
if (kill_body && flag_unit_at_a_time)
cgraph_release_function_body (node);
node->decl = NULL;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27574