From patchwork Wed Nov 20 13:49:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Enkovich X-Patchwork-Id: 292762 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 F405B2C00E2 for ; Thu, 21 Nov 2013 00:51:00 +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=NVUG6CUFuSThBFxco N+lDcwOSqfl5C7h+IUuhcRXwsuteNF5jfF8Gpev58w9i1krFIYx3FuwffSrttQ3E p76Ectn8VclCFqYtnFubfIECWhIKORGNisAxAhuXiMPaoEVWNH1mTfS6rbGXRnPy VroLZ1NBnOob6u0S0/i2MsDuJA= 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=gGWcFvmwF8koTviJbM8BJ+x vq2c=; b=gdzfjMCbGwN44dttWQFJWtQacsnVZBMGvgEPf2P1AxM+P475FBNs3Nc OTQcKOr7POM69FE8Xfs7p1GFW5P2DQLhA6t4eLTZ7tT+QMTAZgirOZxnmjYm711K rlqrRfJoIM+k27ki8PpELRTP+PlDd5x7A94LJER10O2DtsEdFf5c= Received: (qmail 3438 invoked by alias); 20 Nov 2013 13:50:38 -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 3428 invoked by uid 89); 20 Nov 2013 13:50:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.3 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-f42.google.com Received: from Unknown (HELO mail-pb0-f42.google.com) (209.85.160.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 20 Nov 2013 13:50:36 +0000 Received: by mail-pb0-f42.google.com with SMTP id uo5so10059312pbc.1 for ; Wed, 20 Nov 2013 05:50:29 -0800 (PST) X-Received: by 10.67.22.67 with SMTP id hq3mr826012pad.132.1384955428870; Wed, 20 Nov 2013 05:50:28 -0800 (PST) Received: from msticlxl57.ims.intel.com (fmdmzpr02-ext.fm.intel.com. [192.55.55.37]) by mx.google.com with ESMTPSA id gg10sm38053986pbc.46.2013.11.20.05.50.26 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 20 Nov 2013 05:50:27 -0800 (PST) Date: Wed, 20 Nov 2013 17:49:42 +0400 From: Ilya Enkovich To: Richard Biener Cc: Jeff Law , GCC Patches Subject: Re: [PATCH, MPX, 2/X] Pointers Checker [8/25] Languages support Message-ID: <20131120134942.GB53216@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> <20131119202952.GT21297@msticlxl57.ims.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes On 20 Nov 10:59, Richard Biener wrote: > On Tue, Nov 19, 2013 at 9:29 PM, Ilya Enkovich wrote: > > 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. > > Please don't do this in varpool_node_for_decl but in > varpool_finalize_decl. > > Richard. > Here it is. Thanks, Ilya --- gcc/ 2013-11-20 Ilya Enkovich * cgraphunit.c: Include tree-chkp.h. (varpool_finalize_decl): Register statically initialized decls in Pointer Bounds Checker. diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 8ab274b..6b6ec55 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -201,6 +201,7 @@ along with GCC; see the file COPYING3. If not see #include "regset.h" /* FIXME: For reg_obstack. */ #include "context.h" #include "pass_manager.h" +#include "tree-chkp.h" /* Queue of cgraph nodes scheduled to be added into cgraph. This is a secondary queue used during optimization to accommodate passes that @@ -830,6 +831,9 @@ varpool_finalize_decl (tree decl) finished. */ if (cgraph_state == CGRAPH_STATE_FINISHED) varpool_assemble_decl (node); + + if (DECL_INITIAL (decl)) + chkp_register_var_initializer (decl); } /* EDGE is an polymorphic call. Mark all possible targets as reachable