diff mbox

Fix PR49596

Message ID alpine.LNX.2.00.1107011310340.810@zhemvz.fhfr.qr
State New
Headers show

Commit Message

Richard Biener July 1, 2011, 11:11 a.m. UTC
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  <rguenther@suse.de>

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

Patch

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);
 }