[Bug lto/54095] Unnecessary static variable renaming

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Sep 25 09:54:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54095

--- Comment #9 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-09-25 09:53:36 UTC ---
Indeed:

Index: gcc/lto-streamer-out.c
===================================================================
--- gcc/lto-streamer-out.c      (revision 191694)
+++ gcc/lto-streamer-out.c      (working copy)
@@ -1001,6 +1001,7 @@ lto_output (void)
          gcc_assert (!bitmap_bit_p (output, DECL_UID (node->symbol.decl)));
          bitmap_set_bit (output, DECL_UID (node->symbol.decl));
 #endif
+         gcc_assert (symtab_real_symbol_p ((symtab_node) node));
          decl_state = lto_new_out_decl_state ();
          lto_push_out_decl_state (decl_state);
          if (gimple_has_body_p (node->symbol.decl))

produces

#1  0x0000000000822316 in lto_output ()
    at /space/rguenther/src/svn/trunk/gcc/lto-streamer-out.c:1004
1004              gcc_assert (symtab_real_symbol_p ((symtab_node) node));
(gdb) call debug_cgraph_node (node)
_ZL14get_md_ptr_locPKv/171 (get_md_ptr_loc) @0x7ffff6274888
  Type: function
  Visibility: prevailing_def_ironly
  previous sharing asm name: 781
  References: _ZL8ptr_locs/151 (read)
  Referring: 
  Read from file: build/read-md.o
  Function get_md_ptr_loc/171 is inline copy in fprint_md_ptr_loc/173
  Availability: local
  Function flags: analyzed local finalized
  Called by: _Z17fprint_md_ptr_locP8_IO_FILEPKv/173 (1.00 per call) (inlined) 
  Calls: htab_find/544 (1.00 per call) 

Trying

          /* If there is a symbol in the set that shares the same
             asm name than NODE, rename NODE.  */
          if (!TREE_PUBLIC (decl)
              && (!symtab_function_p (node)
                  || lto_symtab_encoder_encode_body_p (encoder, cgraph
(node))))
            for (s = symtab_node_for_asm (DECL_ASSEMBLER_NAME (decl));
                 s; s = s->symbol.next_sharing_asm_name)
              if (s != node
                  && lto_symtab_encoder_lookup (encoder, s) != LCC_NOT_FOUND
                  && (!symtab_function_p (s)
                      || lto_symtab_encoder_encode_body_p (encoder, cgraph
(s))))
                {



More information about the Gcc-bugs mailing list