[RFC] PR c++/44188

H.J. Lu hjl.tools@gmail.com
Thu May 27 23:07:00 GMT 2010


On Wed, May 26, 2010 at 10:53 AM, Dodji Seketeli <dodji@redhat.com> wrote:
> Jason Merrill <jason@redhat.com> writes:
>
>> On 05/26/2010 08:32 AM, Dodji Seketeli wrote:
>>> +  /* If type is an anonymous tagged type named by a typedef, let's
>>> +     generate debug info fo the typedef.  */
>>> +  if (is_naming_typedef_decl (TYPE_NAME (type))
>>> +      /* Avoid the infinite recursion between this function (via
>>> +     gen_type_decl) and the TYPE_DECL case in gen_decl_die.  */
>>> +      && !is_redundant_typedef (TYPE_NAME (type)))
>>
>> is_naming_typedef_decl should not be returning true for a redundant typedef.
>>
>> Also, s/fo/for/.
>
> This is the updated patch I am testing.
>
> commit ab2592303c5a4b8fdd71d30ded63a1ff9273b15c
> Author: Dodji Seketeli <dodji@redhat.com>
> Date:   Tue May 25 14:00:08 2010 +0200
>
>    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 patch may have broken bootstrap on Linux/ia32:

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

-- 
H.J.



More information about the Gcc-patches mailing list