This is the mail archive of the
mailing list for the GCC project.
Re: [patch] ICE with combination of -openmp and -femit-struct-debug-reduced/baseonly
- From: Cary Coutant <ccoutant at google dot com>
- To: Evgeny Gavrin <evgeny dot gavrin at hotmail dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Slava Zhe <slava dot garbuzov at gmail dot com>
- Date: Tue, 2 Jul 2013 13:54:14 -0700
- Subject: Re: [patch] ICE with combination of -openmp and -femit-struct-debug-reduced/baseonly
- References: <SNT138-W193F68E0F5D4EB4A7FFCACE2720 at phx dot gbl>
> I've find out that compiler may crash with SEGFAULT on some openmp-enabled code (attached as debug-1.c) called with the following flags:
> -g -fopenmp -gdwarf-2 -femit-struct-debug-reduced
> Also, can be reproduced with -femit-struct-debug-baseonly
> The problem is in dwarf2out.c:350:should_emit_struct_debug() at this line:
> 366 type_decl = TYPE_STUB_DECL (TYPE_MAIN_VARIANT (type));
> In some cases type_decl can be NULL and this causes ICE in the following code:
> 368 if (criterion == DINFO_STRUCT_FILE_SYS && DECL_IN_SYSTEM_HEADER (type_decl))
> 369 return DUMP_GSTRUCT (type, usage, criterion, generic, false, true);
> 371 if (matches_main_base (DECL_SOURCE_FILE (type_decl)))
> 372 return DUMP_GSTRUCT (type, usage, criterion, generic, true, true);
> Can be fixed with checking for type_decl is not NULL.
> I've attached patch to fix this. Could you check, is it ok?
The patch looks OK to me.
Do you have a copyright assignment on file with FSF? For a patch this
size, I don't think you need one, but I'd appreciate confirmation from
the more legally-inclined (Danny, Ian?). Do you need someone to commit
it for you?
> This is very straightforward fix, can the problem be in incorrect debug info generation on early stages?
Sorry, I'm not sure what you're asking here.