diff options
author | Jan Hubicka <jh@suse.cz> | 2010-09-20 17:48:42 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2010-09-20 15:48:42 +0000 |
commit | 64e0f5ff1f3be1ddccc2a50cb371b5dce94124b1 (patch) | |
tree | 5dc2da773507a107b478346e98a80752893d9599 /gcc/lto | |
parent | 4ce9b2b20f34a82792df7e5dbb8c230e1cc29e45 (diff) | |
download | gcc-64e0f5ff1f3be1ddccc2a50cb371b5dce94124b1.zip gcc-64e0f5ff1f3be1ddccc2a50cb371b5dce94124b1.tar.gz gcc-64e0f5ff1f3be1ddccc2a50cb371b5dce94124b1.tar.bz2 |
re PR tree-optimization/45605 (Missed devirtualization)
PR tree-optimize/45605
* cgraph.h (const_value_known_p): Declare.
(varpool_decide_const_value_known): Remove.
* tree-ssa-ccp.c (get_base_constructor): Use it.
* lto-cgraph.c (compute_ltrans_boundary): Likewise.
* expr.c (string_constant): Likewise.
* tree-ssa-loop-ivcanon.c (constant_after_peeling): Likewise.
* ipa.c (ipa_discover_readonly_nonaddressable_var,
function_and_variable_visibility): Likewise.
* gimplify.c (gimplify_call_expr): Likewise.
* gimple-fold.c (get_symbol_constant_value): Likewise.
* varpool.c (varpool_decide_const_value_known): Replace by...
(const_value_known_p): ... this one; handle other kinds of DECLs
too and work for automatic vars.
(varpool_finalize_decl): Use const_value_known_p.
* lto.c (lto_promote_cross_file_statics): Use const_value_known_p.
* g++.dg/tree-ssa/pr45605.C: New testcase.
From-SVN: r164438
Diffstat (limited to 'gcc/lto')
-rw-r--r-- | gcc/lto/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/lto/lto.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 59124ee..6aab1af 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,8 @@ +2010-09-20 Jan Hubicka <jh@suse.cz> + + PR tree-optimize/45605 + * lto.c (lto_promote_cross_file_statics): Use const_value_known_p. + 2010-09-18 Gerald Pfeifer <gerald@pfeifer.com> * lto-elf.c (lto_obj_file_open): Also provide filename when diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index 40816e5..98a9387 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -1008,7 +1008,7 @@ lto_promote_cross_file_statics (void) from this partition that are not in this partition. This needs to be done recursively. */ for (vnode = varpool_nodes; vnode; vnode = vnode->next) - if ((vnode->const_value_known || DECL_IN_CONSTANT_POOL (vnode->decl)) + if (const_value_known_p (vnode->decl) && DECL_INITIAL (vnode->decl) && !varpool_node_in_set_p (vnode, vset) && referenced_from_this_partition_p (&vnode->ref_list, set, vset) |