[Bug debug/48207] ICE in lhd_set_decl_assembler_name, at langhooks.c:158

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Mar 21 13:43:00 GMT 2011


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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
           Keywords|                            |lto
   Last reconfirmed|                            |2011.03.21 13:12:20
          Component|lto                         |debug
             Blocks|                            |47819
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-03-21 13:12:20 UTC ---
Confirmed, mine.

We are processing BLOCKs of the function which has the TYPE_DECL.

#10 0x000000000093b5a4 in decls_for_scope (stmt=0x7ffff5b7edc0, 
    context_die=0x7ffff7ef8140, depth=1)
    at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:20886
20886       process_scope_var (stmt, decl, NULL_TREE, context_die);
(gdb) p decl->base.code
$5 = TYPE_DECL

and we probably expect that a DIE was already created for it by
the FE:

  else if (TREE_CODE (decl_or_origin) == TYPE_DECL
           && TYPE_DECL_IS_STUB (decl_or_origin))
    die = lookup_type_die (TREE_TYPE (decl_or_origin));

...

  if (die != NULL && die->die_parent == NULL)
    add_child_die (context_die, die);

but we fall through to gen_decl_die.  Then we run into

              /* This is a GNU Extension.  We are adding a
                 DW_AT_linkage_name attribute to the DIE of the
                 anonymous struct TYPE.  The value of that attribute
                 is the name of the typedef decl naming the anonymous
                 struct.  This greatly eases the work of consumers of
                 this debug info.  */
              add_linkage_attr (lookup_type_die (type), decl);

which we barf on as we didn't create assembler-names for TYPE_DECLs
and we can't at this point (the FE isn't anymore).

Btw, LTO should override decl_assembler_name with a gcc_unreachable ().



More information about the Gcc-bugs mailing list