From patchwork Mon Nov 18 10:54:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Enkovich X-Patchwork-Id: 292018 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 AE5302C00F8 for ; Mon, 18 Nov 2013 21:56:32 +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:subject:message-id:mime-version:content-type; q=dns; s= default; b=oxtvf0Wff5S0LO7BK+KxryEgmXlS5yBJWJyTEeVJeSqscC3rcPL5X 4IF++B1rLzB9nrx3zCuxjlr4Yim0f0AELI7Q8gErvIzARDKb3A/1zwleqbuStI3L Mg0FCvQQLhAEQJuyZouSExiJDs73CO3yiBwtRqYboLYdGCdzU0wJqE= 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=ckmFTQvt0gNHA64c8RwT9vXC0Ao=; b=BoZBJV3jNQkMc5BQ4QOX NyVBH5LbjuxFMg22MOp/svrSpc4kLu47QhRrgDi6F3NVjKpKgwQ5/TZuDuKiVBsW Qq0L5VcE198+X0gKs3cJjZh+hDxMzK+d6fzrdi4zp/Pq7x6hraHiL70wXXKSPFUc OlEoJ8dxqSE70U1iYiexfPE= Received: (qmail 9933 invoked by alias); 18 Nov 2013 10:55: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 9906 invoked by uid 89); 18 Nov 2013 10:55:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.1 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-f50.google.com Received: from Unknown (HELO mail-pb0-f50.google.com) (209.85.160.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 18 Nov 2013 10:55:33 +0000 Received: by mail-pb0-f50.google.com with SMTP id rr13so125848pbb.9 for ; Mon, 18 Nov 2013 02:55:25 -0800 (PST) X-Received: by 10.66.6.40 with SMTP id x8mr20194476pax.97.1384772125559; Mon, 18 Nov 2013 02:55:25 -0800 (PST) Received: from msticlxl57.ims.intel.com ([192.55.54.41]) by mx.google.com with ESMTPSA id de1sm22639064pbc.7.2013.11.18.02.55.23 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 18 Nov 2013 02:55:24 -0800 (PST) Date: Mon, 18 Nov 2013 14:54:40 +0400 From: Ilya Enkovich To: gcc-patches@gcc.gnu.org Subject: [PATCH, MPX, 2/X] Pointers Checker [18/25] CCP (Stack store/restore) Message-ID: <20131118105440.GL21297@msticlxl57.ims.intel.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Hi, Here is a patch to support BUILT_IN_CHKP_BNDRET and BUILT_IN_CHKP_BIND_BOUNDS in BUILT_IN_STACK_SAVE result uses. Thanks, Ilya --- 2013-11-15 Ilya Enkovich * tree-ssa-ccp.c (insert_clobber_before_stack_restore): Handle BUILT_IN_CHKP_BNDRET and BUILT_IN_CHKP_BIND_BOUNDS calls. diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index 50006ab..cfba927 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -1774,7 +1774,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; @@ -1806,6 +1806,13 @@ 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_call_builtin_p (stmt, BUILT_IN_CHKP_BIND_BOUNDS)) + insert_clobber_before_stack_restore (gimple_call_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)); }