From patchwork Fri May 25 22:29:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cary Coutant X-Patchwork-Id: 161433 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 9F013B6EEC for ; Sat, 26 May 2012 08:29:46 +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=1338589786; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Received:Received:To:Subject:Message-Id:Date: From:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=Y3OOicF SldrvjpLha6quhjIKOkA=; b=K4HWWgGsXXWCu+wscquHyi3q5rzpqNl8mDmE8Yp pXmIH+A0k39SdsrI++GcsWsw1l791Sw3e6+oBwMcNNt+1gMCx1NxWPuI4JlLDmTR 6v0qyPbk0IA1IFbbDoElFBwJvUg3hC1r+nza++AZw0iAiGeTYDXARM7HTyKnmEBS QY1Q= 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-Google-DKIM-Signature:Received:Received:Received:Received:Received:To:Subject:Message-Id:Date:From:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=SIuJwQJivwil+L3BUX4p8lx8U4hx2ytThAl7mGnqHVzlJmEDM/pDgmaX/5RGW+ Rpkm1fMe6Y6tzCPP0G97qxERVkPjyyPd1WsO6xQfTMAgmhrYaw+fKr3Nn/Qrf6/2 jR84lqrJwNFbYAvx5LNA6SwT5tZLFLE1bLG8ToxZEcNjw=; Received: (qmail 2804 invoked by alias); 25 May 2012 22:29:43 -0000 Received: (qmail 2794 invoked by uid 22791); 25 May 2012 22:29:42 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-ee0-f73.google.com (HELO mail-ee0-f73.google.com) (74.125.83.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 25 May 2012 22:29:29 +0000 Received: by eekd41 with SMTP id d41so79133eek.2 for ; Fri, 25 May 2012 15:29:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=to:subject:message-id:date:from:x-gm-message-state; bh=Jc0cOgFMvXSAfdU9xkvQbrUSiYcdQyv6Ue7qVz8rdVo=; b=LFDl9quEXrUdZyTjAm6sfaQFWXl8GV2sGNIyWgzKGevXFC1G9YbGKTdvQNXkyEXQtO gEs2BkYYRMJ6ukJha2KO+KLL85B4EGA3FHdXeYwETo65xob5tbex/X3vT3oLZRa27EZ5 K0VhhGdShYlz0jNHjWbSvhA8w84ScQMvTHoVj05LdfLqxdffLkq4pLuYYRbyxCdWZ7t2 KW9kKaVVj/zWaj+OBfRCpxdyYkFR/uiZ2H48W3w1g0lzoNRho3y6wDjM9o14irxVlX0m /qB7ZzgpCySEFqdzBote8RDgsc618wPrDKUHafeY0p8Fzkuml+gJKCPI1pZ64MzRDEIc 80GQ== Received: by 10.14.39.132 with SMTP id d4mr210920eeb.11.1337984968807; Fri, 25 May 2012 15:29:28 -0700 (PDT) Received: by 10.14.39.132 with SMTP id d4mr210917eeb.11.1337984968736; Fri, 25 May 2012 15:29:28 -0700 (PDT) Received: from hpza9.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id b15si3277708een.0.2012.05.25.15.29.28 (version=TLSv1/SSLv3 cipher=AES128-SHA); Fri, 25 May 2012 15:29:28 -0700 (PDT) Received: from ccoutant.mtv.corp.google.com (ccoutant.mtv.corp.google.com [172.18.110.42]) by hpza9.eem.corp.google.com (Postfix) with ESMTP id 890B15C0050; Fri, 25 May 2012 15:29:28 -0700 (PDT) Received: by ccoutant.mtv.corp.google.com (Postfix, from userid 62097) id CD5AEE0A2C; Fri, 25 May 2012 15:29:27 -0700 (PDT) To: reply@codereview.appspotmail.com, dnovillo@google.com, gcc-patches@gcc.gnu.org Subject: [google/gcc-4_6] Fix -gfission ICEs with pubnames and .debug_addr table (issue6254054) Message-Id: <20120525222927.CD5AEE0A2C@ccoutant.mtv.corp.google.com> Date: Fri, 25 May 2012 15:29:27 -0700 (PDT) From: ccoutant@google.com (Cary Coutant) X-Gm-Message-State: ALoCoQmT3U7hKFR2JZ6vEhNchD5aivbN1J8VFIQoNSiWktXI6I4c/+a2OiZnqsX8eLbsq0l6eIvoaJlIxS0y6bgEJoA/Z5Ne7v4QNmRGZbifWS+nJK0ZBvvdtFLvyXKpEER2m5mDtkoKRnN5MafkIi3rAIYLqFlbJQ== 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 This patch is for the google/gcc-4_6 branch. It fixes a problem where we were still trying to output entries in the .debug_addr table for location lists that were removed, and fixes a problem where we were getting an ICE while trying to output a pubname for a member function of a struct. Tested with the GCC testsuite and validate-failures.py, and also with an internal Google build with -gfission enabled. 2012-05-25 Sterling Augustine Cary Coutant * gcc/dwarf2out.c (remove_loc_list_addr_table_entries): New function. (is_class_die): Return TRUE for DW_TAG_structure_type. (resolve_addr): Remove address table entries when replacing a location list. --- This patch is available for review at http://codereview.appspot.com/6254054 Index: gcc/dwarf2out.c =================================================================== --- gcc/dwarf2out.c (revision 187887) +++ gcc/dwarf2out.c (working copy) @@ -7864,6 +7864,19 @@ remove_addr_table_entry (unsigned int i) attr->dw_attr = (enum dwarf_attribute) 0; } +/* Given a location list, remove all addresses it refers to from the + address_table. */ + +static void +remove_loc_list_addr_table_entries (dw_loc_list_ref loc) +{ + dw_loc_descr_ref descr; + + for (descr = loc->expr; descr; descr = descr->dw_loc_next) + if (descr->dw_loc_oprnd1.val_index != -1U) + remove_addr_table_entry (descr->dw_loc_oprnd1.val_index); +} + /* Add an address constant attribute value to a DIE. */ static inline void @@ -10033,7 +10046,8 @@ is_namespace_die (dw_die_ref c) static inline bool is_class_die (dw_die_ref c) { - return c && c->die_tag == DW_TAG_class_type; + return c && (c->die_tag == DW_TAG_class_type + || c->die_tag == DW_TAG_structure_type); } static char * @@ -23788,15 +23802,13 @@ resolve_addr (dw_die_ref die) if (!resolve_addr_in_expr ((*curr)->expr)) { dw_loc_list_ref next = (*curr)->dw_loc_next; - dw_loc_descr_ref l = (*curr)->expr; if (next && (*curr)->ll_symbol) { gcc_assert (!next->ll_symbol); next->ll_symbol = (*curr)->ll_symbol; } - if (l->dw_loc_oprnd1.val_index != -1U) - remove_addr_table_entry (l->dw_loc_oprnd1.val_index); + remove_loc_list_addr_table_entries (*curr); *curr = next; } else