From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17053 invoked by alias); 9 Jan 2013 16:11:51 -0000 Received: (qmail 16732 invoked by uid 48); 9 Jan 2013 16:11:08 -0000 From: "hjl.tools at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug bootstrap/55792] [4.8 Regression] Bad memory access with profiledbootstrap and LTO Date: Wed, 09 Jan 2013 16:11:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: bootstrap X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.0 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2013-01/txt/msg00826.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55792 --- Comment #19 from H.J. Lu 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 ) 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 to continue, or q 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.