From patchwork Thu Jul 27 19:50:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 794562 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-459202-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="r4e6mLwk"; dkim-atps=neutral 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 3xJMyy2znCz9s7g for ; Fri, 28 Jul 2017 05:50:28 +1000 (AEST) 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:cc:subject:message-id:reply-to:mime-version :content-type; q=dns; s=default; b=UPjh10JqHLU0E/nGwW5yEyueZwi7t tu9Nx40GT+17cC1/nEE/Kq+0m82OinyDfNe1xHQNKucOlLQapghwEgwmLaPCH+D0 di3DuOc5EG003uMpx1YT36ANym6wIX4j8lzCU3UslR5bXjTa1HINUwkT3NeITIbV fM2ET9OloPhUtM= 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:cc:subject:message-id:reply-to:mime-version :content-type; s=default; bh=T4kx7I4dNQ7TORUTi+5eBSeE+D0=; b=r4e 6mLwkdSONFSkmr1HRUBvEK4Eb17OUvp1R2ucWi+BpSDKxtJeUR7/6XTP6Ok7/4Q4 u+OfvQfQe0fae3R+AbciaBLn/hl0WJEdTIthkHe2Kv4Hnx85K9pejIZajm3hpzJq 1+5e96+s/tODBHwZebtBXA0kOS3es3nDWRkAWA0s= Received: (qmail 56491 invoked by alias); 27 Jul 2017 19:50:20 -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 56421 invoked by uid 89); 27 Jul 2017 19:50:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, NO_DNS_FOR_FROM, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mga06.intel.com Received: from mga06.intel.com (HELO mga06.intel.com) (134.134.136.31) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Jul 2017 19:50:17 +0000 Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP; 27 Jul 2017 12:50:15 -0700 X-ExtLoop1: 1 Received: from gnu-6.sc.intel.com ([172.25.70.218]) by fmsmga004.fm.intel.com with ESMTP; 27 Jul 2017 12:50:14 -0700 Received: by gnu-6.sc.intel.com (Postfix, from userid 1000) id DB188C1BB6; Thu, 27 Jul 2017 12:50:14 -0700 (PDT) Date: Thu, 27 Jul 2017 12:50:14 -0700 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Cc: Jason Merrill Subject: [PATCH] PR debug/81570: dwarf2cfi.c: Update cfa.offset in create_pseudo_cfg Message-ID: <20170727195014.GA10240@gmail.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.8.3 (2017-05-23) execute_dwarf2_frame is called for each funtion. But create_cie_data is called only once to initialize cie_cfi_row for all functions. Since INCOMING_FRAME_SP_OFFSET may be different for each function, we can't use the same INCOMING_FRAME_SP_OFFSET in cie_cfi_row for all functions. This patch sets cie_cfi_row->cfa.offset to INCOMING_FRAME_SP_OFFSET in create_pseudo_cfg which is called for each function. Tested on x86-64. OK for trunk? Thanks. H.J. PR debug/81570 * dwarf2cfi.c (create_pseudo_cfg): Set cie_cfi_row->cfa.offset to INCOMING_FRAME_SP_OFFSET. --- gcc/dwarf2cfi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c index a5f9832fc4a..c40f31d2f20 100644 --- a/gcc/dwarf2cfi.c +++ b/gcc/dwarf2cfi.c @@ -2831,6 +2831,9 @@ create_pseudo_cfg (void) memset (&ti, 0, sizeof (ti)); ti.head = get_insns (); ti.beg_row = cie_cfi_row; + /* Set cfa.offset to INCOMING_FRAME_SP_OFFSET here since it may be + different for each function. */ + cie_cfi_row->cfa.offset = INCOMING_FRAME_SP_OFFSET; ti.cfa_store = cie_cfi_row->cfa; ti.cfa_temp.reg = INVALID_REGNUM; trace_info.quick_push (ti);