http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55792
--- Comment #19 from H.J. Lu <hjl.tools at gmail dot com> 2013-01-09 16:11:06 UTC --- The BLOCK tree node is cleared by (gdb) bt #0 0x000000336b4882ee in __memset_sse2 () from /lib64/libc.so.6 #1 0x0000000000545fdf in clear_marks () at /export/gnu/import/git/gcc/gcc/ggc-page.c:1815 #2 0x0000000000546621 in ggc_collect () at /export/gnu/import/git/gcc/gcc/ggc-page.c:2086 #3 0x00000000008ad816 in execute_todo (flags=2102) at /export/gnu/import/git/gcc/gcc/passes.c:2023 #4 0x00000000008ae175 in execute_one_pass (pass=0x17b9c70) at /export/gnu/import/git/gcc/gcc/passes.c:2349 #5 0x00000000008ae2da in execute_pass_list (pass=0x17b9c70) at /export/gnu/import/git/gcc/gcc/passes.c:2383 #6 0x00000000008ae30b in execute_pass_list ( pass=0x16d07e0 <pass_all_optimizations>) at /export/gnu/import/git/gcc/gcc/passes.c:2384 #7 0x00000000005da366 in expand_function (node=0x7ffff16f5378) at /export/gnu/import/git/gcc/gcc/cgraphunit.c:1641 #8 0x00000000005da821 in expand_all_functions () at /export/gnu/import/git/gcc/gcc/cgraphunit.c:1745 #9 0x00000000005db2ab in compile () at /export/gnu/import/git/gcc/gcc/cgraphunit.c:2043 #10 0x000000000053c60a in lto_main () at /export/gnu/import/git/gcc/gcc/lto/lto.c:3390 #11 0x0000000000999401 in compile_file () ---Type <return> to continue, or q <return> to quit--- at /export/gnu/import/git/gcc/gcc/toplev.c:545 #12 0x000000000099b3e4 in do_compile () at /export/gnu/import/git/gcc/gcc/toplev.c:1878 #13 0x000000000099b54f in toplev_main (argc=28, argv=0x7fffffffdc78) at /export/gnu/import/git/gcc/gcc/toplev.c:1954 #14 0x0000000000fff958 in main (argc=28, argv=0x7fffffffdc78) at /export/gnu/import/git/gcc/gcc/main.c:36 (gdb) When we remap a block: static void remap_block (tree *block, copy_body_data *id) { tree old_block; tree new_block; /* Make the new block. */ old_block = *block; new_block = make_node (BLOCK); TREE_USED (new_block) = TREE_USED (old_block); BLOCK_ABSTRACT_ORIGIN (new_block) = old_block; BLOCK_SOURCE_LOCATION (new_block) = BLOCK_SOURCE_LOCATION (old_block); BLOCK_NONLOCALIZED_VARS (new_block) = vec_safe_copy (BLOCK_NONLOCALIZED_VARS (old_block)); *block = new_block; /* Remap its variables. */ BLOCK_VARS (new_block) = remap_decls (BLOCK_VARS (old_block), &BLOCK_NONLOCALIZED_VARS (new_block), id); we didn't register it with GC root.