This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix PR ipa/65380


Hello.

This is fix for the issue as introduced by Honza. I've just finished testing on x86_64-linux-pc and
the patch is pre-approved by Honza.

Thanks,
Martin
>From f3c845d74b7a1edbbba9ecefa081feb58700d515 Mon Sep 17 00:00:00 2001
From: mliska <mliska@suse.cz>
Date: Thu, 19 Mar 2015 10:52:44 +0100
Subject: [PATCH] Fix PR ipa/65380.

gcc/ChangeLog:

2015-03-19  Jan Hubicka  <hubicka@ucw.cz>

	PR ipa/65380
	* ipa-icf.c (sem_function::merge): Do not merge DECL_EXTERNAL symbols.
	(sem_variable::merge): Likewise.
---
 gcc/ipa-icf.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c
index f68d23c..360cf17 100644
--- a/gcc/ipa-icf.c
+++ b/gcc/ipa-icf.c
@@ -814,6 +814,13 @@ sem_function::merge (sem_item *alias_item)
   bool original_address_matters = original->address_matters_p ();
   bool alias_address_matters = alias->address_matters_p ();
 
+  if (DECL_EXTERNAL (alias->decl))
+    {
+      if (dump_file)
+	fprintf (dump_file, "Not unifying; alias is external.\n\n");
+      return false;
+    }
+
   if (DECL_NO_INLINE_WARNING_P (original->decl)
       != DECL_NO_INLINE_WARNING_P (alias->decl))
     {
@@ -1776,6 +1783,13 @@ sem_variable::merge (sem_item *alias_item)
       return false;
     }
 
+  if (DECL_EXTERNAL (alias_item->decl))
+    {
+      if (dump_file)
+	fprintf (dump_file, "Not unifying; alias is external.\n\n");
+      return false;
+    }
+
   sem_variable *alias_var = static_cast<sem_variable *> (alias_item);
 
   varpool_node *original = get_node ();
-- 
2.1.2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]