From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Archive: List-Post: List-Help: Sender: gcc-patches-owner@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, 03 Jun 2014 07:13:00 -0000 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-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2014-06/txt/msg00173.txt.bz2 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);