From patchwork Wed Mar 25 12:35:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Enkovich X-Patchwork-Id: 454381 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 8DB51140119 for ; Wed, 25 Mar 2015 23:35:57 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=GUP9gXoP; dkim-adsp=none (unprotected policy); dkim-atps=neutral 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=c9o6xIp+6jPIIzeqt9ZIozZm4pykS8ul26bAWseVYRsm8PqDCND3z mKkEefjUYtX6ruS/O3zqHayGhBu7PH/OpCmYcJz7dBUjkAF640iQCExSX784p93m WnkujgmyL1BEXAoj5z1VxNguNqtLH0cRyCd6zkXzmivY3Z6oc+SgFI= 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=qNND39GzmdaThaK+Zj6bdpMPEjA=; b=GUP9gXoPDf3ywC44184M khoDAPmSxmr4+skzQIwyZDiQmRcmdN5bB/kIvBTMxw4lYYadM1PdlU3etVw9nX9q vx1LwvR3TS77KsIU5dbWS/9gCTNoTllEeynRtHg+4Eg3GAXfJlWSnxVW1SIufJJ6 WAhEZ9t2WLI1UyNkPQA898M= Received: (qmail 11431 invoked by alias); 25 Mar 2015 12:35:50 -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 11419 invoked by uid 89); 25 Mar 2015 12:35:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=3.0 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, KAM_FROM_URIBL_PCCC, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-wg0-f42.google.com Received: from mail-wg0-f42.google.com (HELO mail-wg0-f42.google.com) (74.125.82.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 25 Mar 2015 12:35:49 +0000 Received: by wgs2 with SMTP id 2so25738422wgs.1 for ; Wed, 25 Mar 2015 05:35:46 -0700 (PDT) X-Received: by 10.180.97.106 with SMTP id dz10mr37265812wib.33.1427286946223; Wed, 25 Mar 2015 05:35:46 -0700 (PDT) Received: from msticlxl57.ims.intel.com (fmdmzpr01-ext.fm.intel.com. [192.55.54.36]) by mx.google.com with ESMTPSA id cf12sm3527968wjb.10.2015.03.25.05.35.43 for (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Mar 2015 05:35:45 -0700 (PDT) Date: Wed, 25 Mar 2015 15:35:30 +0300 From: Ilya Enkovich To: gcc-patches@gcc.gnu.org Subject: [PATCH, CHKP, PR target/65508] Set static chain for instrumented calls Message-ID: <20150325123530.GA44881@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 fixes PR target/65508 by proper copy of static chain for instrumented calls. Bootstrapped and tested on x86_64-unknown-linux-gnu. OK for trunk or wait for stage 1? Thanks, Ilya --- gcc/ 2015-03-25 Ilya Enkovich PR target/65508 * tree-chkp.c (chkp_add_bounds_to_call_stmt): Set static chain for generated call. gcc/testsuite/ 2015-03-25 Ilya Enkovich PR target/65508 * gcc.target/i386/mpx/pr65508.c: New. diff --git a/gcc/testsuite/gcc.target/i386/mpx/pr65508.c b/gcc/testsuite/gcc.target/i386/mpx/pr65508.c new file mode 100644 index 0000000..9060287 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/mpx/pr65508.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fcheck-pointer-bounds -mmpx" } */ + +void +bar (int N) +{ + int a[N]; + void foo (int a[N]) + { + } + foo (a); +} diff --git a/gcc/tree-chkp.c b/gcc/tree-chkp.c index d2df4ba..de127ae 100644 --- a/gcc/tree-chkp.c +++ b/gcc/tree-chkp.c @@ -1838,6 +1838,7 @@ chkp_add_bounds_to_call_stmt (gimple_stmt_iterator *gsi) new_call = gimple_build_call_vec (gimple_op (call, 1), new_args); gimple_call_set_lhs (new_call, gimple_call_lhs (call)); gimple_call_copy_flags (new_call, call); + gimple_call_set_chain (new_call, gimple_call_chain (call)); } new_args.release ();