summaryrefslogtreecommitdiff
path: root/gcc/varpool.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2010-05-12 15:49:34 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2010-05-12 13:49:34 +0000
commitb34fd25c83e4a098405b5d520a260fb3ac32b14e (patch)
tree8ecab4363a29f5b524dad95f3f7d8676be43b1c6 /gcc/varpool.c
parent49f19b1cfcccac7b821d14db46afeb323f56a87d (diff)
downloadgcc-b34fd25c83e4a098405b5d520a260fb3ac32b14e.tar.gz
cgraph.h (struct varpool_node): Add aux.
* cgraph.h (struct varpool_node): Add aux. * varasm.c (find_decl_and_mark_needed): Force output of varpool nodes. * varpool.c (varpool_remove_node): Do not remove initializer. (varpool_reset_queue): Export. (varpool_finalize_decl): Volatile vars are forced to be output. * lto-symtab.c (lto_varpool_replace_node): Clear out initializer of replaced decl. * ipa.c (enqueue_cgraph_node, enqueue_varpool_node, process_references, varpool_can_remove_if_no_refs): New functions. (cgraph_remove_unreachable_nodes): Handle variables too. From-SVN: r159321
Diffstat (limited to 'gcc/varpool.c')
-rw-r--r--gcc/varpool.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/varpool.c b/gcc/varpool.c
index a540d035a7e..39a6565842a 100644
--- a/gcc/varpool.c
+++ b/gcc/varpool.c
@@ -196,8 +196,6 @@ varpool_remove_node (struct varpool_node *node)
}
ipa_remove_all_references (&node->ref_list);
ipa_remove_all_refering (&node->ref_list);
- if (DECL_INITIAL (node->decl))
- DECL_INITIAL (node->decl) = error_mark_node;
ggc_free (node);
}
@@ -302,7 +300,7 @@ varpool_mark_needed_node (struct varpool_node *node)
}
/* Reset the queue of needed nodes. */
-static void
+void
varpool_reset_queue (void)
{
varpool_last_needed_node = NULL;
@@ -383,6 +381,8 @@ varpool_finalize_decl (tree decl)
if (node->needed)
varpool_enqueue_needed_node (node);
node->finalized = true;
+ if (TREE_THIS_VOLATILE (decl))
+ node->force_output = true;
if (decide_is_variable_needed (node, decl))
varpool_mark_needed_node (node);