This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] PR c++/44188
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: Dodji Seketeli <dodji at redhat dot com>
- Cc: Jason Merrill <jason at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 09 Jun 2010 20:12:23 +0100
- Subject: Re: [RFC] PR c++/44188
- References: <20100520110538.GR29186@redhat.com> <4BF575DA.8030108@redhat.com> <20100521121623.GU29186@redhat.com> <4BF6A896.3060703@redhat.com> <m3bpc4t9i8.fsf@redhat.com> <4BFBED4E.6030306@redhat.com> <m3wrurirj0.fsf@redhat.com> <4BFC92CD.9030702@redhat.com> <m3mxvmhmij.fsf@redhat.com> <4BFD3CFA.8080908@redhat.com> <m3r5kyczxp.fsf@redhat.com> <4BFD6192.2020807@redhat.com> <m3pr05xncw.fsf@redhat.com>
Dodji Seketeli <dodji@redhat.com> writes:
> commit d2c243d43b4809c72f4c9ed06caf4f382cf7fddf
> Author: dodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>
> 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)