This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Update streaming code to use const_value_known
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 16 Sep 2010 23:28:13 +0200
- Subject: Update streaming code to use const_value_known
Hi,
while looking into streamer code I noticed that I forgot to update it whole introducing
const_value_known flag. Testing TREE_READONLY is also fine, but it leads us to stream
unnecesary many constructors.
Fixed thus. Boostrapped/regtested x86_64-linux, will commit it shortly.
Honza
* lto.c (lto_promote_cross_file_statics): Use const_value_known.
* lto-cgraph.c (compute_ltrans_boundary): Likewise.
Index: lto/lto.c
===================================================================
--- lto/lto.c (revision 164344)
+++ lto/lto.c (working copy)
@@ -1013,7 +1259,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 ((TREE_READONLY (vnode->decl) || DECL_IN_CONSTANT_POOL (vnode->decl))
+ if ((vnode->const_value_known || DECL_IN_CONSTANT_POOL (vnode->decl))
&& DECL_INITIAL (vnode->decl)
&& !varpool_node_in_set_p (vnode, vset)
&& referenced_from_this_partition_p (&vnode->ref_list, set, vset)
@@ -1053,7 +1299,7 @@ lto_promote_cross_file_statics (void)
&& !v->externally_visible && v->analyzed)
{
if (promote_var (v)
- && DECL_INITIAL (v->decl) && TREE_READONLY (v->decl)
+ && DECL_INITIAL (v->decl) && v->const_value_known
&& !pointer_set_insert (inserted, vnode))
VEC_safe_push (varpool_node_ptr, heap,
promoted_initializers, v);
Index: lto-cgraph.c
===================================================================
--- lto-cgraph.c (revision 164344)
+++ lto-cgraph.c (working copy)
@@ -814,7 +815,7 @@ compute_ltrans_boundary (struct lto_out_
&& !lto_varpool_encoder_encode_initializer_p (varpool_encoder,
vnode)
&& (DECL_IN_CONSTANT_POOL (vnode->decl)
- || TREE_READONLY (vnode->decl)))
+ || vnode->const_value_known))
{
lto_set_varpool_encoder_encode_initializer (varpool_encoder, vnode);
add_references (encoder, varpool_encoder, &vnode->ref_list);