node->decl = decl;
node->order = cgraph_order++;
node->next = varpool_nodes;
+ ipa_empty_ref_list (&node->ref_list);
if (varpool_nodes)
varpool_nodes->prev = node;
varpool_nodes = node;
gcc_assert (varpool_nodes_queue == node);
varpool_nodes_queue = node->next_needed;
}
- if (DECL_INITIAL (node->decl))
- DECL_INITIAL (node->decl) = error_mark_node;
+ ipa_remove_all_references (&node->ref_list);
+ ipa_remove_all_refering (&node->ref_list);
ggc_free (node);
}
else if (node->used_from_other_partition)
fprintf (f, " used_from_other_partition");
fprintf (f, "\n");
+ fprintf (f, " References: ");
+ ipa_dump_references (f, &node->ref_list);
+ fprintf (f, " Refering this var: ");
+ ipa_dump_refering (f, &node->ref_list);
}
/* Dump the variable pool. */
}
/* Reset the queue of needed nodes. */
-static void
+void
varpool_reset_queue (void)
{
varpool_last_needed_node = NULL;
|| node->force_output)
return true;
- /* ??? If the assembler name is set by hand, it is possible to assemble
- the name later after finalizing the function and the fact is noticed
- in assemble_name then. This is arguably a bug. */
- if (DECL_ASSEMBLER_NAME_SET_P (decl)
- && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
- return true;
-
/* Externally visible variables must be output. The exception is
COMDAT variables that must be output only when they are needed. */
if (TREE_PUBLIC (decl)
if (node->needed)
varpool_enqueue_needed_node (node);
node->finalized = true;
+ if (TREE_THIS_VOLATILE (decl) || DECL_PRESERVE_P (decl))
+ node->force_output = true;
if (decide_is_variable_needed (node, decl))
varpool_mark_needed_node (node);
alias_node->alias = 1;
alias_node->extra_name = decl_node;
alias_node->next = decl_node->extra_name;
+ ipa_empty_ref_list (&alias_node->ref_list);
if (decl_node->extra_name)
decl_node->extra_name->prev = alias_node;
decl_node->extra_name = alias_node;