public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Fix comdat unsharing
@ 2011-06-14 14:56 Jan Hubicka
  2011-06-16 15:54 ` H.J. Lu
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Hubicka @ 2011-06-14 14:56 UTC (permalink / raw)
  To: gcc-patches

Hi,
cgraph_address_taken_from_non_vtable_p was written with asumption that all references to functions
take addresses.  This is not true for aliases.

Bootstrapped/regtested x86_64-linux, comitted.

Honza

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 175020)
+++ ChangeLog	(working copy)
@@ -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: ipa.c
===================================================================
--- ipa.c	(revision 175015)
+++ ipa.c	(working copy)
@@ -543,14 +543,15 @@ cgraph_address_taken_from_non_vtable_p (
   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;
 }
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Fix comdat unsharing
  2011-06-14 14:56 Fix comdat unsharing Jan Hubicka
@ 2011-06-16 15:54 ` H.J. Lu
  0 siblings, 0 replies; 2+ messages in thread
From: H.J. Lu @ 2011-06-16 15:54 UTC (permalink / raw)
  To: Jan Hubicka; +Cc: gcc-patches

On Tue, Jun 14, 2011 at 7:27 AM, Jan Hubicka <hubicka@ucw.cz> wrote:
> Hi,
> cgraph_address_taken_from_non_vtable_p was written with asumption that all references to functions
> take addresses.  This is not true for aliases.
>
> Bootstrapped/regtested x86_64-linux, comitted.
>
> Honza
>
> Index: ChangeLog
> ===================================================================
> --- ChangeLog   (revision 175020)
> +++ ChangeLog   (working copy)
> @@ -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>
>

This caused:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49439


-- 
H.J.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-16 15:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-14 14:56 Fix comdat unsharing Jan Hubicka
2011-06-16 15:54 ` H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).