------- Comment #1 from jakub at gcc dot gnu dot org  2010-07-27 08:29 -------
So, to add c1's type, we call gen_typedef_with_usage with A typedef variant.
19880  /* If TYPE is a typedef type variant, let's generate debug info
19881     for the parent typedef which TYPE is a type of.  */
19882  if (typedef_variant_p (type))
19883    {
19884      if (TREE_ASM_WRITTEN (type))
19885        return;
19886
19887      /* Prevent broken recursion; we can't hand off to the same type.  */
19888      gcc_assert (DECL_ORIGINAL_TYPE (TYPE_NAME (type)) != type); 
19889
19890      /* Use the DIE of the containing namespace as the parent DIE of
19891         the type description DIE we want to generate.  */
19892      if (DECL_CONTEXT (TYPE_NAME (type))
19893          && TREE_CODE (DECL_CONTEXT (TYPE_NAME (type))) ==
NAMESPACE_DECL)
19894        context_die = get_context_die (DECL_CONTEXT (TYPE_NAME (type)));
19895
19896      TREE_ASM_WRITTEN (type) = 1;
19897
19898      gen_decl_die (TYPE_NAME (type), NULL, context_die); 
19899      return;

TREE_ASM_WRITTEN is not set on type originally, we compute context_die.  Then
set TREE_ASM_WRITTEN and call gen_decl_die.  TYPE_NAME (type) is a redundant
typedef though, so in gen_decl_die:
20544      if (is_redundant_typedef (decl))
20545        gen_type_die (TREE_TYPE (decl), context_die);
and TREE_TYPE (decl) here is the type on which we've just set TREE_ASM_WRITTEN,
so gen_type_die_with_usage is recursed with the same type and as
TREE_ASM_WRITTEN is now already set, it returns immediately, without creating
any type.  So, I think we need to special case is_redundant_typedef (TYPE_NAME
(type))) in gen_type_die_with_usage in the typedef_variant_p (type) handling
and ensure we actually create the DECL_ORIGINAL_TYPE in that case and equate
that also to the underlying type.  Or this could be a bug in the FE.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu dot
                   |                            |org, dodji at gcc dot gnu
                   |                            |dot org


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

Reply via email to