From patchwork Wed Mar 18 12:19:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Enkovich X-Patchwork-Id: 451408 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 6D317140079 for ; Wed, 18 Mar 2015 23:19:37 +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=foCNUWRi; 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=PNESrDpVkQNGBhNLjaCn3jUT4kKYKqg6XmsIv96Tfmw4ErC/qXzGO 930GWiUJ9VV+O76UCGWljKd1L4mgvOF3OdMv0u+ENTmY9o7f3xC09abkYFEj0Po/ xbd8W2irI8IoyXJ2cIxUZXova/p1QKcor44SpQik/kyqBIZ6iH8bHs= 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=vimiioBTAs6YXNP0zOXIGjhyfxs=; b=foCNUWRiCejYvmLDTp3l BUQsPByoU3YQOSVEkup53WZsmaY0Q4v2Fck1RpB3tUTA8GS15YPhTRRffmyX0axJ RL0c8V2BNjcnm90oF4JaYeQtAWZLTKQ1OqmxC3eJXkbGjDThD5mMD7syIu+UqETv InHD/m2nqZPdSIayZPVYweY= Received: (qmail 18533 invoked by alias); 18 Mar 2015 12:19:30 -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 18523 invoked by uid 89); 18 Mar 2015 12:19:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=3.2 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-qc0-f171.google.com Received: from mail-qc0-f171.google.com (HELO mail-qc0-f171.google.com) (209.85.216.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 18 Mar 2015 12:19:28 +0000 Received: by qcto4 with SMTP id o4so35696719qct.3 for ; Wed, 18 Mar 2015 05:19:26 -0700 (PDT) X-Received: by 10.140.98.146 with SMTP id o18mr85408049qge.70.1426681166224; Wed, 18 Mar 2015 05:19:26 -0700 (PDT) Received: from msticlxl57.ims.intel.com ([192.55.54.40]) by mx.google.com with ESMTPSA id v2sm11660512qhd.43.2015.03.18.05.19.23 for (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Mar 2015 05:19:25 -0700 (PDT) Date: Wed, 18 Mar 2015 15:19:12 +0300 From: Ilya Enkovich To: gcc-patches@gcc.gnu.org Subject: [CHKP] Never expand instrumentation thunks Message-ID: <20150318121912.GB64546@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 disables attempts to expand instrumentation thunks which appear when we create specialized function versions. Problem was found during SPEC2006 insatrumentation with '-Ofast -flto'. Unfortunately I couldn't make a small reproducer. Bootstrapped and tested on x86_64-unknown-linux-gnu. OK for trunk? Thanks, Ilya --- 2015-03-18 Ilya Enkovich * cgraphunit.c (cgraph_node::expand_thunk): Don't expand instrumentation thunks. diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index e640907..abc9cfe 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -1508,6 +1508,10 @@ cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk) tree thunk_fndecl = decl; tree a; + /* Instrumentation thunk is the same function with + a different signature. Never need to expand it. */ + if (thunk.add_pointer_bounds_args) + return false; if (!force_gimple_thunk && this_adjusting && targetm.asm_out.can_output_mi_thunk (thunk_fndecl, fixed_offset,