diff options
author | Jan Hubicka <jh@suse.cz> | 2010-04-21 16:41:03 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2010-04-21 14:41:03 +0000 |
commit | c9945504c9d6e69b961da97948a5b7e40404f10b (patch) | |
tree | 518cccaa543aa060a4a7880a9edcef6b9842add4 /gcc | |
parent | e7cfce7152f1377ed2db53513f3b0259d8b88718 (diff) | |
download | gcc-c9945504c9d6e69b961da97948a5b7e40404f10b.zip gcc-c9945504c9d6e69b961da97948a5b7e40404f10b.tar.gz gcc-c9945504c9d6e69b961da97948a5b7e40404f10b.tar.bz2 |
lto.c (globalize_cross_file_statics): When function has address taken, it needs to be public.
* 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.
From-SVN: r158609
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/lto/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/lto/lto.c | 3 | ||||
-rw-r--r-- | gcc/varpool.c | 6 |
4 files changed, 18 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1fe4172..13ac239 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2010-04-21 Jan Hubicka <jh@suse.cz> + * varpool.c (decide_is_variable_needed): Variable is always needed + during ltrans. + +2010-04-21 Jan Hubicka <jh@suse.cz> + * opts.c (decode_options): Enable pure-const pass for whopr. 2010-04-21 Jan Hubicka <jh@suse.cz> diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 9118e00..a97314c 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 1544f05..ea8f03a 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 diff --git a/gcc/varpool.c b/gcc/varpool.c index a13742d..40decfc 100644 --- a/gcc/varpool.c +++ b/gcc/varpool.c @@ -230,6 +230,12 @@ varpool_reset_queue (void) bool decide_is_variable_needed (struct varpool_node *node, tree decl) { + /* We do not track variable references at all and thus have no idea if the + variable was referenced in some other partition or not. + FIXME: We really need address taken edges in callgraph and varpool to + drive WPA and decide whether other partition might reference it or not. */ + if (flag_ltrans) + return true; /* If the user told us it is used, then it must be so. */ if ((node->externally_visible && !DECL_COMDAT (decl)) || node->force_output) |