From patchwork Mon Aug 18 13:02:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Enkovich X-Patchwork-Id: 381000 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 CB22E1400D2 for ; Mon, 18 Aug 2014 23:05:11 +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:cc:subject:message-id:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=Z3lmMi26SGtbg6/hN PcOLAWo+B3D2jo8E/t1EFyOG/1nc2oyZf2D+jysnsPvIwLYlckIhwkt7b7rTRS5q aeHKqvIbCLYsQLuuypziCep7aOEQVDs4XRyvWqChnHjoYr7A/2m92zJgdKtxT/5u eK7+enakJGNWWt8p+iavaIi8jw= 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:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=default; bh=EpBktkujS6R2e17IwAj+UCi e6y4=; b=OGrY32v96CA2kkp5uPxVR6DC9+k/8ys9HF0B/bs0wjKxztaIUleJTby 1I0ZCshQYgQdFV/4wI+N1sJOnfDFxeV8HxcxzNEU2rx46KbG+CkaJwzioelDHd/l nbAcgVsv0RWiUMxS/U+Nr+xS7+wybftMpPt7LNJ8TVQks2N5Rj/4= Received: (qmail 6674 invoked by alias); 18 Aug 2014 13:02:31 -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 6657 invoked by uid 89); 18 Aug 2014 13:02:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f53.google.com Received: from mail-pa0-f53.google.com (HELO mail-pa0-f53.google.com) (209.85.220.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 18 Aug 2014 13:02:28 +0000 Received: by mail-pa0-f53.google.com with SMTP id rd3so7554529pab.26 for ; Mon, 18 Aug 2014 06:02:21 -0700 (PDT) X-Received: by 10.66.183.81 with SMTP id ek17mr35270132pac.39.1408366941001; Mon, 18 Aug 2014 06:02:21 -0700 (PDT) Received: from msticlxl57.ims.intel.com (fmdmzpr03-ext.fm.intel.com. [192.55.54.38]) by mx.google.com with ESMTPSA id zh7sm58531986pab.1.2014.08.18.06.02.18 for (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Aug 2014 06:02:20 -0700 (PDT) Date: Mon, 18 Aug 2014 17:02:09 +0400 From: Ilya Enkovich To: Richard Biener Cc: GCC Patches Subject: Re: [PATCH, Pointer Bounds Checker 24/x] PRE Message-ID: <20140818130209.GB29976@msticlxl57.ims.intel.com> References: <20140603071327.GB20877@msticlxl57.ims.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes On 03 Jun 11:33, Richard Biener wrote: > On Tue, Jun 3, 2014 at 9:13 AM, Ilya Enkovich wrote: > > Hi, > > > > This patch preserves CALL_WITH_BOUNDS flag for calls during PRE. > > Ok. > > Richard. > Merging with the trunk I found that op2 field of vn_reference_op_struct is now used to pass EH context for calls and there is no more free field to store with_bounds flag. So I added one. Does it look OK? Thanks, Ilya --- 2014-08-14 Ilya Enkovich * tree-ssa-sccvn.h (vn_reference_op_struct): Transform opcode into bit field and add with_bounds field. * tree-ssa-sccvn.c (copy_reference_ops_from_call): Set with_bounds field for instrumented calls. * tree-ssa-pre.c (create_component_ref_by_pieces_1): Restore CALL_WITH_BOUNDS_P flag for calls. diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index 8b4d2ba..8d286c9 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -2581,6 +2581,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->with_bounds) + 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 ec0bf6b..c6f749d 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -1149,6 +1149,8 @@ copy_reference_ops_from_call (gimple call, if (stmt_could_throw_p (call) && (lr = lookup_stmt_eh_lp (call)) > 0) temp.op2 = size_int (lr); temp.off = -1; + if (gimple_call_with_bounds_p (call)) + temp.with_bounds = 1; result->safe_push (temp); /* Copy the call arguments. As they can be references as well, diff --git a/gcc/tree-ssa-sccvn.h b/gcc/tree-ssa-sccvn.h index 84ea278..743bc0e 100644 --- a/gcc/tree-ssa-sccvn.h +++ b/gcc/tree-ssa-sccvn.h @@ -80,7 +80,9 @@ typedef const struct vn_phi_s *const_vn_phi_t; typedef struct vn_reference_op_struct { - enum tree_code opcode; + ENUM_BITFIELD(tree_code) opcode : 10; + /* 1 for instrumented calls. */ + unsigned with_bounds : 1; /* Constant offset this op adds or -1 if it is variable. */ HOST_WIDE_INT off; tree type;