From patchwork Mon Jun 10 12:55:10 2019 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: 1113091 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-502688-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.cz 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 45MtQm08pdz9s3l for ; Mon, 10 Jun 2019 22:55:22 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:cc:message-id:date:mime-version:content-type; q=dns; s=default; b=N6YE2oERYTcbwIMebrRA6lykHCBH4IEzuOOaPoRET/N7IvAMhx awq1oHJb347Bzfkf7SUal2OoxEfsjd2+LG6YMeWLrKvRn+h1D5Sp8Z2crs6rGGBm gdG2Tai0nL3VO0+vQ546iYhjOoRQiFN75WwKg3iig8AuuKgbObCdH62mw= 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:from :subject:to:cc:message-id:date:mime-version:content-type; s= default; bh=183x+vhumpW38jQ5++JDmMpSed0=; b=x2/J7d/7fVlFt7Hndx6M 2SdfBcuhyaaneErysai4TokvGK/XAoxd9kEDWW59bkII592T31wTAFb47hotDFNn xPZGhK/P5F2Wp9vmZG73z4kSxzkOxM1WXgm1RM2mGIHgEO57xjdh9gf020+O/ZJu si7ALL/vZIJG22LkpWHKEZs= Received: (qmail 64590 invoked by alias); 10 Jun 2019 12:55:14 -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 64582 invoked by uid 89); 10 Jun 2019 12:55:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy= 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; Mon, 10 Jun 2019 12:55:13 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 00D59AF86; Mon, 10 Jun 2019 12:55:10 +0000 (UTC) From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH] Disable htable sanitization in pt.c (PR c++/87847). To: gcc-patches@gcc.gnu.org Cc: Jason Merrill Message-ID: <0c85e2f3-5e17-3d59-6abe-7e7efa9f455e@suse.cz> Date: Mon, 10 Jun 2019 14:55:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 X-IsSubscribed: yes Hi. The patch is about disablement of hash_table sanitization in pt.c. It's a workaround and I hope Jason can look deeper at the issue. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin gcc/ChangeLog: 2019-06-10 Martin Liska PR c++/87847 * hash-table.h: Extend create_gcc, add one parameter that is passed into hash_table::hash_table. gcc/cp/ChangeLog: 2019-06-10 Martin Liska PR c++/87847 * pt.c (init_template_processing): Disable hash table sanitization for decl_specializations and type_specializations. --- gcc/cp/pt.c | 5 +++-- gcc/hash-table.h | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index d2cf3458253..a7c9635187a 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -28311,8 +28311,9 @@ declare_integer_pack (void) void init_template_processing (void) { - decl_specializations = hash_table::create_ggc (37); - type_specializations = hash_table::create_ggc (37); + /* FIXME: enable sanitization (PR87847) */ + decl_specializations = hash_table::create_ggc (37, false); + type_specializations = hash_table::create_ggc (37, false); if (cxx_dialect >= cxx11) declare_integer_pack (); diff --git a/gcc/hash-table.h b/gcc/hash-table.h index 6c1fca3459b..4f5e150a0ac 100644 --- a/gcc/hash-table.h +++ b/gcc/hash-table.h @@ -386,10 +386,10 @@ public: /* Create a hash_table in gc memory. */ static hash_table * - create_ggc (size_t n CXX_MEM_STAT_INFO) + create_ggc (size_t n, bool sanitize_eq_and_hash = true CXX_MEM_STAT_INFO) { hash_table *table = ggc_alloc (); - new (table) hash_table (n, true, true, GATHER_STATISTICS, + new (table) hash_table (n, true, sanitize_eq_and_hash, GATHER_STATISTICS, HASH_TABLE_ORIGIN PASS_MEM_STAT); return table; }