From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23134 invoked by alias); 23 Sep 2014 07:29:14 -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 23125 invoked by uid 89); 23 Sep 2014 07:29:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-la0-f42.google.com Received: from mail-la0-f42.google.com (HELO mail-la0-f42.google.com) (209.85.215.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 23 Sep 2014 07:29:12 +0000 Received: by mail-la0-f42.google.com with SMTP id hz20so8143670lab.1 for ; Tue, 23 Sep 2014 00:29:09 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.112.205.39 with SMTP id ld7mr28964720lbc.40.1411457348874; Tue, 23 Sep 2014 00:29:08 -0700 (PDT) Received: by 10.152.1.193 with HTTP; Tue, 23 Sep 2014 00:29:08 -0700 (PDT) In-Reply-To: References: <20140919122338.GG50194@msticlxl57.ims.intel.com> <20140922153029.GA35262@msticlxl57.ims.intel.com> Date: Tue, 23 Sep 2014 07:29:00 -0000 Message-ID: Subject: Re: [PATCH, i386, Pointer Bounds Checker 32/x] Pointer Bounds Checker hooks for i386 target From: Uros Bizjak To: Ilya Enkovich Cc: "gcc-patches@gcc.gnu.org" , Jeff Law , Richard Biener Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2014-09/txt/msg01920.txt.bz2 On Tue, Sep 23, 2014 at 8:48 AM, Ilya Enkovich wro= te: > 2014-09-22 22:51 GMT+04:00 Uros Bizjak : >> On Mon, Sep 22, 2014 at 5:30 PM, Ilya Enkovich = wrote: >>> On 19 Sep 18:21, Uros Bizjak wrote: >>>> On Fri, Sep 19, 2014 at 2:53 PM, Ilya Enkovich wrote: >>>> >>>> >> > This patch adds i386 target hooks for Pointer Bounds Checker. >>>> >>>> > New version with fixes and better documentation for ix86_load_bounds= and ix86_store_bounds is below. >>>> >>>> > +/* Expand pass uses this hook to load bounds for function parameter >>>> > + PTR passed in SLOT in case its bounds are not passed in a regist= er. >>>> > + >>>> > + If SLOT is a memory, then bounds are loaded as for regular point= er >>>> > + loaded from memory. PTR may be NULL in case SLOT is a memory. >>>> > + In such case value of PTR (if required) may be loaded from SLOT. >>>> > + >>>> > + If SLOT is NULL or a register then SLOT_NO is an integer constant >>>> > + holding number of the target dependent special slot which should= be >>>> > + used to obtain bounds. >>>> > + >>>> > + Return loaded bounds. */ >>>> >>>> OK, I hope I understand this target-handling of SLOT_NO. Can you >>>> please clarify when SLOT is a register? >>> >>> For functions with more than four pointers passed in registers we do no= t have enough bound registers to pass bounds. These hooks are called then = with SLOT set to register used to pass pointer >>> >>>> >>>> I propose to write this function in the following (hopefully equivalen= t) way: >>> >>> Since addr computation is very similar for both loading and storing (th= e only difference is usage of either arg_pointer_rtx or stack_pointer_rtx) = I decided additionally move it into a separate function. This should make = functions simplier for understanding. >> >> LGTM, just add the explanation when NULL is returned. > > There is no path in this function returning NULL (we are talking about > ix86_get_arg_address_for_bt, right?). Oh, in fact, I was looking at ix86_function_value_bounds which doesn't have comment at all... Looking a bit more, there are some other functions without comments Uros.