This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch: 2nd of N --enable-checking=gc,gcac failures: clear GC free list on PCH read
- From: "Laurynas Biveinis" <laurynas dot biveinis at gmail dot com>
- To: "Gcc Patch List" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 28 Aug 2007 15:51:45 -0700
- Subject: Patch: 2nd of N --enable-checking=gc,gcac failures: clear GC free list on PCH read
Hello,
The second --enable-checking=gc,gcac failure is that after a PCH read,
GC tries to allocate memory belonging to the objects on the free list.
The PCH read frees all the objects allocated earlier and the free list
does not make any sense afterwards. So fixed by validating the free
object list right before the PCH read, which clears the list as well.
Two bootstraps on i686-pc-linux-gnu with --enable-checking=gc,gcac and
without it are underway. OK for mainline assuming clean bootstraps and
no testsuite regressions?
:ADDPATCH pch:
2007-08-28 Laurynas Biveinis <laurynas.biveinis@gmail.com>
* ggc-page.c (ggc_pch_read): Call validate_free_objects().
--
Laurynas
Index: ggc-page.c
===================================================================
--- ggc-page.c (revision 127867)
+++ ggc-page.c (working copy)
@@ -2243,6 +2243,7 @@
#ifdef ENABLE_GC_CHECKING
poison_pages ();
#endif
+ validate_free_objects();
/* No object read from a PCH file should ever be freed. So, set the
context depth to 1, and set the depth of all the currently-allocated