From b95591361e32a755231d99c348f8a43e2aed0187 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Thu, 22 May 2014 07:38:04 +0200 Subject: [PATCH] =?utf8?q?re=20PR=20lto/61012=20(lto1:=20errors=20during?= =?utf8?q?=20merging=20of=20translation=20units=20(error:=20variable=20?= =?utf8?q?=E2=80=98link=E2=80=99=20redeclared=20as=20function))?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 | 6 ++++++ gcc/lto/lto-symtab.c | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) 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). -- 2.47.3