From: Jan Hubicka Date: Thu, 22 May 2014 05:38:04 +0000 (+0200) Subject: re PR lto/61012 (lto1: errors during merging of translation units (error: variable... X-Git-Tag: releases/gcc-5.1.0~7376 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b95591361e32a755231d99c348f8a43e2aed0187;p=thirdparty%2Fgcc.git re PR lto/61012 (lto1: errors during merging of translation units (error: variable ‘link’ redeclared as function)) PR lto/61012 * lto-symtab.c (lto_symtab_merge_decls_1): Do not ICE on undefined externals mixed with variables. From-SVN: r210740 --- diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 7c93cb7d6a0e..dedabf36867d 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,9 @@ +2014-05-17 Jan Hubicka + + 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 * lto-tree.h: Don't use variable_size gty attribute. diff --git a/gcc/lto/lto-symtab.c b/gcc/lto/lto-symtab.c index 5486e737f763..957261ec8b7e 100644 --- a/gcc/lto/lto-symtab.c +++ b/gcc/lto/lto-symtab.c @@ -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).