From patchwork Fri Dec 7 23:17:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Ellcey X-Patchwork-Id: 204619 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]) by ozlabs.org (Postfix) with SMTP id F265B2C0106 for ; Sat, 8 Dec 2012 10:17:34 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1355527056; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Subject:From:To:CC:In-Reply-To:References:Content-Type: Date:Message-ID:MIME-Version:Content-Transfer-Encoding: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=2lWcEjAvagcxqDcnMBu0 NbJLV6Y=; b=VcrBIAx2B0kuxLZ0ThSfwsMGGJT9nnxDnbzB5W6m2DZKc5QSyHwa +EGRvSJD6sBkqQWR3KXvhqc18kM4bXHRlzv/kyfP1FSo5oXdb+zz0JXGByoxqtZW HXyJkPl1BBw/nc8vqpQ4SWsD7Gez0LAFPEB+tGGFHg9gmOSgdH5NGN8= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-M-MSG:Received:Received:Subject:From:To:CC:In-Reply-To:References:Content-Type:Date:Message-ID:MIME-Version:Content-Transfer-Encoding:X-EMS-Proccessed:X-EMS-STAMP:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=e+Ajg2O94sidWVNwMjwvlXpxAOeM7MVOJghNATt+obhn8t0AT4gHATaqtcEVT6 ju+8/MRZxs/+EvkzVY2M2DrqnJy/s1akC1ifBibDHuNQozFPRYB+orQU2Yg6yCgo uG4Wz47AEYNTGiVkmOJvF6V1+QkO0t8GGtAxvnfOEklJY=; Received: (qmail 7990 invoked by alias); 7 Dec 2012 23:17:20 -0000 Received: (qmail 7945 invoked by uid 22791); 7 Dec 2012 23:17:18 -0000 X-SWARE-Spam-Status: No, hits=-3.1 required=5.0 tests=AWL, BAYES_00, KHOP_SPAMHAUS_DROP, KHOP_THREADED, RP_MATCHES_RCVD, TW_DB X-Spam-Check-By: sourceware.org Received: from dns1.mips.com (HELO dns1.mips.com) (12.201.5.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 07 Dec 2012 23:17:13 +0000 Received: from mailgate1.mips.com (mailgate1.mips.com [12.201.5.111]) by dns1.mips.com (8.13.8/8.13.8) with ESMTP id qB7NHC2x007871 for ; Fri, 7 Dec 2012 15:17:12 -0800 X-M-MSG: Received: from exchdb01.mips.com (unknown [192.168.36.84]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mailgate1.mips.com (Postfix) with ESMTP id 26DBA36466E for ; Fri, 7 Dec 2012 15:17:10 -0800 (PST) Received: from [192.168.65.53] (192.168.65.53) by exchhub01.mips.com (192.168.36.84) with Microsoft SMTP Server id 14.1.270.1; Fri, 7 Dec 2012 15:17:08 -0800 Subject: Re: [patch, mips, debug] Fix PR 54061, mips compiler aborts in testsuite From: Steve Ellcey To: "H.J. Lu" CC: In-Reply-To: References: <1354920955.4464.85.camel@ubuntu-sellcey> Date: Fri, 7 Dec 2012 15:17:08 -0800 Message-ID: <1354922228.4464.88.camel@ubuntu-sellcey> MIME-Version: 1.0 X-EMS-Proccessed: 6LP3oGfGVdcdb8o1aBnt6w== X-EMS-STAMP: 8OTcrnJkc9IMqcndEOHyqQ== 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 > On Fri, 2012-12-07 at 14:43 -0800, H.J. Lu wrote: > >> > I think you need a way to tell a bad register from a good register >> > which doesn't have DWARF register number. Here is a patch using your IGNORED_DWARF_REGNUM idea. Steve Ellcey sellcey@mips.com 2012-12-07 Steve Ellcey PR target/54061 * rtl.h (IGNORED_DWARF_REGNUM): New. * dwarfwout.c (reg_loc_descriptor): Check for IGNORED_DWARF_REGNUM. (mem_loc_descriptor): Ditto. * config/mips/mips.c (mips_option_override): Set mips_dbx_regno coprocessor entries to IGNORED_DWARF_REGNUM. diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index b6a2290..bc99f29 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -16757,6 +16757,9 @@ mips_option_override (void) for (i = FP_REG_FIRST; i <= FP_REG_LAST; i++) mips_dbx_regno[i] = i + start; + for (i = COP0_REG_FIRST; i <= COP3_REG_LAST; i++) + mips_dbx_regno[i] = IGNORED_DWARF_REGNUM; + /* Accumulator debug registers use big-endian ordering. */ mips_dbx_regno[HI_REGNUM] = MD_DBX_FIRST + 0; mips_dbx_regno[LO_REGNUM] = MD_DBX_FIRST + 1; diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index f0256ae..caedb5f 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -10473,6 +10473,9 @@ reg_loc_descriptor (rtx rtl, enum var_init_status initialized) if (REGNO (rtl) >= FIRST_PSEUDO_REGISTER) return 0; + if (dbx_reg_number(rtl) == IGNORED_DWARF_REGNUM) + return 0; + /* We only use "frame base" when we're sure we're talking about the post-prologue local stack frame. We do this by *not* running register elimination until this point, and recognizing the special @@ -11931,6 +11934,8 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode, break; if (REGNO (rtl) > FIRST_PSEUDO_REGISTER) break; + if (dbx_reg_number(rtl) == IGNORED_DWARF_REGNUM) + break; type_die = base_type_for_mode (mode, GET_MODE_CLASS (mode) == MODE_INT); if (type_die == NULL) @@ -12133,6 +12138,9 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode, return NULL; if (REG_P (ENTRY_VALUE_EXP (rtl))) { + if (dbx_reg_number (ENTRY_VALUE_EXP (rtl)) == IGNORED_DWARF_REGNUM) + return NULL; + if (GET_MODE_CLASS (mode) != MODE_INT || GET_MODE_SIZE (mode) > DWARF2_ADDR_SIZE) op0 = mem_loc_descriptor (ENTRY_VALUE_EXP (rtl), mode, diff --git a/gcc/rtl.h b/gcc/rtl.h index a0fb4f7..5b9ceb8 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -2439,6 +2439,9 @@ extern rtx gen_rtx_MEM (enum machine_mode, rtx); /* REGNUM never really appearing in the INSN stream. */ #define INVALID_REGNUM (~(unsigned int) 0) +/* REGNUM for which no debug information can be generated. */ +#define IGNORED_DWARF_REGNUM (INVALID_REGNUM - 1) + extern rtx output_constant_def (tree, int); extern rtx lookup_constant_def (tree);