* ggc-none.c (ggc_grow): New function.
* ggc-page.c (ggc_grow): Likewise.
* lto.c (read_cgraph_and_symbols): Grow ggc memory after streaming.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210908
138bc75d-0d04-0410-961f-
82ee72b054a4
2014-05-23 Jan Hubicka <hubicka@ucw.cz>
+ * ggc.h (ggc_grow): New function.
+ * ggc-none.c (ggc_grow): New function.
+ * ggc-page.c (ggc_grow): Likewise.
+
+2014-05-23 Jan Hubicka <hubicka@ucw.cz>
+
* ipa.c (cgraph_non_local_node_p_1, cgraph_local_node_p, address_taken_from_non_vtable_p,
comdat_can_be_unshared_p_1, comdat_can_be_unshared_p, cgraph_externally_visible_p,
varpool_externally_visible_p, can_replace_by_local_alias,
{
free (p);
}
+
+void
+ggc_grow (void)
+{
+}
fprintf (G.debug_file, "END COLLECTING\n");
}
+/* Assume that all GGC memory is reachable and grow the limits for next collection.
+ With checking, trigger GGC so -Q compilation outputs how much of memory really is
+ reachable. */
+
+void
+ggc_grow (void)
+{
+#ifndef ENABLE_CHECKING
+ G.allocated_last_gc = MAX (G.allocated_last_gc,
+ G.allocated);
+#else
+ ggc_collect ();
+#endif
+ if (!quiet_flag)
+ fprintf (stderr, " {GC start %luk} ", (unsigned long) G.allocated / 1024);
+}
+
/* Print allocation statistics. */
#define SCALE(x) ((unsigned long) ((x) < 1024*10 \
? (x) \
function is called, not during allocations. */
extern void ggc_collect (void);
+/* Assume that all GGC memory is reachable and grow the limits for next collection. */
+extern void ggc_grow (void);
+
/* Register an additional root table. This can be useful for some
plugins. Does nothing if the passed pointer is NULL. */
extern void ggc_register_root_tab (const struct ggc_root_tab *);
2014-05-23 Jan Hubicka <hubicka@ucw.cz>
+ * lto.c (read_cgraph_and_symbols): Grow ggc memory after streaming.
+
+2014-05-23 Jan Hubicka <hubicka@ucw.cz>
+
* lto-symtab.c (lto_symtab_merge_symbols): Update code setting
symtab pointer.
* lto.c (compare_tree_sccs_1): Do not compare comdat groups.
gimple_canonical_types = NULL;
delete canonical_type_hash_cache;
canonical_type_hash_cache = NULL;
+
+ /* At this stage we know that majority of GGC memory is reachable.
+ Growing the limits prevents unnecesary invocation of GGC. */
+ ggc_grow ();
ggc_collect ();
/* Set the hooks so that all of the ipa passes can read in their data. */