From patchwork Wed Jun 9 19:12:23 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 55120 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 A3EA4B7D59 for ; Thu, 10 Jun 2010 05:12:39 +1000 (EST) Received: (qmail 21746 invoked by alias); 9 Jun 2010 19:12:38 -0000 Received: (qmail 21732 invoked by uid 22791); 9 Jun 2010 19:12:37 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM X-Spam-Check-By: sourceware.org Received: from mail-wy0-f175.google.com (HELO mail-wy0-f175.google.com) (74.125.82.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 09 Jun 2010 19:12:31 +0000 Received: by wyi11 with SMTP id 11so577492wyi.20 for ; Wed, 09 Jun 2010 12:12:29 -0700 (PDT) Received: by 10.227.141.200 with SMTP id n8mr8038447wbu.200.1276110748762; Wed, 09 Jun 2010 12:12:28 -0700 (PDT) Received: from localhost ([82.133.89.107]) by mx.google.com with ESMTPS id b14sm3421946wbb.5.2010.06.09.12.12.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 09 Jun 2010 12:12:27 -0700 (PDT) From: Richard Sandiford To: Dodji Seketeli Mail-Followup-To: Dodji Seketeli , Jason Merrill , gcc-patches@gcc.gnu.org, rdsandiford@googlemail.com Cc: Jason Merrill , gcc-patches@gcc.gnu.org Subject: Re: [RFC] PR c++/44188 References: <20100520110538.GR29186@redhat.com> <4BF575DA.8030108@redhat.com> <20100521121623.GU29186@redhat.com> <4BF6A896.3060703@redhat.com> <4BFBED4E.6030306@redhat.com> <4BFC92CD.9030702@redhat.com> <4BFD3CFA.8080908@redhat.com> <4BFD6192.2020807@redhat.com> Date: Wed, 09 Jun 2010 20:12:23 +0100 In-Reply-To: (Dodji Seketeli's message of "Sat, 05 Jun 2010 21:58:55 +0200") Message-ID: <871vcg2f6w.fsf@firetop.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 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 Dodji Seketeli writes: > commit d2c243d43b4809c72f4c9ed06caf4f382cf7fddf > Author: dodji > Date: Thu May 27 19:29:53 2010 +0000 > > Fix PR c++/44188 > > gcc/ChangeLog: > PR c++/44188 > * c-common.c (is_typedef_decl): Move this definition ... > * tree.c (is_typedef_decl): ... here. > (typdef_variant_p): Move definition here from gcc/cp/tree.c. > * c-common.h (is_typedef_decl): Move this declaration ... > * tree.h (is_typedef_decl): ... here. > (typedef_variant_p): Move declaration here from gcc/cp/cp-tree.h > * dwarf2out.c (is_naming_typedef_decl): New function. > (gen_tagged_type_die): Split out of ... > (gen_type_die_with_usage): ... this function. When an anonymous > tagged type is named by a typedef, make sure a DW_TAG_typedef DIE > is emitted for the typedef. > (gen_typedef_die): Emit DW_TAG_typedef also for typedefs naming > anonymous tagged types. > > gcc/cp/ChangeLog: > PR c++/44188 > * cp-tree.h (typedef_variant_p): Move this declaration to > gcc/tree.h. > * tree.c (typedef_variant_p): Move this definition to gcc/tree.c. > * decl.c (grokdeclarator): Do not rename debug info of an > anonymous tagged type named by a typedef. > > gcc/testsuite/ChangeLog: > PR c++/44188 > * g++.dg/debug/dwarf2/typedef3.C: New test. This breaks builds of libstdc++-v3 on mipsisa64-elf, where __builtin_va_list is a record type. We end up trying to output a location for the definition of __builtin_va_list, which has location UNKNOWN_LOCATION. We then segfault in lookup_filename because the filename associated with UNKNOWN_LOCATION is null. Testcase is: typedef __builtin_va_list foo; compiled with "./cc1plus -g". A simple "fix" is attached, but many other built-in decls use UNKNOWN_LOCATION, so I suspect something more fundamental is wrong. Could you have a look? Thanks, Richard Index: gcc/c-family/c-common.c =================================================================== --- gcc/c-family/c-common.c (revision 160501) +++ gcc/c-family/c-common.c (working copy) @@ -4918,7 +4918,7 @@ unsigned_ptrdiff_type_node = c_common_unsigned_type (ptrdiff_type_node); lang_hooks.decls.pushdecl - (build_decl (UNKNOWN_LOCATION, + (build_decl (BUILTINS_LOCATION, TYPE_DECL, get_identifier ("__builtin_va_list"), va_list_type_node)); if (targetm.enum_va_list)