]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR lto/61012 (lto1: errors during merging of translation units (error: variable...
authorJan Hubicka <hubicka@ucw.cz>
Thu, 22 May 2014 05:38:04 +0000 (07:38 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Thu, 22 May 2014 05:38:04 +0000 (05:38 +0000)
PR lto/61012
* lto-symtab.c (lto_symtab_merge_decls_1): Do not ICE on undefined externals
mixed with variables.

From-SVN: r210740

gcc/lto/ChangeLog
gcc/lto/lto-symtab.c

index 7c93cb7d6a0e2ebabcf953630d99eca7b53f301d..dedabf36867d00919f22fae55faef31fbed76370 100644 (file)
@@ -1,3 +1,9 @@
+2014-05-17  Jan Hubicka  <hubicka@ucw.cz>
+
+       PR lto/61012
+       * lto-symtab.c (lto_symtab_merge_decls_1): Do not ICE on undefined externals
+       mixed with variables.
+
 2014-05-17  Trevor Saunders  <tsaunders@mozilla.com>
 
        * lto-tree.h: Don't use variable_size gty attribute.
index 5486e737f763de2d2e729627eae48f7c7c9fd550..957261ec8b7e388b94b8c0536e63a0cf90d8b0cf 100644 (file)
@@ -447,7 +447,12 @@ lto_symtab_merge_decls_1 (symtab_node *first)
      cgraph or a varpool node.  */
   if (!prevailing)
     {
-      prevailing = first;
+      for (prevailing = first;
+          prevailing; prevailing = prevailing->next_sharing_asm_name)
+       if (lto_symtab_symbol_p (prevailing))
+         break;
+      if (!prevailing)
+       return;
       /* For variables chose with a priority variant with vnode
         attached (i.e. from unit where external declaration of
         variable is actually used).