From patchwork Tue Nov 19 20:29:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Enkovich X-Patchwork-Id: 292569 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)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7CF192C0127 for ; Wed, 20 Nov 2013 07:31:42 +1100 (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:cc:subject:message-id:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=i+83Jomsb+5vFCbzD gnBhhOr4irPtVhzyg/CmeFnc3vV620rtR1z3ppHNLs7jpvlgDtHsebVB02C6HgcX pUQ+fAAvD0E2sfKnqV1Dd6FiVUTfXb+RFKOgs0dL1lvxLKiTCEEUlUQ1B2PgXN+l DyDTlV3rYaKDGYDP7c3AVpNWDY= 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:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=default; bh=W1xIaVLYrGWiQCjH0xVUHLa JxWc=; b=QvrS7t4gDfFPlCpo1IuiezDb4P7VekQSFSkgh7rwX2pYby/VM9MMxRy O2W0FrFSoGu/ckwPjk35WnJ44zFwashKsrUujFMjTTRUvONkhFx6Y9nwOdX7NCw6 0UP0eoyVJVXaL8USMKJQdfKhLZXjyLQqQ49l/WL1li6sdpsX4wTE= Received: (qmail 14676 invoked by alias); 19 Nov 2013 20:31:32 -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 14662 invoked by uid 89); 19 Nov 2013 20:31:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.2 required=5.0 tests=AWL, BAYES_50, FREEMAIL_FROM, RDNS_NONE, SPF_PASS, URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mail-pb0-f54.google.com Received: from Unknown (HELO mail-pb0-f54.google.com) (209.85.160.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 19 Nov 2013 20:30:46 +0000 Received: by mail-pb0-f54.google.com with SMTP id un15so2428241pbc.27 for ; Tue, 19 Nov 2013 12:30:38 -0800 (PST) X-Received: by 10.66.155.36 with SMTP id vt4mr28067021pab.93.1384893037827; Tue, 19 Nov 2013 12:30:37 -0800 (PST) Received: from msticlxl57.ims.intel.com (fmdmzpr01-ext.fm.intel.com. [192.55.54.36]) by mx.google.com with ESMTPSA id bp5sm32520881pbb.18.2013.11.19.12.30.35 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 19 Nov 2013 12:30:37 -0800 (PST) Date: Wed, 20 Nov 2013 00:29:52 +0400 From: Ilya Enkovich To: Jeff Law Cc: Richard Biener , GCC Patches Subject: Re: [PATCH, MPX, 2/X] Pointers Checker [8/25] Languages support Message-ID: <20131119202952.GT21297@msticlxl57.ims.intel.com> References: <20131108090256.GA21297@msticlxl57.ims.intel.com> <528A4419.7030902@redhat.com> <20131119121342.GR21297@msticlxl57.ims.intel.com> <528BBD0E.5090608@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <528BBD0E.5090608@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes On 19 Nov 12:33, Jeff Law wrote: > On 11/19/13 05:13, Ilya Enkovich wrote: > >On 19 Nov 13:00, Richard Biener wrote: > >>I'd say not in the gimplifier either but in varpool (symbol table) code > >>where the symbols are ultimatively registered with? > > > >Something like that? > > > >--- a/gcc/varpool.c > >+++ b/gcc/varpool.c > >@@ -151,6 +151,10 @@ varpool_node_for_decl (tree decl) > > node = varpool_create_empty_node (); > > node->decl = decl; > > symtab_register_node (node); > >+ > >+ if (DECL_NIITIAL (decl)) > >+ chkp_register_var_initializer (decl); > >+ > > return node; > > } > Yea, I think that's what Richi is suggesting. > jeff > Great! Here is a full version of the patch. Bootstrap, make check and MPX tests are OK with the change. Thanks, Ilya --- 2013-11-19 Ilya Enkovich * varpool.c: Include tree-chkp.h. (varpool_node_for_decl): Register statically initialized decls in Pointer Bounds Checker. diff --git a/gcc/varpool.c b/gcc/varpool.c index 471db82..8487b6e 100644 --- a/gcc/varpool.c +++ b/gcc/varpool.c @@ -34,6 +34,7 @@ along with GCC; see the file COPYING3. If not see #include "output.h" #include "gimple.h" #include "flags.h" +#include "tree-chkp.h" /* List of hooks triggered on varpool_node events. */ struct varpool_node_hook_list { @@ -151,6 +152,10 @@ varpool_node_for_decl (tree decl) node = varpool_create_empty_node (); node->decl = decl; symtab_register_node (node); + + if (DECL_INITIAL (decl)) + chkp_register_var_initializer (decl); + return node; }