From patchwork Fri Jun 6 07:02: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: 356702 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 2189014007B for ; Fri, 6 Jun 2014 17:02:52 +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:cc:subject:message-id:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=lJ21YAOI8Xy+aPRIZ ZoPI4v6tEYIdK1my5lIV7ZmCBbiukn71psfiS0pQTbKJM1Ngya6cDug47aowJ1hz Ff3xaXIQrv7jXyjnsVjHXUPDWnoCeRBh0kcC+6snclUnmcNxtBRQDAu0OkOaToBN lqBloNd5eV2U5d5BqrROdM7SmA= 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=YLc4poL3HEQc6zxsqJyDnXy eSP0=; b=Lt/mrCQ5OMlxcw7iV4sPKXMVdz1xE9vOrFY4gMT5Uy0sEnVhWrpthd1 m1mWX3QGoeTV8MYxSXcl2tz5VX5hNoFxh/dybyb8I/ejbtSk41JksxqhKlyOCIdF gANm0Z+zFYfAY1U6dy9J1UYhmWPRwFtX2QLjVZ3s3UzCH/5tjlYE= Received: (qmail 31445 invoked by alias); 6 Jun 2014 07:02:46 -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 31391 invoked by uid 89); 6 Jun 2014 07:02:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qg0-f53.google.com Received: from mail-qg0-f53.google.com (HELO mail-qg0-f53.google.com) (209.85.192.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 06 Jun 2014 07:02:43 +0000 Received: by mail-qg0-f53.google.com with SMTP id f51so3570005qge.40 for ; Fri, 06 Jun 2014 00:02:41 -0700 (PDT) X-Received: by 10.140.29.226 with SMTP id b89mr4877100qgb.48.1402038161839; Fri, 06 Jun 2014 00:02:41 -0700 (PDT) Received: from msticlxl57.ims.intel.com ([192.55.54.40]) by mx.google.com with ESMTPSA id hk5sm31794320pbb.86.2014.06.06.00.02.39 for (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 06 Jun 2014 00:02:41 -0700 (PDT) Date: Fri, 6 Jun 2014 11:02:35 +0400 From: Ilya Enkovich To: Richard Biener Cc: GCC Patches Subject: Re: [PATCH, Pointer Bounds Checker 26/x] CCP Message-ID: <20140606070235.GC65215@msticlxl57.ims.intel.com> References: <20140603073814.GD20877@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 03 Jun 11:54, Richard Biener wrote: > On Tue, Jun 3, 2014 at 9:38 AM, Ilya Enkovich wrote: > > Hi, > > > > This patch allows BUILT_IN_CHKP_BNDRET as a consumer of a result of BUILT_IN_STACK_SAVE call. > > > > Bootstrapped and tested on linux-x86_64. > > > > Thanks, > > Ilya > > -- > > gcc/ > > > > 2014-06-03 Ilya Enkovich > > > > * tree-ssa-ccp.c (insert_clobber_before_stack_restore): Handle > > BUILT_IN_CHKP_BNDRET calls. > > > > > > diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c > > index eeefeaf..c138337 100644 > > --- a/gcc/tree-ssa-ccp.c > > +++ b/gcc/tree-ssa-ccp.c > > @@ -1848,7 +1848,7 @@ insert_clobber_before_stack_restore (tree saved_val, tree var, > > gimple_htab *visited) > > { > > gimple stmt, clobber_stmt; > > - tree clobber; > > + tree clobber, fndecl; > > imm_use_iterator iter; > > gimple_stmt_iterator i; > > gimple *slot; > > @@ -1880,6 +1880,10 @@ insert_clobber_before_stack_restore (tree saved_val, tree var, > > else if (gimple_assign_ssa_name_copy_p (stmt)) > > insert_clobber_before_stack_restore (gimple_assign_lhs (stmt), var, > > visited); > > + else if (gimple_code (stmt) == GIMPLE_CALL > > + && (fndecl = targetm.builtin_chkp_function (BUILT_IN_CHKP_BNDRET)) > > + && gimple_call_fndecl (stmt) == fndecl) > > + continue; > > Please change this to use the proper abstraction once implemented. It should > be sth like > > else if (is_gimple_call (stmt) > && gimple_call_builtin_p (stmt, BUILT_IN_CHKP_BNDRET)) > continue; > > I assume now that the builtins are not target builtins but added to > builtins.def. > > Richard. > > > else > > gcc_assert (is_gimple_debug (stmt)); > > } Here is a fixed version with proper predicate. Bootstrapped and tested on linux_x86-64. Thanks, Ilya --- gcc/ 2014-06-05 Ilya Enkovich * tree-ssa-ccp.c: Include tree-chkp.h. (insert_clobber_before_stack_restore): Handle BUILT_IN_CHKP_BNDRET calls. diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index eeefeaf..e99bcf5 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -144,6 +144,7 @@ along with GCC; see the file COPYING3. If not see #include "diagnostic-core.h" #include "dbgcnt.h" #include "params.h" +#include "tree-chkp.h" /* Possible lattice values. */ @@ -1880,6 +1881,9 @@ insert_clobber_before_stack_restore (tree saved_val, tree var, else if (gimple_assign_ssa_name_copy_p (stmt)) insert_clobber_before_stack_restore (gimple_assign_lhs (stmt), var, visited); + else if (gimple_code (stmt) == GIMPLE_CALL + && chkp_gimple_call_builtin_p (stmt, BUILT_IN_CHKP_BNDRET)) + continue; else gcc_assert (is_gimple_debug (stmt)); }