From patchwork Tue Nov 30 04:13:22 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: ggc-zone build fixes (was Re: system.h and system header include cleanup) Date: Mon, 29 Nov 2010 18:13:22 -0000 From: Laurynas Biveinis X-Patchwork-Id: 73524 Message-Id: <4CF479E2.7010604@gmail.com> To: gcc-patches@gcc.gnu.org Cc: "Joseph S. Myers" 2010/11/27 Joseph S. Myers : >> ggc-zone.c is not compiled unless configured with --with-gc=zone, so >> would you mind doing 'make ggc-zone.o' to make sure it still builds OK >> with the change? > > It has a pre-existing build failure. The joys of unused-but-present code. Joseph, sorry for disturbing you then. I have committed the following as obvious, tested by bootstrapping with and without --with-gc=zone. I did not bother to test --with-gc=zone --enable-gather-mem-stats combination. For the record, my previous suggestion of using make ggc-zone.o to test is wrong at least due to missing GGC_ZONE define. Also for the record, for 4.7 I have plans to get rid of one GC implementation, thus solving this ggc-zone mess. 2010-11-30 Laurynas Biveinis * ggc-zone.c (ggc_pch_read): Fix conditional compilation. * ggc-none.c (ggc_internal_alloc_zone_stat) (ggc_internal_cleared_alloc_zone_stat): New. Index: gcc/ggc-zone.c =================================================================== --- gcc/ggc-zone.c (revision 167234) +++ gcc/ggc-zone.c (working copy) @@ -2476,7 +2476,7 @@ /* We've just read in a PCH file. So, every object that used to be allocated is now free. */ -#ifdef 0 && GATHER_STATISTICS +#ifdef GATHER_STATISTICS zone_allocate_marks (); ggc_prune_overhead_list (); zone_free_marks (); Index: gcc/ggc-none.c =================================================================== --- gcc/ggc-none.c (revision 167234) +++ gcc/ggc-none.c (working copy) @@ -71,3 +71,22 @@ struct alloc_zone rtl_zone; struct alloc_zone tree_zone; struct alloc_zone tree_id_zone; + +#if defined (GGC_ZONE) && !defined (GENERATOR_FILE) + +void * +ggc_internal_alloc_zone_stat (size_t size, + struct alloc_zone * ARG_UNUSED(z) MEM_STAT_DECL) +{ + return xmalloc (size); +} + +void * +ggc_internal_cleared_alloc_zone_stat (size_t size, + struct alloc_zone * ARG_UNUSED(z) + MEM_STAT_DECL) +{ + return xcalloc (size, 1); +} + +#endif