This fixes the fallout of the IPA PTA patch.  The 
varpool_all_refs_explicit_p predicate does not properly give answers
for external variables.  Fixed as follows, pre-approved by Honza on IRC.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.

Richard.

2011-07-01  Richard Guenther  <rguent...@suse.de>

        PR middle-end/49596
        * cgraph.h (varpool_all_refs_explicit_p): Not analyzed nodes
        may have unknown refs.

Index: gcc/cgraph.h
===================================================================
--- gcc/cgraph.h        (revision 175749)
+++ gcc/cgraph.h        (working copy)
@@ -947,7 +947,8 @@ varpool_can_remove_if_no_refs (struct va
 static inline bool
 varpool_all_refs_explicit_p (struct varpool_node *vnode)
 {
-  return (!vnode->externally_visible
+  return (vnode->analyzed
+         && !vnode->externally_visible
          && !vnode->used_from_other_partition
          && !vnode->force_output);
 }

Reply via email to