This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: [patch] ICE with combination of -openmp and -femit-struct-debug-reduced/baseonly
- From: Evgeny Gavrin <evgeny dot gavrin at hotmail dot com>
- To: Cary Coutant <ccoutant at google 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: Wed, 3 Jul 2013 18:54:57 +0000
- Subject: RE: [patch] ICE with combination of -openmp and -femit-struct-debug-reduced/baseonly
- References: <SNT138-W193F68E0F5D4EB4A7FFCACE2720 at phx dot gbl>,<CAHACq4r9q+jYXf+UnwMVpT5Htdtjw1rSExgbBXSQqt2w2AW2Ng at mail dot gmail dot com>
> Do you have a copyright assignment on file with FSF?
Signed form was already received by the copyright clerk. So I hope I'll be able to commit by myself soon.
/*
With optimism,
Evgeny Gavrin
email : evgeny.gavrin@hotmail.com
*/
----------------------------------------
> Date: Tue, 2 Jul 2013 13:54:14 -0700
> Subject: Re: [patch] ICE with combination of -openmp and -femit-struct-debug-reduced/baseonly
> From: ccoutant@google.com
> To: evgeny.gavrin@hotmail.com
> CC: gcc-patches@gcc.gnu.org; slava.garbuzov@gmail.com
>
>> 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);
>> 370
>> 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.
>
> -cary