Patchwork Fix PR49596

login
register
mail settings
Submitter Richard Guenther
Date July 1, 2011, 11:11 a.m.
Message ID <alpine.LNX.2.00.1107011310340.810@zhemvz.fhfr.qr>
Download mbox | patch
Permalink /patch/102894/
State New
Headers show

Comments

Richard Guenther - July 1, 2011, 11:11 a.m.
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.

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