ggc.h (ggc_grow): New function.

* ggc.h (ggc_grow): New function.
	* ggc-none.c (ggc_grow): New function.
	* ggc-page.c (ggc_grow): Likewise.
	* lto.c (read_cgraph_and_symbols): Grow ggc memory after streaming.

From-SVN: r210908
This commit is contained in:
Jan Hubicka 2014-05-25 04:58:54 +02:00 committed by Jan Hubicka
parent 7f7beb3f10
commit fd1e930270
6 changed files with 39 additions and 0 deletions

View File

@ -1,3 +1,9 @@
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,

View File

@ -67,3 +67,8 @@ ggc_free (void *p)
{
free (p);
}
void
ggc_grow (void)
{
}

View File

@ -2185,6 +2185,23 @@ ggc_collect (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) \

View File

@ -282,6 +282,9 @@ extern const char *ggc_alloc_string (const char *contents, int length
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 *);

View File

@ -1,3 +1,7 @@
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

View File

@ -3001,6 +3001,10 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
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. */