* ipa.c (cgraph_address_taken_from_non_vtable_p): Check the ref type.
authorJan Hubicka <jh@suse.cz>
Tue, 14 Jun 2011 14:25:57 +0000 (16:25 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Tue, 14 Jun 2011 14:25:57 +0000 (14:25 +0000)
From-SVN: r175021

gcc/ChangeLog
gcc/ipa.c

index 0f06b436f7fd000f915fb0dc782a8c64acb0a219..80b7b1e8b0faae6ae99b694e37ed5537ec5aea3e 100644 (file)
@@ -1,3 +1,7 @@
+2011-06-13  Jan Hubicka  <jh@suse.cz>
+
+       * ipa.c (cgraph_address_taken_from_non_vtable_p): Check the ref type.
+
 2011-06-14  Richard Henderson  <rth@redhat.com>
 
        PR debug/48459
index 0edb344c5e577bc352db19201f149b756e0ca01a..62510c620df9b96870ee90598338f11e5b6cb575 100644 (file)
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -543,14 +543,15 @@ cgraph_address_taken_from_non_vtable_p (struct cgraph_node *node)
   int i;
   struct ipa_ref *ref;
   for (i = 0; ipa_ref_list_reference_iterate (&node->ref_list, i, ref); i++)
-    {
-      struct varpool_node *node;
-      if (ref->refered_type == IPA_REF_CGRAPH)
-       return true;
-      node = ipa_ref_varpool_node (ref);
-      if (!DECL_VIRTUAL_P (node->decl))
-       return true;
-    }
+    if (ref->use == IPA_REF_ADDR)
+      {
+       struct varpool_node *node;
+       if (ref->refered_type == IPA_REF_CGRAPH)
+         return true;
+       node = ipa_ref_varpool_node (ref);
+       if (!DECL_VIRTUAL_P (node->decl))
+         return true;
+      }
   return false;
 }