From 64e0f5ff1f3be1ddccc2a50cb371b5dce94124b1 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Mon, 20 Sep 2010 17:48:42 +0200 Subject: 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 --- gcc/lto/ChangeLog | 5 +++++ gcc/lto/lto.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'gcc/lto') 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 + + PR tree-optimize/45605 + * lto.c (lto_promote_cross_file_statics): Use const_value_known_p. + 2010-09-18 Gerald Pfeifer * 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) -- cgit v1.1