From patchwork Sat Apr 28 15:11:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 155664 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 9E494B6FE2 for ; Sun, 29 Apr 2012 01:11:41 +1000 (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=1336230701; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Date:From:To:Subject:Message-ID:Reply-To:MIME-Version: Content-Type:Content-Disposition:User-Agent:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=W6HRQ7s8KwhjrHuH72y1N2sDbBU=; b=q8LBB9B1b63lkv+jaiJkKITLQI64K1InSauYMrB8PKHSKXSEfbSDLOmv7MiSVU 5TK5hSjOcQjEntcnNLXKmGc9wL1UwcYVergZG2RxIUizY/gww0p5Ay9ng7DGKJky QeVxNb8WnsmuEqKRh49/3iq0cNao4HBgJ4wdKJptrvWQ4= 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-ExtLoop1:Received:Received:Date:From:To:Subject:Message-ID:Reply-To:MIME-Version:Content-Type:Content-Disposition:User-Agent:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=QVP+h7iOESHfPBXaHgTbqfOodwO8Dise9pwa7aWywvmzlCFKUyG75dbG0aRm08 QHSDJGQyjc807/3hfIZUPc7vy0seS8292BsMKoajW3MGQlc5m9YGQPoBziEyESmD 1gDHYN9p7dLAoVgvcATxUHuum9ZQb10trguZUOxVncveM=; Received: (qmail 30338 invoked by alias); 28 Apr 2012 15:11:35 -0000 Received: (qmail 30329 invoked by uid 22791); 28 Apr 2012 15:11:34 -0000 X-SWARE-Spam-Status: No, hits=-3.9 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, NO_DNS_FOR_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 28 Apr 2012 15:11:21 +0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 28 Apr 2012 08:11:14 -0700 X-ExtLoop1: 1 Received: from gnu-6.sc.intel.com ([10.3.194.135]) by orsmga002.jf.intel.com with ESMTP; 28 Apr 2012 08:11:14 -0700 Received: by gnu-6.sc.intel.com (Postfix, from userid 500) id 69017C1FA6; Sat, 28 Apr 2012 08:11:14 -0700 (PDT) Date: Sat, 28 Apr 2012 08:11:14 -0700 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Subject: PATCH: Properly handle arg_pointer and frame_pointer in DWARF output Message-ID: <20120428151113.GA5935@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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 Hi, arg_pointer and frame_pointer are handled as special cases in based_loc_descr. (plus:DI (reg/f:DI 16 argp) (const_int -20 [0xffffffffffffffec])) is perfectly valid when Pmode == DImode and DWARF2_ADDR_SIZE is 32bit with ptr_mode == SImode. This patch fixes ICE on the 2 testcases here. OK for trunk? Thanks. H.J. ---- gcc/ 2012-04-06 H.J. Lu PR debug/52857 * dwarf2out.c (mem_loc_descriptor): Allow arg_pointer_rtx and frame_pointer_rtx for based_loc_descr. gcc/testsuite/ 2012-04-06 H.J. Lu PR debug/52857 * gcc.target/i386/pr52857-1.c: New. * gcc.target/i386/pr52857-2.c: Likewise. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index ca88fc5..515a824 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -11655,6 +11657,8 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode, case REG: if (GET_MODE_CLASS (mode) != MODE_INT || (GET_MODE_SIZE (mode) > DWARF2_ADDR_SIZE + && rtl != arg_pointer_rtx + && rtl != frame_pointer_rtx #ifdef POINTERS_EXTEND_UNSIGNED && (mode != Pmode || mem_mode == VOIDmode) #endif @@ -11927,7 +11931,9 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode, case PLUS: plus: if (is_based_loc (rtl) - && GET_MODE_SIZE (mode) <= DWARF2_ADDR_SIZE + && (GET_MODE_SIZE (mode) <= DWARF2_ADDR_SIZE + || XEXP (rtl, 0) == arg_pointer_rtx + || XEXP (rtl, 0) == frame_pointer_rtx) && GET_MODE_CLASS (mode) == MODE_INT) mem_loc_result = based_loc_descr (XEXP (rtl, 0), INTVAL (XEXP (rtl, 1)), diff --git a/gcc/testsuite/gcc.target/i386/pr52857-1.c b/gcc/testsuite/gcc.target/i386/pr52857-1.c new file mode 100644 index 0000000..16fd78f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr52857-1.c @@ -0,0 +1,10 @@ +/* { dg-do compile { target { ! { ia32 } } } } */ +/* { dg-options "-g -O -mx32 -maddress-mode=long" } */ + +extern void get_BID128 (int *); +void +__bid128_div (void) +{ + int res; + get_BID128 (&res); +} diff --git a/gcc/testsuite/gcc.target/i386/pr52857-2.c b/gcc/testsuite/gcc.target/i386/pr52857-2.c new file mode 100644 index 0000000..879240a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr52857-2.c @@ -0,0 +1,8 @@ +/* { dg-do compile { target { ! { ia32 } } } } */ +/* { dg-options "-g -O -mx32 -maddress-mode=long" } */ + +void uw_init_context_1 (void *); +void _Unwind_ForcedUnwind (void) +{ + uw_init_context_1 (__builtin_dwarf_cfa ()); +}