Patchwork Fix PR57334

login
register
mail settings
Submitter Richard Guenther
Date June 18, 2013, 9:54 a.m.
Message ID <alpine.LNX.2.00.1306181153160.22313@zhemvz.fhfr.qr>
Download mbox | patch
Permalink /patch/252210/
State New
Headers show

Comments

Richard Guenther - June 18, 2013, 9:54 a.m.
This fixes PR57334, properly merging the chain of symtab nodes
sharing the same assembler name.

LTO bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.

Richard.

2013-06-18  Richard Biener  <rguenther@suse.de>

	PR lto/57334
	* lto-symtab.c (lto_symtab_merge_decls): Process nodes properly.

Patch

Index: gcc/lto-symtab.c
===================================================================
--- gcc/lto-symtab.c	(revision 200163)
+++ gcc/lto-symtab.c	(working copy)
@@ -522,19 +522,9 @@  lto_symtab_merge_decls (void)
   symtab_initialize_asm_name_hash ();
 
   FOR_EACH_SYMBOL (node)
-    if (lto_symtab_symbol_p (node)
+    if (!node->symbol.previous_sharing_asm_name
 	&& node->symbol.next_sharing_asm_name)
-      {
-        symtab_node n;
-
-	/* To avoid duplicated work, see if this is first real symbol in the
-	   chain.  */
-	for (n = node->symbol.previous_sharing_asm_name;
-	     n && !lto_symtab_symbol_p (n); n = n->symbol.previous_sharing_asm_name)
-	  ;
-	if (!n)
-          lto_symtab_merge_decls_1 (node);
-      }
+      lto_symtab_merge_decls_1 (node);
 }
 
 /* Helper to process the decl chain for the symbol table entry *SLOT.  */