This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR49596
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 1 Jul 2011 13:11:41 +0200 (CEST)
- Subject: [PATCH] Fix PR49596
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.
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);
}