From patchwork Fri Feb 12 13:17:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Enkovich X-Patchwork-Id: 582164 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 3C35014031F for ; Sat, 13 Feb 2016 00:18:01 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=VUx1nvQT; 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=BhYWcD8amkRW6l6glq0DGGglfWoHQbNcuVGmRhEJcM8ouDa/1pdPJ FJ4md3T6ZY/hwvgV64ItO/27WyYkI4IJavmKVNUIOk45jxy+kPniuq48uVJcNnaK xtUmRNFFTXCyL02nw3DzE6X1E+l8jw3KLzcwPQZnfRMivYJKXYJiaM= 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=x8VTsOqhxn1wx5cTbLVuTp4lIP0=; b=VUx1nvQTvvecQQCOs5gT e+gGiMv68//9xNZlw2AZKhejcfTQn/yV0IEkx0HER8rBuYsW+71CF+1IlPNjAYWh 8Gv3WJ/e3zZuqGGUhMdqj8BjiOtyLmIF89c01kVCOdviPn83olAJHaXYdOJHVTvf zkjVyxD2t4WHwL5ZNfJ4SpQ= Received: (qmail 113751 invoked by alias); 12 Feb 2016 13:17: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 113737 invoked by uid 89); 12 Feb 2016 13:17:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=574, 426, 42, 6, 595 X-HELO: mail-wm0-f53.google.com Received: from mail-wm0-f53.google.com (HELO mail-wm0-f53.google.com) (74.125.82.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 12 Feb 2016 13:17:48 +0000 Received: by mail-wm0-f53.google.com with SMTP id p63so19058953wmp.1 for ; Fri, 12 Feb 2016 05:17:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=Nov1KWACWKwH8S2Ob0rvZsQ4V6Klk59ko9+z9vdbcHQ=; b=Jgjyc+PUs3dh+NAdWhu49yBkIIIWVmzk6KW5R+YHTNYO7yET9wq60c3yUQuDdwSnnG 5Z55XRAjJQghgpEe/qdoVzGi00Qk28HqaR47k69iLL/7VR0hN9uZiW1HeptipqB7pPd/ jSthPEQ5gncpcRBi9YugSVPt30Kjxsh8bRr3joegPt9YkeYMhCGCm2nLWB8uqtZDGiFr lY+B5F/M7Ts+J16r3e9XqdMD6rjuF5+GX4y82CLZp/8XAC3uaXK0bksQp6rAPtCkX0wF 4QI53B/KUReDhFPT/O4wfswGBeH1qfA8TvRE9OuSuVQO+yps7BtQIhpOZ9smVCQALyQ4 BPnw== X-Gm-Message-State: AG10YOSAiMwRRAp4lHOXgwT16RXezzpW0Bvn5cYp2SsNiWj1oEDBXtH6Wucs0NmgfMTCHw== X-Received: by 10.194.117.68 with SMTP id kc4mr1643002wjb.111.1455283065812; Fri, 12 Feb 2016 05:17:45 -0800 (PST) Received: from msticlxl57.ims.intel.com (irdmzpr01-ext.ir.intel.com. [192.198.151.36]) by smtp.gmail.com with ESMTPSA id t8sm10721354wjy.41.2016.02.12.05.17.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Feb 2016 05:17:45 -0800 (PST) Date: Fri, 12 Feb 2016 16:17:08 +0300 From: Ilya Enkovich To: gcc-patches@gcc.gnu.org Subject: [PATCH, CHKP, committed] Fix PR middle-end/69729 Message-ID: <20160212131708.GB56361@msticlxl57.ims.intel.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes Hi, This patch fixes instrumentation thunk recognition condition in lto_output. This avoids missing required thunks in ltrans modules. Bootstrapped and regtested on x86_64-pc-linux-gnu. Committed to trunk. Thanks, Ilya --- gcc/ 2016-02-12 Ilya Enkovich PR target/69729 * lto-streamer-out.c (lto_output): Use thunk.add_pointer_bounds_args to correctly determine instrumentation thunks. gcc/testsuite/ 2016-02-12 Ilya Enkovich * g++.dg/lto/lto.exp: Include and init mpx. * g++.dg/lto/pr69729_0.C: New test. diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c index 6bb76cc..997a28b 100644 --- a/gcc/lto-streamer-out.c +++ b/gcc/lto-streamer-out.c @@ -2321,7 +2321,7 @@ lto_output (void) { if (lto_symtab_encoder_encode_body_p (encoder, node) && !node->alias - && (!node->thunk.thunk_p || !node->instrumented_version)) + && (!node->thunk.thunk_p || !node->thunk.add_pointer_bounds_args)) { if (flag_checking) { diff --git a/gcc/testsuite/g++.dg/lto/lto.exp b/gcc/testsuite/g++.dg/lto/lto.exp index 8d99418..48f0947 100644 --- a/gcc/testsuite/g++.dg/lto/lto.exp +++ b/gcc/testsuite/g++.dg/lto/lto.exp @@ -31,6 +31,7 @@ if $tracelevel then { load_lib standard.exp load_lib g++.exp load_lib target-libpath.exp +load_lib mpx-dg.exp # Load the language-independent compabibility support procedures. load_lib lto.exp @@ -42,6 +43,7 @@ if { ![check_effective_target_lto] } { g++_init lto_init no-mathlib +mpx_init # Define an identifier for use with this suite to avoid name conflicts # with other lto tests running at the same time. @@ -57,4 +59,5 @@ foreach src [lsort [find $srcdir/$subdir *_0.\[cC\]]] { lto-execute $src $sid } +mpx_finish lto_finish diff --git a/gcc/testsuite/g++.dg/lto/pr69729_0.C b/gcc/testsuite/g++.dg/lto/pr69729_0.C new file mode 100644 index 0000000..b736406 --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr69729_0.C @@ -0,0 +1,35 @@ +/* { dg-lto-do link } */ +/* { dg-require-effective-target mpx } */ +/* { dg-lto-options {{-fcheck-pointer-bounds -mmpx -flto -flto-partition=max}} } */ + +class cl1 +{ + public: + virtual ~cl1 () { }; +}; + +class cl2 +{ + public: + virtual ~cl2 () { }; +}; + +class cl3 : cl1, cl2 +{ +}; + +class cl4 : cl3 +{ + public: + ~cl4 (); +}; + +cl4::~cl4 () +{ +} + +int main (int argc, char **argv) +{ + cl4 c; + return 0; +}