From d2640c430fcce5cd42c60f361eb3f0ac1a048a48 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Tue, 14 Jun 2011 16:25:57 +0200 Subject: [PATCH] * ipa.c (cgraph_address_taken_from_non_vtable_p): Check the ref type. From-SVN: r175021 --- gcc/ChangeLog | 4 ++++ gcc/ipa.c | 17 +++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0f06b436f7f..80b7b1e8b0f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2011-06-13 Jan Hubicka + + * ipa.c (cgraph_address_taken_from_non_vtable_p): Check the ref type. + 2011-06-14 Richard Henderson PR debug/48459 diff --git a/gcc/ipa.c b/gcc/ipa.c index 0edb344c5e5..62510c620df 100644 --- 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; } -- 2.30.2