From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6639 invoked by alias); 3 Apr 2015 08:38:39 -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 6627 invoked by uid 89); 3 Apr 2015 08:38:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.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-ob0-f171.google.com Received: from mail-ob0-f171.google.com (HELO mail-ob0-f171.google.com) (209.85.214.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 03 Apr 2015 08:38:37 +0000 Received: by obbec2 with SMTP id ec2so162738188obb.3 for ; Fri, 03 Apr 2015 01:38:35 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.116.130 with SMTP id jw2mr1742611obb.48.1428050315900; Fri, 03 Apr 2015 01:38:35 -0700 (PDT) Received: by 10.202.229.72 with HTTP; Fri, 3 Apr 2015 01:38:35 -0700 (PDT) In-Reply-To: <551D9BA6.8080908@redhat.com> References: <20150306141531.GA27860@msticlxl57.ims.intel.com> <551D9BA6.8080908@redhat.com> Date: Fri, 03 Apr 2015 08:38:00 -0000 Message-ID: Subject: Re: [CHKP] Support returned bounds in thunks expand From: Ilya Enkovich To: Jeff Law Cc: gcc-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg00107.txt.bz2 2015-04-02 22:42 GMT+03:00 Jeff Law : > On 04/02/2015 08:49 AM, Ilya Enkovich wrote: >> >> Ping >> >> 2015-03-10 13:12 GMT+03:00 Ilya Enkovich : >>> >>> Hi, >>> >>> Currentl we loose returned bounds when functions are merged. This patch >>> fixes it by adding returne bounds support for cgraph_node::expand_thunk. >>> Bootstrapped and tested on x86_64-unknown-linux-gnu. OK for trunk? >>> >>> Thanks, >>> Ilya >>> -- >>> gcc/ >>> >>> 2015-03-06 Ilya Enkovich >>> >>> * cgraphunit.c (cgraph_node::expand_thunk): Build returned >>> bounds for instrumented functions. >>> >>> gcc/testsuite/ >>> >>> 2015-03-06 Ilya Enkovich >>> >>> * gcc/testsuite/gcc.target/i386/thunk-retbnd.c: New. > > I really dislike the amount of gimple and bounded pointer knowledge in this > code. > > It seems like a significant modularity violation and while you didn't > introduce the gimple stuff, we probably shouldn't be making it worse. > > Is it possible to let this code build up the thunk, then pass it off as a > whole to the chkp code to add the instrumentation, particularly for the > return value? OK, will rework the patch. > > ALso, is this critical for stage4? It looks like this is strictly a QofI > change, correct? Actually having just a tail call in a function we don't lose bounds and I don't expect it affects QofI. But we get instrumented function with no returned bounds for a pointer which triggers an assert somewhere (don't remember exact place). I'll revisit the original problem and will probably make a simpler stability fix for now, leaving thunk modification for stage 1. Thanks, Ilya > > jeff >