+2005-03-18 Jan Hubicka <jh@suse.cz>
+
+ PR middle-end/20225
+ * cgraph.c (cgraph_mark_reachable_node): Assert that it is not called
+ too late.
+ * varasm.c (find_decl_and_mark_needed): Mark needed only when not
+ called too late.
+
2005-03-18 Kazu Hirata <kazu@cs.umass.edu>
* tree-into-ssa.c (find_idf): Use VEC_quick_push instead of
{
notice_global_symbol (node->decl);
node->reachable = 1;
+ gcc_assert (!cgraph_global_info_ready);
node->next_needed = cgraph_nodes_queue;
cgraph_nodes_queue = node;
struct cgraph_node *fnode = NULL;
struct cgraph_varpool_node *vnode = NULL;
- if (TREE_CODE (decl) == FUNCTION_DECL)
+ /* C++ thunk emitting code produces aliases late in the game.
+ Avoid confusing cgraph code in that case. */
+ if (!cgraph_global_info_ready)
{
- fnode = cgraph_node_for_asm (target);
- if (fnode == NULL)
- vnode = cgraph_varpool_node_for_asm (target);
- }
- else
- {
- vnode = cgraph_varpool_node_for_asm (target);
- if (vnode == NULL)
- fnode = cgraph_node_for_asm (target);
+ if (TREE_CODE (decl) == FUNCTION_DECL)
+ {
+ fnode = cgraph_node_for_asm (target);
+ if (fnode == NULL)
+ vnode = cgraph_varpool_node_for_asm (target);
+ }
+ else
+ {
+ vnode = cgraph_varpool_node_for_asm (target);
+ if (vnode == NULL)
+ fnode = cgraph_node_for_asm (target);
+ }
}
if (fnode)