summaryrefslogtreecommitdiff
path: root/gcc/ipa.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2013-06-19 18:06:12 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2013-06-19 18:06:12 +0000
commitdf8d3e8981a99e264b49876f0f5064bdb30ac981 (patch)
tree1d4237222ae0ad0d8207eb6ee9f94b244ffae6e5 /gcc/ipa.c
parenta90c63ff18562cb1fd4da12b68d74d9f5592f414 (diff)
downloadgcc-df8d3e8981a99e264b49876f0f5064bdb30ac981.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@200211 138bc75d-0d04-0410-961f-82ee72b054a4
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 0f2a5c8b424..7c0d495695b 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