This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch dwarf]: PR/47209 Segfault in should_emit_struct_debug
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Kai Tietz <ktietz70 at googlemail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>
- Date: Wed, 12 Jan 2011 11:04:39 +0100
- Subject: Re: [patch dwarf]: PR/47209 Segfault in should_emit_struct_debug
- References: <AANLkTimEo-nNaXbcpbzAjEWKVSRTnyW17Ruu5jtuXikO@mail.gmail.com>
On Tue, Jan 11, 2011 at 9:58 PM, Kai Tietz <ktietz70@googlemail.com> wrote:
> Hello,
>
> following patch fixes reported segfault at
>
> ChangeLog
>
> 2011-01-11 ?Kai Tietz
>
> ? ? ? ? ?PR debug/47209
> ? ? ? ? ?* dwarfout2.c (should_emit_struct_debug): Use TYPE_MAIN_VARIANT
> ? ? ? ? ?of type.
>
> Tested for x86_64-pc-linux-gnu and x86_64-pc-mingw32. Ok for apply?
>
> Regards,
> Kai
>
> --
>
> Index: dwarf2out.c
> ===================================================================
> --- dwarf2out.c (revision 168679)
> +++ dwarf2out.c (working copy)
> @@ -619,7 +619,7 @@
> ? if (criterion == DINFO_STRUCT_FILE_ANY)
> ? ? return DUMP_GSTRUCT (type, usage, criterion, generic, false, true);
>
> - ?type_decl = TYPE_STUB_DECL (type);
> + ?type_decl = TYPE_STUB_DECL(TYPE_MAIN_VARIANT(type));
Why? That will go to the non-type-decl variant, so it seems wrong.
Richard.
>
> ? if (criterion == DINFO_STRUCT_FILE_SYS && DECL_IN_SYSTEM_HEADER (type_decl))
> ? ? return DUMP_GSTRUCT (type, usage, criterion, generic, false, true);
>