From patchwork Mon Nov 18 10:22:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Enkovich X-Patchwork-Id: 292012 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 8A6A02C0094 for ; Mon, 18 Nov 2013 21:23:11 +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=iGclrDhGuEJWbQ5DJ3mLOHdvoUgm49jKAjtJJTREHrqHa1W6bntFJ mzf2Ndqa8BIv6SS2wx9aDqGUyLls4ck1cpFuAmcGhzIzDlVirp7uM/j+yPxkhJ1S oJKROyXwkONFNJF11KpmZ4x9A4bSDKIJWY8VLORKeY5x0ACi42b3fA= 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=PKqdQOpf+3Qazgbi4G9xg1s09Xg=; b=f/jzOIQqcOGUxmNFKg9i EAhCunepFNOBacw5Df9HQWmpO+wdFKVetjtZwsOGj7oRbaVvCIl4UOYyZz/cAdex Vay8gJ4oTDkSOfZH4jl8i/xDTkLInV6GTrgEzO79fc8mBTqU/qs7BxzLoia4e4jd ihoDVXy5LrFVfp5YRTK4XbE= Received: (qmail 11291 invoked by alias); 18 Nov 2013 10:23:02 -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 11279 invoked by uid 89); 18 Nov 2013 10:23:01 -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-pd0-f170.google.com Received: from Unknown (HELO mail-pd0-f170.google.com) (209.85.192.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 18 Nov 2013 10:23:00 +0000 Received: by mail-pd0-f170.google.com with SMTP id g10so2038298pdj.1 for ; Mon, 18 Nov 2013 02:22:52 -0800 (PST) X-Received: by 10.66.26.229 with SMTP id o5mr20815592pag.84.1384770172816; Mon, 18 Nov 2013 02:22:52 -0800 (PST) Received: from msticlxl57.ims.intel.com ([192.55.54.40]) by mx.google.com with ESMTPSA id hz10sm22408503pbc.36.2013.11.18.02.22.51 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 18 Nov 2013 02:22:52 -0800 (PST) Date: Mon, 18 Nov 2013 14:22:08 +0400 From: Ilya Enkovich To: gcc-patches@gcc.gnu.org Subject: [PATCH, MPX, 2/X] Pointers Checker [14/25] Function splitting Message-ID: <20131118102208.GH21297@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 splitting when bounds transfer is required for splitted function. Thanks, Ilya --- 2013-11-13 Ilya Enkovich * ipa-split.c: Include tree-chkp.h. (consider_split): Do not split when splitted part needs bounds transfer. diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c index e55b3f5..1c3df61 100644 --- a/gcc/ipa-split.c +++ b/gcc/ipa-split.c @@ -101,6 +101,7 @@ along with GCC; see the file COPYING3. If not see #include "gimple-pretty-print.h" #include "ipa-inline.h" #include "cfgloop.h" +#include "tree-chkp.h" /* Per basic block info. */ @@ -378,6 +379,7 @@ consider_split (struct split_point *current, bitmap non_ssa_vars, int incoming_freq = 0; tree retval; bool back_edge = false; + bitmap_iterator bi; if (dump_file && (dump_flags & TDF_DETAILS)) dump_split_point (dump_file, current); @@ -486,6 +488,28 @@ consider_split (struct split_point *current, bitmap non_ssa_vars, if (!VOID_TYPE_P (TREE_TYPE (current_function_decl))) call_overhead += estimate_move_cost (TREE_TYPE (current_function_decl)); + /* Currently bounds passing and return is not supported for + splitted functions. */ + EXECUTE_IF_SET_IN_BITMAP (current->ssa_names_to_pass, 0, i, bi) + { + if (POINTER_BOUNDS_P (ssa_name (i))) + { + if (dump_file && (dump_flags & TDF_DETAILS)) + fprintf (dump_file, + " Refused: need to pass bounds\n"); + return; + } + } + + if (chkp_function_instrumented_p (current_function_decl) + && chkp_type_has_pointer (TREE_TYPE (current_function_decl))) + { + if (dump_file && (dump_flags & TDF_DETAILS)) + fprintf (dump_file, + " Refused: need to return bounds\n"); + return; + } + if (current->split_size <= call_overhead) { if (dump_file && (dump_flags & TDF_DETAILS))