This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[lto] Re-implement LTO streamer (2/5)
- From: Diego Novillo <dnovillo at google dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 6 Jul 2009 12:09:20 -0400
- Subject: [lto] Re-implement LTO streamer (2/5)
This is part 2 of http://gcc.gnu.org/ml/gcc-patches/2009-07/msg00279.html
It is not necessary to free up the symbols added to the symtab
hash tables and it was causing random memory corruption.
Diego.
* lto-symtab.c (lto_symtab_maybe_init_hash_tables): Do
not use ggc_free for lto_symtab_identifiers and
lto_symtab_decls.
Index: lto-symtab.c
===================================================================
--- lto-symtab.c (revision 149023)
+++ lto-symtab.c (working copy)
@@ -136,10 +136,10 @@ lto_symtab_maybe_init_hash_tables (void)
{
lto_symtab_identifiers =
htab_create_ggc (1021, lto_symtab_identifier_hash,
- lto_symtab_identifier_eq, ggc_free);
+ lto_symtab_identifier_eq, NULL);
lto_symtab_decls =
htab_create_ggc (1021, lto_symtab_decl_hash,
- lto_symtab_decl_eq, ggc_free);
+ lto_symtab_decl_eq, NULL);
}
}
@@ -697,12 +697,12 @@ lto_symtab_clear_resolution (tree decl)
return;
/* LTO FIXME: There should be no DECL_ABSTRACT in the middle end. */
- if (TREE_CODE (decl) == FUNCTION_DECL && DECL_ABSTRACT (decl))
+ if (TREE_CODE (decl) == FUNCTION_DECL && DECL_ABSTRACT (decl))
return;
- lto_symtab_maybe_init_hash_tables ();
- temp.base.node = decl;
- htab_remove_elt (lto_symtab_decls, &temp);
+ lto_symtab_maybe_init_hash_tables ();
+ temp.base.node = decl;
+ htab_remove_elt (lto_symtab_decls, &temp);
}
#include "gt-lto-symtab.h"