aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2013-06-19 20:06:12 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2013-06-19 18:06:12 +0000
commit6a6dac5293ee21d9aed0d394a0cb23948bb1efad (patch)
tree1d4237222ae0ad0d8207eb6ee9f94b244ffae6e5 /gcc/ipa.c
parent216c12abf6eccbcf5c5ff1898e8b063a494af40c (diff)
downloadgcc-6a6dac5293ee21d9aed0d394a0cb23948bb1efad.zip
gcc-6a6dac5293ee21d9aed0d394a0cb23948bb1efad.tar.gz
gcc-6a6dac5293ee21d9aed0d394a0cb23948bb1efad.tar.bz2
cgraph.h (const_value_known_p): Replace by ...
* cgraph.h (const_value_known_p): Replace by ... (ctor_for_folding): .. this one. * cgraphunit.c (process_function_and_variable_attributes): Use it. * lto-cgraph.c (compute_ltrans_boundary): Use ctor_for_folding. * expr.c (expand_expr_real_1): Likewise. (string_constant): Likewise. * tree-ssa-loop-ivcanon.c (constant_after_peeling): Likewise. * ipa.c (process_references): Likewise. (symtab_remove_unreachable_nodes): Likewise. * ipa-inline-analysis.c (param_change_prob): Likewise. * gimple-fold.c (canonicalize_constructor_val): Likewise. (get_base_constructor): Likwise. * varpool.c (varpool_remove_node): Likewise. (varpool_remove_initializer): LIkewise. (dump_varpool_node): LIkwise. (const_value_known_p): Rewrite to ... (ctor_for_folding): ... this one. * lto-partition.c (add_references_to_partition): Use ctor_for_folding. * gcc.dg/tree-ssa/attr-alias-2.c: New testcase. From-SVN: r200211
Diffstat (limited to 'gcc/ipa.c')
-rw-r--r--gcc/ipa.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/ipa.c b/gcc/ipa.c
index 0f2a5c8..7c0d495 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -145,7 +145,9 @@ process_references (struct ipa_ref_list *list,
constant folding. Keep references alive so partitioning
knows about potential references. */
|| (TREE_CODE (node->symbol.decl) == VAR_DECL
- && flag_wpa && const_value_known_p (node->symbol.decl)))))
+ && flag_wpa
+ && ctor_for_folding (node->symbol.decl)
+ != error_mark_node))))
pointer_set_insert (reachable, node);
enqueue_node ((symtab_node) node, first, reachable);
}
@@ -400,6 +402,7 @@ symtab_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
}
else if (!pointer_set_contains (reachable, vnode))
{
+ tree init;
if (vnode->symbol.definition)
{
if (file)
@@ -411,8 +414,10 @@ symtab_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
vnode->symbol.aux = NULL;
/* Keep body if it may be useful for constant folding. */
- if (!const_value_known_p (vnode->symbol.decl))
+ if ((init = ctor_for_folding (vnode->symbol.decl)) == error_mark_node)
varpool_remove_initializer (vnode);
+ else
+ DECL_INITIAL (vnode->symbol.decl) = init;
ipa_remove_all_references (&vnode->symbol.ref_list);
}
else