[RFA][PR 41063] ICE in output_die

H.J. Lu hjl.tools@gmail.com
Fri Oct 22 07:35:00 GMT 2010


On Thu, Aug 27, 2009 at 4:10 PM, Cary Coutant <ccoutant@google.com> wrote:
>>> +          if (decl_function_context (TYPE_STUB_DECL (TREE_TYPE (type))))
>>
>> This doesn't seem like the right test; it will be true for a nested class
>> within a local class, which I don't think is what we want.
>
> Yes, I think you're right.
>
>> Also, it seems like we should be handling this issue in the ENUMERAL_TYPE
>> etc section, where we already have some code to adjust context_die, rather
>> than in the POINTER_TYPE section.  I guess we just need a function scope
>> case; the current code seems to assume that a type has either class or
>> namespace scope.
>
> OK, here's another stab at it. This patch adds a check for the
> function scope case (but only the immediate context) and calls
> lookup_decl_die on the function decl to set context_die. If a DIE for
> that function hasn't been created yet, it'll use NULL and do the right
> thing later when the function DIE does get written.
>
> This bootstraps on x86_64-linux. The test suite is still running, but
> it looks good so far. Assuming it finishes clean, does this look OK?
>
> -cary
>
>
> gcc/ChangeLog:
>
>        PR debug/41063
>        * dwarf2out.c (gen_type_die_with_usage): Use proper context for
>        struct/union/enum types local to a function.
>

This caused:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46123


-- 
H.J.



More information about the Gcc-patches mailing list