From patchwork Tue May 2 14:32:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 757632 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wHNzw4Mtxz9s2Q for ; Wed, 3 May 2017 00:32:43 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="FHbYyAxQ"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=eL8P9fagF6XczBGC8gc3lxfZntouEbr4ALdRflHbcCcMF5PRMh YLcGlyooQ48XvZ2o5OMsUXyktR5VJ2JcRPd71zQrkH/ZLcnAZUnPEhZY6/d8ivsv HHMeMR4MwUNkBhFsySxGjbCviE0quo6+x4H2ocUlZJpnSzyzggCZxxEgk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type; s= default; bh=1q3K8e3znOw1nvNGcHCylbSa6/M=; b=FHbYyAxQUuKSrV8f7kJe JzzQgx13fx3M1+fb7NI57fz29v1YC76CQnOTwuuR/vntatpG42CJi2e55jcfSIcz eIiJIH0n9GlIfDGlizanvErJWhnsN8pIARGgySf5q1dNahZdm4zjMAcfTZO2kWHy zTg47YN7VfcqsVRlzIc80Cw= Received: (qmail 78294 invoked by alias); 2 May 2017 14:32:29 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 78236 invoked by uid 89); 2 May 2017 14:32:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy=6196, ent X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 02 May 2017 14:32:25 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 486F0ABBD; Tue, 2 May 2017 14:32:25 +0000 (UTC) To: GCC Patches Cc: Thomas Schwinge From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Subject: [PATCH] Remove LTO_STREAMER_DEBUG (PR lto/79489). Message-ID: <0347bea3-3b97-8e2a-2119-3e3e362e0e06@suse.cz> Date: Tue, 2 May 2017 16:32:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 X-IsSubscribed: yes Hi. After a discussion with Richi on IRC, I'm removing the debugging infrastructure as it's obsolete. Patch can bootstrap on ppc64le-redhat-linux and survives regression tests. Installed as it's pre-approved. Martin From 88768989be6c79c43bd3166c87eaa877b867957c Mon Sep 17 00:00:00 2001 From: marxin Date: Tue, 2 May 2017 15:12:13 +0200 Subject: [PATCH] Remove LTO_STREAMER_DEBUG (PR lto/79489). gcc/ChangeLog: 2017-05-02 Martin Liska PR lto/79489. * lto-streamer-in.c (lto_read_tree_1): Remove LTO_STREAMER_DEBUG. * lto-streamer.c (struct tree_hash_entry): Likewise. (struct tree_entry_hasher): Likewise. (tree_entry_hasher::hash): Likewise. (tree_entry_hasher::equal): Likewise. (lto_streamer_init): Likewise. (lto_orig_address_map): Likewise. (lto_orig_address_get): Likewise. (lto_orig_address_remove): Likewise. * lto-streamer.h: Likewise. * tree-streamer-in.c (streamer_alloc_tree): Likewise. * tree-streamer-out.c (streamer_write_tree_header): Likewise. --- gcc/lto-streamer-in.c | 6 ---- gcc/lto-streamer.c | 92 ------------------------------------------------- gcc/lto-streamer.h | 13 ------- gcc/tree-streamer-in.c | 20 ----------- gcc/tree-streamer-out.c | 10 ------ 5 files changed, 141 deletions(-) diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c index 515aa532ce6..6da217d5589 100644 --- a/gcc/lto-streamer-in.c +++ b/gcc/lto-streamer-in.c @@ -1337,12 +1337,6 @@ lto_read_tree_1 (struct lto_input_block *ib, struct data_in *data_in, tree expr) && TREE_CODE (expr) != FUNCTION_DECL && TREE_CODE (expr) != TRANSLATION_UNIT_DECL) DECL_INITIAL (expr) = stream_read_tree (ib, data_in); - -#ifdef LTO_STREAMER_DEBUG - /* Remove the mapping to RESULT's original address set by - streamer_alloc_tree. */ - lto_orig_address_remove (expr); -#endif } /* Read the physical representation of a tree node with tag TAG from diff --git a/gcc/lto-streamer.c b/gcc/lto-streamer.c index 04d733024d8..74fe0e259bf 100644 --- a/gcc/lto-streamer.c +++ b/gcc/lto-streamer.c @@ -257,35 +257,6 @@ print_lto_report (const char *s) lto_section_name[i], lto_stats.section_size[i]); } - -#ifdef LTO_STREAMER_DEBUG -struct tree_hash_entry -{ - tree key; - intptr_t value; -}; - -struct tree_entry_hasher : nofree_ptr_hash -{ - static inline hashval_t hash (const tree_hash_entry *); - static inline bool equal (const tree_hash_entry *, const tree_hash_entry *); -}; - -inline hashval_t -tree_entry_hasher::hash (const tree_hash_entry *e) -{ - return htab_hash_pointer (e->key); -} - -inline bool -tree_entry_hasher::equal (const tree_hash_entry *e1, const tree_hash_entry *e2) -{ - return (e1->key == e2->key); -} - -static hash_table *tree_htab; -#endif - /* Initialization common to the LTO reader and writer. */ void @@ -297,10 +268,6 @@ lto_streamer_init (void) handle it. */ if (flag_checking) streamer_check_handled_ts_structures (); - -#ifdef LTO_STREAMER_DEBUG - tree_htab = new hash_table (31); -#endif } @@ -314,65 +281,6 @@ gate_lto_out (void) && !seen_error ()); } - -#ifdef LTO_STREAMER_DEBUG -/* Add a mapping between T and ORIG_T, which is the numeric value of - the original address of T as it was seen by the LTO writer. This - mapping is useful when debugging streaming problems. A debugging - session can be started on both reader and writer using ORIG_T - as a breakpoint value in both sessions. - - Note that this mapping is transient and only valid while T is - being reconstructed. Once T is fully built, the mapping is - removed. */ - -void -lto_orig_address_map (tree t, intptr_t orig_t) -{ - struct tree_hash_entry ent; - struct tree_hash_entry **slot; - - ent.key = t; - ent.value = orig_t; - slot = tree_htab->find_slot (&ent, INSERT); - gcc_assert (!*slot); - *slot = XNEW (struct tree_hash_entry); - **slot = ent; -} - - -/* Get the original address of T as it was seen by the writer. This - is only valid while T is being reconstructed. */ - -intptr_t -lto_orig_address_get (tree t) -{ - struct tree_hash_entry ent; - struct tree_hash_entry **slot; - - ent.key = t; - slot = tree_htab->find_slot (&ent, NO_INSERT); - return (slot ? (*slot)->value : 0); -} - - -/* Clear the mapping of T to its original address. */ - -void -lto_orig_address_remove (tree t) -{ - struct tree_hash_entry ent; - struct tree_hash_entry **slot; - - ent.key = t; - slot = tree_htab->find_slot (&ent, NO_INSERT); - gcc_assert (slot); - free (*slot); - tree_htab->clear_slot (slot); -} -#endif - - /* Check that the version MAJOR.MINOR is the correct version number. */ void diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h index 854bcd2d75e..9ab3007a9df 100644 --- a/gcc/lto-streamer.h +++ b/gcc/lto-streamer.h @@ -27,14 +27,6 @@ along with GCC; see the file COPYING3. If not see #include "gcov-io.h" #include "diagnostic.h" -/* Define when debugging the LTO streamer. This causes the writer - to output the numeric value for the memory address of the tree node - being emitted. When debugging a problem in the reader, check the - original address that the writer was emitting using lto_orig_address_get. - With this value, set a breakpoint in the writer (e.g., lto_output_tree) - to trace how the faulty node is being emitted. */ -/* #define LTO_STREAMER_DEBUG 1 */ - /* The encoding for a function consists of the following sections: 1) The header. @@ -836,11 +828,6 @@ extern char *lto_get_section_name (int, const char *, struct lto_file_decl_data extern void print_lto_report (const char *); extern void lto_streamer_init (void); extern bool gate_lto_out (void); -#ifdef LTO_STREAMER_DEBUG -extern void lto_orig_address_map (tree, intptr_t); -extern intptr_t lto_orig_address_get (tree); -extern void lto_orig_address_remove (tree); -#endif extern void lto_check_version (int, int, const char *); extern void lto_streamer_hooks_init (void); diff --git a/gcc/tree-streamer-in.c b/gcc/tree-streamer-in.c index f0099c05032..7f7ea7f90ab 100644 --- a/gcc/tree-streamer-in.c +++ b/gcc/tree-streamer-in.c @@ -566,20 +566,9 @@ streamer_alloc_tree (struct lto_input_block *ib, struct data_in *data_in, { enum tree_code code; tree result; -#ifdef LTO_STREAMER_DEBUG - HOST_WIDE_INT orig_address_in_writer; -#endif result = NULL_TREE; -#ifdef LTO_STREAMER_DEBUG - /* Read the word representing the memory address for the tree - as it was written by the writer. This is useful when - debugging differences between the writer and reader. */ - orig_address_in_writer = streamer_read_hwi (ib); - gcc_assert ((intptr_t) orig_address_in_writer == orig_address_in_writer); -#endif - code = lto_tag_to_tree_code (tag); /* We should never see an SSA_NAME tree. Only the version numbers of @@ -630,15 +619,6 @@ streamer_alloc_tree (struct lto_input_block *ib, struct data_in *data_in, result = make_node (code); } -#ifdef LTO_STREAMER_DEBUG - /* Store the original address of the tree as seen by the writer - in RESULT's aux field. This is useful when debugging streaming - problems. This way, a debugging session can be started on - both writer and reader with a breakpoint using this address - value in both. */ - lto_orig_address_map (result, (intptr_t) orig_address_in_writer); -#endif - return result; } diff --git a/gcc/tree-streamer-out.c b/gcc/tree-streamer-out.c index 5cf90449341..05239fb7c25 100644 --- a/gcc/tree-streamer-out.c +++ b/gcc/tree-streamer-out.c @@ -952,16 +952,6 @@ streamer_write_tree_header (struct output_block *ob, tree expr) tag = lto_tree_code_to_tag (code); streamer_write_record_start (ob, tag); - /* The following will cause bootstrap miscomparisons. Enable with care. */ -#ifdef LTO_STREAMER_DEBUG - /* This is used mainly for debugging purposes. When the reader - and the writer do not agree on a streamed node, the pointer - value for EXPR can be used to track down the differences in - the debugger. */ - gcc_assert ((HOST_WIDE_INT) (intptr_t) expr == (intptr_t) expr); - streamer_write_hwi (ob, (HOST_WIDE_INT) (intptr_t) expr); -#endif - /* The text in strings and identifiers are completely emitted in the header. */ if (CODE_CONTAINS_STRUCT (code, TS_STRING)) -- 2.12.2