diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-04-21 14:41:03 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-04-21 14:41:03 +0000 |
commit | e288c7a9d241b2ec4f17a2a9b3a058fc30c86725 (patch) | |
tree | 518cccaa543aa060a4a7880a9edcef6b9842add4 /gcc/lto | |
parent | f855a9b7ef29819b5a8ca64d0cbf4facce909c80 (diff) | |
download | gcc-e288c7a9d241b2ec4f17a2a9b3a058fc30c86725.tar.gz |
* lto.c (globalize_cross_file_statics): When function has address taken,
it needs to be public.
* varpool.c (decide_is_variable_needed): Variable is always needed
during ltrans.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158609 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto')
-rw-r--r-- | gcc/lto/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/lto/lto.c | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 9118e0045ea..a97314c928b 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,8 @@ +2010-04-21 Jan Hubicka <jh@suse.cz> + + * lto.c (globalize_cross_file_statics): When function has address taken, + it needs to be public. + 2010-04-20 Jan Hubicka <jh@suse.cz> * lto.c (lto_add_inline_clones): Do not track inlined_decls. diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index 1544f05ab4f..ea8f03a131d 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -760,7 +760,8 @@ globalize_cross_file_statics (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED, } else if (TREE_CODE (t) == FUNCTION_DECL && !TREE_PUBLIC (t)) { - if (!cgraph_node_in_set_p (cgraph_node (t), context->set)) + if (!cgraph_node_in_set_p (cgraph_node (t), context->set) + || cgraph_node (t)->address_taken) { /* This file-scope static function is reachable from a set which does not contain the function DECL. Make it global |