http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53426

--- Comment #6 from Jan Hubicka <hubicka at ucw dot cz> 2012-05-22 12:19:55 UTC 
---
> by changing it to
> 
>           if (!vnode
>               || DECL_INITIAL (vnode) == error_mark_node
>               || !varpool_all_refs_explicit_p (vnode))
>             make_copy_constraint (vi, nonlocal_id);
> 
> also noting the special error_mark_node DECL_INITIAL (what's that coming
> from!?)

DECL_INITIAL is replaced by error mark when the variable is removed from
varpool
(so we know it is no longer going to be referenced or emit in some way) to
conserve
memory.

Other case is the partitioning, when the variable is in the other partition 
and thus there is no need to sream the DECL_INITIAL (we stream DECL_INITIAL for
variables from other partitions only when we think it may be useful for
constant
folding: that is variables passes const_value_known_p).  This is probably the
case
here.

If you only need to collect all things that escape, you can safely ignore
DECL_INITIAL of DECLs with in_ohter_partition set: all vars that are in current
partition referenced by the constructor from other partition
"used_from_other_partition" set anyway, so they won't pass
varpool_all_refs_explicit_p.

You only need to worry about local constructors.

Honza

Reply via email to