From patchwork Tue Jun 3 07:38:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Enkovich X-Patchwork-Id: 355212 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 7FDBD1400A6 for ; Tue, 3 Jun 2014 17:38:32 +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=N45eoDL8rRP8yJlL2Itql92A72bY779prIjbHaeOZChW+l7yBHjmg /icXCdp5Nxd5SCUOMo59K62nVK3WAt71LtrO7nr1A/wRQVnXuGi+l5igSbky9zGn RAow5J2lVx11tBpuymrs2gxyMRmng+8NYTJ8W3GbVPzKk5SOjKNEwk= 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=vRj3gwxFYNvRrMTpDXr9rGBjyfk=; b=awZ4C0+Btw7qx+u3h0Yj mCw4sutXz5gVkNTGhhcisvGFNsr5xjc4ltC+a12VPvyKq3YkPEpyOebtSTjYpIGH 3fSf1zTbbfmFgrTPtSshEGr96YOvuCALMEjFJDHi9sk2nTD5emgV4tm9WUFIU8uX K2OUNTDHx9CIsnIwdVoJ6ZA= Received: (qmail 29095 invoked by alias); 3 Jun 2014 07:38:24 -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 29083 invoked by uid 89); 3 Jun 2014 07:38:24 -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_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pb0-f41.google.com Received: from mail-pb0-f41.google.com (HELO mail-pb0-f41.google.com) (209.85.160.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 03 Jun 2014 07:38:22 +0000 Received: by mail-pb0-f41.google.com with SMTP id uo5so5175963pbc.28 for ; Tue, 03 Jun 2014 00:38:21 -0700 (PDT) X-Received: by 10.68.125.228 with SMTP id mt4mr47624254pbb.55.1401781101056; Tue, 03 Jun 2014 00:38:21 -0700 (PDT) Received: from msticlxl57.ims.intel.com (fmdmzpr03-ext.fm.intel.com. [192.55.54.38]) by mx.google.com with ESMTPSA id pl10sm24357773pbb.56.2014.06.03.00.38.19 for (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Jun 2014 00:38:20 -0700 (PDT) Date: Tue, 3 Jun 2014 11:38:14 +0400 From: Ilya Enkovich To: gcc-patches@gcc.gnu.org Subject: [PATCH, Pointer Bounds Checker 26/x] CCP Message-ID: <20140603073814.GD20877@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 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; else gcc_assert (is_gimple_debug (stmt)); }