From patchwork Fri Apr 24 21:34:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 464420 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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D39261402D1 for ; Sat, 25 Apr 2015 07:34:28 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=wXlLb5kU; dkim-adsp=none (unprotected policy); dkim-atps=neutral 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:subject:content-type; q= dns; s=default; b=S4Ihor0rhMpVHU9fWv5w3wkhXDKosB+svLpJfEQ6w/Wuys LciE7EQMiCg/jVJmEGIn8bjsEY9Z1kB2nOdHPJRhvJtpLvmCWCaJ9TrMHuf2Jfur uH0t7CH5kE6+Niv8VaSCCjEDiZcD+S4DvhQdNlJAN+ox475Ouvgd8rjHoCjPw= 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:subject:content-type; s= default; bh=m12ZDsyOWIooSKTTqWufAq4+9Gw=; b=wXlLb5kU3w8gZVrQ/rhu bhuH8tDtYNefHCJR4WJq2g3YjLjskTLJQuZGWnqtPfxOlIbYeFaVsSFyZgEbh8eR 4OWv9EufM4CYcg2TtRYC5FWiDZRsmgz9t6cZ+8BXsX1UMM1xeu1DYa5TBjclrh1N WPhGUpKN9sNz94x/4Op0N88= Received: (qmail 108854 invoked by alias); 24 Apr 2015 21:34:19 -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 108835 invoked by uid 89); 24 Apr 2015 21:34:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 24 Apr 2015 21:34:17 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t3OLYGQO028994 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 24 Apr 2015 17:34:16 -0400 Received: from reynosa.quesejoda.com (vpn-48-200.rdu2.redhat.com [10.10.48.200]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3OLYFEg010760 for ; Fri, 24 Apr 2015 17:34:15 -0400 Message-ID: <553AB6D6.6030205@redhat.com> Date: Fri, 24 Apr 2015 14:34:14 -0700 From: Aldy Hernandez User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: gcc-patches Subject: [debug-early] make gen_typedef_die gracefully handle error marks Now that we call dwarf2out earlier in the compilation process, we may get some error_mark_node's. And of course, nobody likes an ICE... Committed to branch. commit 92437112d3d4966eecb31df59a6fa4a1014a198c Author: Aldy Hernandez Date: Fri Apr 24 14:24:09 2015 -0700 Make gen_typedef_die handle a type of error_mark_node. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 39046f5..11bbade 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -20617,6 +20617,9 @@ gen_typedef_die (tree decl, dw_die_ref context_die) { type = DECL_ORIGINAL_TYPE (decl); + if (type == error_mark_node) + return; + gcc_assert (type != TREE_TYPE (decl)); equate_type_number_to_die (TREE_TYPE (decl), type_die); } @@ -20624,6 +20627,9 @@ gen_typedef_die (tree decl, dw_die_ref context_die) { type = TREE_TYPE (decl); + if (type == error_mark_node) + return; + if (is_naming_typedef_decl (TYPE_NAME (type))) { /* Here, we are in the case of decl being a typedef naming