From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25805 invoked by alias); 14 Jan 2013 13:43:27 -0000 Received: (qmail 23566 invoked by uid 48); 14 Jan 2013 13:42:41 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug bootstrap/55792] [4.8 Regression] Bad memory access with profiledbootstrap and LTO Date: Mon, 14 Jan 2013 13:43: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: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: rguenth 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/msg01166.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55792 --- Comment #34 from Richard Biener 2013-01-14 13:42:36 UTC --- static void output_node_opt_summary (struct output_block *ob, struct cgraph_node *node, lto_symtab_encoder_t encoder) { ... gcc_assert (EXPR_LOCATION (map->new_tree) == UNKNOWN_LOCATION); isn't recursively checking EXPR_LOCATION. Index: gcc/lto-cgraph.c =================================================================== --- gcc/lto-cgraph.c (revision 195144) +++ gcc/lto-cgraph.c (working copy) @@ -1492,6 +1492,22 @@ output_edge_opt_summary (struct output_b { } +static tree +verify_no_location (tree *tp, int *walk_subtrees, void *) +{ + if (EXPR_P (*tp)) + gcc_assert (EXPR_LOCATION (*tp) == UNKNOWN_LOCATION); + else + *walk_subtrees = 0; + return NULL_TREE; +} + +static void +verify_no_location (tree expr) +{ + walk_tree (&expr, verify_no_location_r, NULL, NULL); +} + /* Output optimization summary for NODE to OB. */ static void @@ -1536,7 +1552,9 @@ output_node_opt_summary (struct output_b mechanism to store function local declarations into summaries. */ gcc_assert (parm); streamer_write_uhwi (ob, parm_num); - gcc_assert (EXPR_LOCATION (map->new_tree) == UNKNOWN_LOCATION); +#ifdef ENABLE_CHECKING + verify_no_location (map->new_tree); +#endif stream_write_tree (ob, map->new_tree, true); bp = bitpack_create (ob->main_stream); bp_pack_value (&bp, map->replace_p, 1);