From patchwork Thu Jul 1 08:22:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 57492 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 22E2FB6EF2 for ; Thu, 1 Jul 2010 18:21:21 +1000 (EST) Received: (qmail 8224 invoked by alias); 1 Jul 2010 08:21:18 -0000 Received: (qmail 8213 invoked by uid 22791); 1 Jul 2010 08:21:17 -0000 X-SWARE-Spam-Status: No, hits=-6.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 01 Jul 2010 08:21:13 +0000 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o618L6DJ009358 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 1 Jul 2010 04:21:06 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [10.16.42.4]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o618L5Km029283 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 1 Jul 2010 04:21:05 -0400 Received: from tyan-ft48-01.lab.bos.redhat.com (tyan-ft48-01.lab.bos.redhat.com [127.0.0.1]) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4) with ESMTP id o618M5MZ005571; Thu, 1 Jul 2010 10:22:05 +0200 Received: (from jakub@localhost) by tyan-ft48-01.lab.bos.redhat.com (8.14.4/8.14.4/Submit) id o618M5tN005570; Thu, 1 Jul 2010 10:22:05 +0200 Date: Thu, 1 Jul 2010 10:22:05 +0200 From: Jakub Jelinek To: Jie Zhang Cc: Richard Guenther , Alexandre Oliva , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Do framep replacement even on RHS outside of MEM contexts (PR debug/44694) Message-ID: <20100701082205.GT25077@tyan-ft48-01.lab.bos.redhat.com> Reply-To: Jakub Jelinek References: <20100629143144.GM25077@tyan-ft48-01.lab.bos.redhat.com> <4C2C4E0F.8040405@codesourcery.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4C2C4E0F.8040405@codesourcery.com> User-Agent: Mutt/1.5.20 (2009-12-10) X-IsSubscribed: yes 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 Thu, Jul 01, 2010 at 04:13:03PM +0800, Jie Zhang wrote: > This patch caused ICE for arm-none-eabi target: > > internal compiler error: in arm_dbx_register_number, at > config/arm/arm.c:21155 > > when compiling thumb multilib libstdc++. Richard Earnshaw has already reported this in the PR, and here is my fix for that. I don't have any arm boxes, so will just test it on x86_64-linux and i686-linux (the PR44694 patch has been tested also on ppc/ppc64/s390/s390x btw), could you please test it on arm? Thanks. 2010-07-01 Jakub Jelinek PR debug/44694 * dwarf2out.c (reg_loc_descriptor): For eliminated arg_pointer_rtx or frame_pointer_rtx use DW_OP_fbreg offset DW_OP_stack_value. Jakub --- gcc/dwarf2out.c.jj 2010-07-01 08:45:55.000000000 +0200 +++ gcc/dwarf2out.c 2010-07-01 09:19:47.000000000 +0200 @@ -12999,6 +12999,26 @@ reg_loc_descriptor (rtx rtl, enum var_in if (REGNO (rtl) >= FIRST_PSEUDO_REGISTER) 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 + argument pointer and soft frame pointer rtx's. + Use DW_OP_fbreg offset DW_OP_stack_value in this case. */ + if ((rtl == arg_pointer_rtx || rtl == frame_pointer_rtx) + && eliminate_regs (rtl, VOIDmode, NULL_RTX) != rtl) + { + dw_loc_descr_ref result = NULL; + + if (dwarf_version >= 4 || !dwarf_strict) + { + result = mem_loc_descriptor (rtl, VOIDmode, initialized); + if (result) + add_loc_descr (&result, + new_loc_descr (DW_OP_stack_value, 0, 0)); + } + return result; + } + regs = targetm.dwarf_register_span (rtl); if (hard_regno_nregs[REGNO (rtl)][GET_MODE (rtl)] > 1 || regs)