From patchwork Mon Jun 2 15:22:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Enkovich X-Patchwork-Id: 354966 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 622A414007C for ; Tue, 3 Jun 2014 01:22:54 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=DVucYIyay5/Byn0TjiwcEuEFTnbrvROuIaq0r46UDg0ZOYChBWbUu 3Iagp/3rSbmy2uXKsU26+GNorsTlauU+h/qjp6IS22jZGHyUHdbU2bAjeRqkULt+ yHzuFG+FIFidV9gSFpgzFqbT0PmDiUtqcOvXQTGy+Kprt0Yps0Z3wU= 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:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=jR54UhLMGyWJ6Z1f2RD4Ip15KEM=; b=UBZF+n5E2Xd+7dRuuQFu ejh9FwyKmiTbVzIE++8blQk13fZQjx+Q+tx8eBgr7mMlDaXBpF7mNjWccXcZOLHU 0fpmIFs7QXTGMK3YCJKq0hexaqSqWsTb3F9Z7IjGviXMxSvmPM8dwhPZpRae1E1S qm9mFKvSXc+P4xpXbyxl9/w= Received: (qmail 14301 invoked by alias); 2 Jun 2014 15:22:47 -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 14289 invoked by uid 89); 2 Jun 2014 15:22:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f173.google.com Received: from mail-pd0-f173.google.com (HELO mail-pd0-f173.google.com) (209.85.192.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 02 Jun 2014 15:22:43 +0000 Received: by mail-pd0-f173.google.com with SMTP id v10so3526949pde.32 for ; Mon, 02 Jun 2014 08:22:41 -0700 (PDT) X-Received: by 10.66.65.225 with SMTP id a1mr41551364pat.139.1401722561344; Mon, 02 Jun 2014 08:22:41 -0700 (PDT) Received: from msticlxl57.ims.intel.com (fmdmzpr03-ext.fm.intel.com. [192.55.54.38]) by mx.google.com with ESMTPSA id wq10sm65429175pac.24.2014.06.02.08.22.39 for (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 Jun 2014 08:22:40 -0700 (PDT) Date: Mon, 2 Jun 2014 19:22:35 +0400 From: Ilya Enkovich To: gcc-patches@gcc.gnu.org Subject: [PATCH, Pointer Bounds Checker 21/x] Weakrefs output Message-ID: <20140602152235.GD53659@msticlxl57.ims.intel.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Hi, This patch prevents output of both instrumented and not instrumented weakref variants. Thanks, Ilya --- gcc/ 2014-06-02 Ilya Enkovich * cgraphunit.c (output_weakrefs): If there are both instrumented and original versions, output only one of them. diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index c5c3333..ae9e699 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -2111,9 +2111,13 @@ static void output_weakrefs (void) { symtab_node *node; + cgraph_node *cnode; FOR_EACH_SYMBOL (node) if (node->alias && !TREE_ASM_WRITTEN (node->decl) + && (!(cnode = dyn_cast (node)) + || !cnode->instrumented_version + || !TREE_ASM_WRITTEN (cnode->instrumented_version->decl)) && node->weakref) { tree target;