From patchwork Tue Jun 3 07:13:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Enkovich X-Patchwork-Id: 355194 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 D86D8140094 for ; Tue, 3 Jun 2014 17:13:43 +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=pHH2Ee3MQyxwVeWOQEtkctLOpTZF+OWtnpSHP6js/TLWET9iLfhXe ppaifpJsrW7P6pedP2tGQEETz2wWWe2p4yBj4Afj2b4UkwilDM4TeFmgGngn+iUu M7FRMEyywxaq8IoF6btMhy8WNQaWTvVSNijYV0O3yGddjEq0fxMdgA= 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=YcEYjepCffOvqVdcddxtoK85NnE=; b=eRlPkRsgOQbq/NMOa6Jy 4bh+f7RruBZZCWblDqwkuQ7ahipOFERk8zV9znEnLlR+PU1Ev2OEgYH70F1vYGs9 SIeDIo5dpTPzi1yIhnipn+WvDlc/eN5C3/drwoJAY28Js9lgc6Uje+/lfGvhkLn3 Z35r4DW+yQN2I/Y5a4W07gE= Received: (qmail 8364 invoked by alias); 3 Jun 2014 07:13:37 -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 8348 invoked by uid 89); 3 Jun 2014 07:13:36 -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-f49.google.com Received: from mail-pb0-f49.google.com (HELO mail-pb0-f49.google.com) (209.85.160.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 03 Jun 2014 07:13:35 +0000 Received: by mail-pb0-f49.google.com with SMTP id jt11so5109762pbb.22 for ; Tue, 03 Jun 2014 00:13:33 -0700 (PDT) X-Received: by 10.69.19.140 with SMTP id gu12mr46775130pbd.111.1401779613253; Tue, 03 Jun 2014 00:13:33 -0700 (PDT) Received: from msticlxl57.ims.intel.com (fmdmzpr02-ext.fm.intel.com. [192.55.55.37]) by mx.google.com with ESMTPSA id pu5sm24152272pbb.4.2014.06.03.00.13.31 for (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Jun 2014 00:13:32 -0700 (PDT) Date: Tue, 3 Jun 2014 11:13:27 +0400 From: Ilya Enkovich To: gcc-patches@gcc.gnu.org Subject: [PATCH, Pointer Bounds Checker 24/x] PRE Message-ID: <20140603071327.GB20877@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 preserves CALL_WITH_BOUNDS flag for calls during PRE. Bootstrapped and tested on linux-x86_64. Thanks, Ilya --- gcc/ 2014-06-03 Ilya Enkovich * tree-ssa-pre.c (create_component_ref_by_pieces_1): Store CALL_WITH_BOUNDS_P for calls. (copy_reference_ops_from_call): Restore CALL_WITH_BOUNDS_P flag. diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index 1e55356..d5b9f3b 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -2579,6 +2579,8 @@ create_component_ref_by_pieces_1 (basic_block block, vn_reference_t ref, (TREE_CODE (fn) == FUNCTION_DECL ? build_fold_addr_expr (fn) : fn), nargs, args); + if (currop->op2 == integer_one_node) + CALL_WITH_BOUNDS_P (folded) = true; free (args); if (sc) CALL_EXPR_STATIC_CHAIN (folded) = sc; diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index f7ec8b6..e83d9dc 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -1124,6 +1124,8 @@ copy_reference_ops_from_call (gimple call, temp.opcode = CALL_EXPR; temp.op0 = gimple_call_fn (call); temp.op1 = gimple_call_chain (call); + if (gimple_call_with_bounds_p (call)) + temp.op2 = integer_one_node; temp.off = -1; result->safe_push (temp);