re PR lto/65380 ([ICF] LTO: ICE in add_symbol_to_partition_1, at lto/lto-partition...
authorJan Hubicka <hubicka@ucw.cz>
Thu, 19 Mar 2015 17:37:15 +0000 (18:37 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Thu, 19 Mar 2015 17:37:15 +0000 (17:37 +0000)
Fix PR ipa/65380.

PR ipa/65380
* ipa-icf.c (sem_function::merge): Do not merge DECL_EXTERNAL symbols.
(sem_variable::merge): Likewise.

From-SVN: r221519

gcc/ChangeLog
gcc/ipa-icf.c

index 86527011cea7c13d499e5a2e6c1c229fcf597fc6..d2528d1645b73cba10680270ff43cb7b5103d12e 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2015-03-19  Martin Liska  <mliska@suse.cz>
 
        PR ipa/65465
index f68d23cf4dc62d247fb8ac509afd100214c733e2..360cf17199cb2e4b2d6091c13e1e93da1efc2160 100644 (file)
@@ -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 ();