http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54095
--- Comment #8 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-09-25 09:38:44 UTC --- Including the boundary as with /* If there is a symbol in the set that shares the same asm name than NODE, rename NODE. */ if (!TREE_PUBLIC (decl) && symtab_real_symbol_p (node)) for (s = symtab_node_for_asm (DECL_ASSEMBLER_NAME (decl)); s; s = s->symbol.next_sharing_asm_name) if (s != node && symtab_real_symbol_p (s) && (lto_symtab_encoder_in_partition_p (encoder, s) || (symtab_function_p (s) && lto_symtab_encoder_encode_body_p (encoder, cgraph (s))))) doesn't fix it (but is probably needed?). Looking in how lto-streamer-out.c iterates over bodies to stream I notice it doesn't use the iterator (cosmetic) and it doesn't check symtab_real_symbol_p but lto_symtab_encoder_encode_body_p plus !node->alias && !node->thunk.thunk_p. So I should probably use that check instead of what I used above (well, for functions at least). Trying an assert in lto-streamer-out.c that we only stream symtab_real_symbol_p's.