From patchwork Mon Nov 18 10:28:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Enkovich X-Patchwork-Id: 292013 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 C8A672C007C for ; Mon, 18 Nov 2013 21:31:10 +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=rYKVcDk/lyWsruNnt3KxQKuJZlWmin72XI9DH3Xga/hzsdSLwN0QR pTh18LveZk+7QANwPu9tmSFvttDi0MkTZG5zJaWn3Gk8PfebwxoSvA6ZFk824ill dg5VrQde/ZkIIJ4AMVxLKrjVZ8sGSMrj1H1o7pv3917ABlsVuc1qvE= 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=nGGFnFLT1554YZbZ1MkxAce0V24=; b=FPPeC+NhpzDPhNEjIMWR KxezmU0qU1L2CNjTaY7dPr+0EsNiKUFsaZFIGxMJmEBoOKWzzyfIi/Zt0q+bBwtQ 5RyWlevGj4yb91lVxgCCk9YF7t4O6hsrVgKk5AMsFeodSXo+KCvoeO66k+yhx8tj BzyBDYn+2UWZ4CTPSy2pvnI= Received: (qmail 19713 invoked by alias); 18 Nov 2013 10:30:59 -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 19703 invoked by uid 89); 18 Nov 2013 10:30:59 -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_50, FREEMAIL_FROM, RDNS_NONE, SPF_PASS, URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mail-pa0-f46.google.com Received: from Unknown (HELO mail-pa0-f46.google.com) (209.85.220.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 18 Nov 2013 10:29:51 +0000 Received: by mail-pa0-f46.google.com with SMTP id kl14so1533360pab.5 for ; Mon, 18 Nov 2013 02:29:43 -0800 (PST) X-Received: by 10.68.129.201 with SMTP id ny9mr12897869pbb.70.1384770582865; Mon, 18 Nov 2013 02:29:42 -0800 (PST) Received: from msticlxl57.ims.intel.com ([192.55.54.40]) by mx.google.com with ESMTPSA id wd6sm25547382pab.3.2013.11.18.02.29.41 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 18 Nov 2013 02:29:42 -0800 (PST) Date: Mon, 18 Nov 2013 14:28:58 +0400 From: Ilya Enkovich To: gcc-patches@gcc.gnu.org Subject: [PATCH, MPX, 2/X] Pointers Checker [15/25] IPA Propagation Message-ID: <20131118102858.GI21297@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 disable propagation of bounded values. Thanks, Ilya --- 2013-11-13 Ilya Enkovich * ipa-prop.c: Include tree-chkp.h. (ipa_compute_jump_functions_for_edge): Do not propagate bounded args. diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index eb464e4..81e1237 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -48,6 +48,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-streamer.h" #include "params.h" #include "ipa-utils.h" +#include "tree-chkp.h" /* Intermediate information about a parameter that is only useful during the run of ipa_analyze_node and is not kept afterwards. */ @@ -1558,6 +1559,7 @@ ipa_compute_jump_functions_for_edge (struct param_analysis_info *parms_ainfo, struct ipa_node_params *info = IPA_NODE_REF (cs->caller); struct ipa_edge_args *args = IPA_EDGE_REF (cs); gimple call = cs->call_stmt; + tree fndecl = gimple_call_fndecl (call); int n, arg_num = gimple_call_num_args (call); if (arg_num == 0 || args->jump_functions) @@ -1575,7 +1577,13 @@ ipa_compute_jump_functions_for_edge (struct param_analysis_info *parms_ainfo, tree arg = gimple_call_arg (call, n); tree param_type = ipa_get_callee_param_type (cs, n); - if (is_gimple_ip_invariant (arg)) + /* No optimization for bounded types yet implemented. */ + if ((gimple_call_with_bounds_p (call) + || (fndecl && chkp_function_instrumented_p (fndecl))) + && ((param_type && chkp_type_has_pointer (param_type)) + || (!param_type && chkp_type_has_pointer (TREE_TYPE (arg))))) + continue; + else if (is_gimple_ip_invariant (arg)) ipa_set_jf_constant (jfunc, arg, cs); else if (!is_gimple_reg_type (TREE_TYPE (arg)) && TREE_CODE (arg) == PARM_DECL)