From patchwork Tue May 7 07:55:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Bruel X-Patchwork-Id: 242062 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id EC4022C016D for ; Tue, 7 May 2013 17:55:23 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=he56uovcd/Uu6pbdPpqbZz2j7Qd4fucZTxy00DxHiLd UWYIPA9U4uWfh0kn5foRA5KWCB8M1VcRHKxWa6AsLzl9aamBhA2YLU7uzh5tzBZt jIC/0aC/owjf4YqgqTYpsWzdkQfSwPS7MsyuK20BXH8lZWlamkN+VbF7J5sbkVZU = 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 :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=/ZN4keoVCCPIoHAvFzF56ynivdw=; b=vHske1j6KpcjZM3dA uzi0ZbBfxfwvB7Sfqd0fW1nAIWaj+T9bpJixhm96seBcApwlKOsHyHbBzuhRoZzb ZEzjPkLKpLnG5LavHBuM3FD64VSG/ENWFWYSxpj7AhYSrTzkl8TK3UjPNhzWwuIJ NG3+z5Z+asLmw05Nbv58JWAN00= Received: (qmail 13816 invoked by alias); 7 May 2013 07:55:17 -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 13789 invoked by uid 89); 7 May 2013 07:55:13 -0000 X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_MED, RCVD_IN_HOSTKARMA_W autolearn=ham version=3.3.1 Received: from eu1sys200aog111.obsmtp.com (HELO eu1sys200aog111.obsmtp.com) (207.126.144.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 07 May 2013 07:55:12 +0000 Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob111.postini.com ([207.126.147.11]) with SMTP ID DSNKUYizW6M69Jpt2Zv3ICX3+gzx7iWu4rYJ@postini.com; Tue, 07 May 2013 07:55:12 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 09241190; Tue, 7 May 2013 07:55:02 +0000 (GMT) Received: from Webmail-eu.st.com (safex1hubcas4.st.com [10.75.90.69]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 68F5A2B68; Tue, 7 May 2013 07:54:52 +0000 (GMT) Received: from [164.129.122.89] (164.129.122.89) by webmail-eu.st.com (10.75.90.13) with Microsoft SMTP Server (TLS) id 8.3.279.5; Tue, 7 May 2013 09:55:02 +0200 Message-ID: <5188AFC2.1000105@st.com> Date: Tue, 7 May 2013 09:55:01 +0200 From: Christian Bruel User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Cary Coutant Cc: "gcc-patches@gcc.gnu.org" , Jason Merrill Subject: Re: [DWARF] Fix multiple register spanning location. X-Virus-Found: No Hello, On 04/30/2013 09:05 PM, Cary Coutant wrote > > How about using dbx_reg_number (XVECEXP (regs, 0, i)) instead? The > bare use of DBX_REGISTER_NUMBER earlier in that function is protected > by a gcc_assert, but this one isn't. OK dbx_reg_number better than DBX_REGISTER_NUMBER here. while we are on it, it looks like the spanning case code could be simplified : - size is loop invariant (I don't think we can span across registers of different modes) - rtl is only used in the "Simple, contiguous registers." case. - current_function_uses_only_leaf_regs is not handled for the spanning case. Does that seem OK with the attached patch ? Thanks Christian > -cary 2013-04-26 Christian Bruel * dwarf2out.c (multiple_reg_loc_descriptor): Use DBX_REGISTER_NUMBER for spanning registers. Index: dwarf2out.c =================================================================== --- dwarf2out.c (revision 198410) +++ dwarf2out.c (working copy) @@ -10612,25 +10612,27 @@ static dw_loc_descr_ref multiple_reg_loc_descriptor (rtx rtl, rtx regs, enum var_init_status initialized) { - int nregs, size, i; - unsigned reg; + int size, i; dw_loc_descr_ref loc_result = NULL; - reg = REGNO (rtl); + /* Simple, contiguous registers. */ + if (regs == NULL_RTX) + { + unsigned reg = REGNO (rtl); + int nregs; + #ifdef LEAF_REG_REMAP - if (crtl->uses_only_leaf_regs) - { - int leaf_reg = LEAF_REG_REMAP (reg); - if (leaf_reg != -1) - reg = (unsigned) leaf_reg; - } + if (crtl->uses_only_leaf_regs) + { + int leaf_reg = LEAF_REG_REMAP (reg); + if (leaf_reg != -1) + reg = (unsigned) leaf_reg; + } #endif - gcc_assert ((unsigned) DBX_REGISTER_NUMBER (reg) == dbx_reg_number (rtl)); - nregs = hard_regno_nregs[REGNO (rtl)][GET_MODE (rtl)]; - /* Simple, contiguous registers. */ - if (regs == NULL_RTX) - { + gcc_assert ((unsigned) DBX_REGISTER_NUMBER (reg) == dbx_reg_number (rtl)); + nregs = hard_regno_nregs[REGNO (rtl)][GET_MODE (rtl)]; + size = GET_MODE_SIZE (GET_MODE (rtl)) / nregs; loc_result = NULL; @@ -10658,10 +10660,9 @@ multiple_reg_loc_descriptor (rtx rtl, rtx regs, { dw_loc_descr_ref t; - t = one_reg_loc_descriptor (REGNO (XVECEXP (regs, 0, i)), + t = one_reg_loc_descriptor (dbx_reg_number (XVECEXP (regs, 0, i)), VAR_INIT_STATUS_INITIALIZED); add_loc_descr (&loc_result, t); - size = GET_MODE_SIZE (GET_MODE (XVECEXP (regs, 0, 0))); add_loc_descr_op_piece (&loc_result, size); }