From patchwork Sun Jul 12 15:47:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 494132 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 D6FAA1402A9 for ; Mon, 13 Jul 2015 01:48:30 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=Gi3zJSqA; 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 :message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type; q=dns; s=default; b=W1PtYosd2I9w7tI0X fbKthjpepR+4MBNl/DttOF5C83kPP/De9SlaUjQLtws6tKHnQ6LouOyQE0dSHXo1 5Bj+N4t3Y5Fs2j+PNmzqzuOhyp8opauwNESgLprD/ScqpekYKffZfe9VlIr4zln0 tNVebjsjr2xwBBu4PowvnBTV2s= 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 :message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type; s=default; bh=xeBAnYT8IqdunU0k8rBMd1I jdcI=; b=Gi3zJSqAVcVcoA2MhOXc4VYU/qA3TaKv77YMHHtJ34XfujIVz4/9eSn BcERJmdfMfDSgMqkeWuzLoQhtwQhLbfxTuL2KS4Khi1vBlq3Mwm8g4Mblhz3F87S QlJKon7iTzic3lVekg/T0PMqRoCKJLiggTUg4OmIxACMXEX0GAro= Received: (qmail 3158 invoked by alias); 12 Jul 2015 15:48:23 -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 3148 invoked by uid 89); 12 Jul 2015 15:48:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: fencepost.gnu.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (208.118.235.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sun, 12 Jul 2015 15:48:16 +0000 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36654) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ZEJUD-0008Py-KE for gcc-patches@gnu.org; Sun, 12 Jul 2015 11:48:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZEJU7-0002J9-4z for gcc-patches@gnu.org; Sun, 12 Jul 2015 11:48:13 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:52996) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEJU6-0002Ix-UM for gcc-patches@gnu.org; Sun, 12 Jul 2015 11:48:07 -0400 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1ZEJU6-000276-1h from Tom_deVries@mentor.com for gcc-patches@gnu.org; Sun, 12 Jul 2015 08:48:06 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.224.2; Sun, 12 Jul 2015 16:48:04 +0100 Message-ID: <55A28C2F.7040202@mentor.com> Date: Sun, 12 Jul 2015 17:47:59 +0200 From: Tom de Vries User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: "gcc-patches@gnu.org" Subject: [PATCH 1/5] Downgrade debug_args_for_decl to non-cache References: <55A28B9E.1030706@mentor.com> In-Reply-To: <55A28B9E.1030706@mentor.com> X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 192.94.38.131 On 12/07/15 17:45, Tom de Vries wrote: > Hi, > > this patch series implements the forbidding of multi-step garbage > collection liveness dependencies between caches. > > The first four patches downgrade 3 caches to non-cache, since they > introduce multi-step dependencies. This allows us to decouple: > - establishing a policy for multi-step dependencies in caches, and > - fixing issues that allow us to use these 3 as caches again. > > 1. Downgrade debug_args_for_decl to non-cache > 2. Add struct tree_decl_map_hasher > 3. Downgrade debug_expr_for_decl to non-cache > 4. Downgrade value_expr_for_decl to non-cache > 5. Don't mark live recursively in gt_cleare_cache > > Bootstrapped and reg-tested on x86_64, with ENABLE_CHECKING. > > I'll post the patches in response to this email. This patch downgrades debug_args_for_decl to non-cache. OK for trunk? Thanks, - Tom [PATCH 1/5] Downgrade debug_args_for_decl to non-cache Without this patch, but with patch "Don't mark live recursively in gt_cleare_cache" when compiling libgcov-driver.c -m32 we run into: ... 0x133e0e8 void gt_cleare_cache(hash_table*) /home/vries/gcc_versions/devel/src/gcc/hash-table.h:1114 0x133b51f gt_clear_caches_gt_tree_h() ./gt-tree.h:425 0x6c835f gt_clear_caches() ./gtype-c.h:151 0xa8e56e ggc_mark_roots() /home/vries/gcc_versions/devel/src/gcc/ggc-common.c:103 0x7f724e ggc_collect() /home/vries/gcc_versions/devel/src/gcc/ggc-page.c:2183 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. ... The offending cache entry is: ... (gdb) call debug_generic_expr ( (*iter).base.from ) merge_summary.isra.1 (gdb) call debug_generic_expr ( (*iter).to.m_vecdata[0] ) all_prg (gdb) call debug_generic_expr ( (*iter).to.m_vecdata[1] ) D#8 ... 2015-07-10 Tom de Vries PR libgomp/66714 * tree.c (struct tree_vec_map_hasher): New struct. (debug_args_for_decl): Use tree_vec_map_hasher instead of tree_vec_map_cache_hasher. Don't use cache GTY attribute. (decl_debug_args_insert): Allocate debug_args_for_decl using new type. --- gcc/tree.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/gcc/tree.c b/gcc/tree.c index 6628a38..5e27e48 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -268,8 +268,25 @@ struct tree_vec_map_cache_hasher : ggc_cache_ptr_hash } }; +struct tree_vec_map_hasher : ggc_ptr_hash +{ + static hashval_t hash (tree_vec_map *m) { return DECL_UID (m->base.from); } + + static bool + equal (tree_vec_map *a, tree_vec_map *b) + { + return a->base.from == b->base.from; + } +}; + +/* TODO: Figure out whether we can declare debug_args_for_decl as: + static GTY ((cache)) hash_table *debug_args_for_decl; +*/ + +static GTY (()) + hash_table *debug_args_for_decl; static void set_type_quals (tree, int); static void print_type_hash_statistics (void); @@ -6870,7 +6887,7 @@ decl_debug_args_insert (tree from) if (DECL_HAS_DEBUG_ARGS_P (from)) return decl_debug_args_lookup (from); if (debug_args_for_decl == NULL) - debug_args_for_decl = hash_table::create_ggc (64); + debug_args_for_decl = hash_table::create_ggc (64); h = ggc_alloc (); h->base.from = from; h->to = NULL; -- 1.9.1