2010-05-11 Jan Hubicka <jh@suse.cz>
* cgraphbuild.c (cgraph_rebuild_references): New.
- (cgraph_mark_reachable_node): Accept references to optimized out
- extern inlines.
+ * cgraph.c (cgraph_mark_reachable_node): Accept references to optimized
+ out extern inlines.
* cgraph.h (cgraph_rebuild_references): Declare.
* tree-inline.c (tree_function_versioning): Use it.
* ipa-struct-reorg.c (do_reorg_for_func): Likewise.
{
if (!node->reachable && node->local.finalized)
{
- notice_global_symbol (node->decl);
+ if (cgraph_global_info_ready)
+ {
+ /* Verify that function does not appear to be needed out of blue
+ during the optimization process. This can happen for extern
+ inlines when bodies was removed after inlining. */
+ gcc_assert ((node->analyzed || DECL_EXTERNAL (node->decl)));
+ }
+ else
+ notice_global_symbol (node->decl);
node->reachable = 1;
- gcc_assert (!cgraph_global_info_ready);
node->next_needed = cgraph_nodes_queue;
cgraph_nodes_queue = node;