Created attachment 23727 [details] Testcase (compile with `g++ -flto -g pr48207.cc')
Created attachment 23728 [details] Backtrace
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 ().
*** Bug 48346 has been marked as a duplicate of this bug. ***
Alternative testcase (g++ -flto -g): namespace { typedef struct { int x; } Foo; }
*** Bug 48505 has been marked as a duplicate of this bug. ***
Author: rguenth Date: Tue Apr 19 13:04:57 2011 New Revision: 172708 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=172708 Log: 2011-04-19 Richard Guenther <rguenther@suse.de> PR lto/48207 * tree.c (free_lang_data): Do not reset the decl-assembler-name langhook. * g++.dg/lto/pr48207_0.C: New testcase. Added: trunk/gcc/testsuite/g++.dg/lto/pr48207_0.C Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree.c
Fixed for trunk sofar.
*** Bug 49041 has been marked as a duplicate of this bug. ***
Author: rguenth Date: Wed May 18 13:29:24 2011 New Revision: 173860 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=173860 Log: 2011-05-18 Richard Guenther <rguenther@suse.de> Backport from mainline 2011-04-19 Richard Guenther <rguenther@suse.de> PR lto/48207 * tree.c (free_lang_data): Do not reset the decl-assembler-name langhook. * g++.dg/lto/pr48207_0.C: New testcase. 2011-04-21 Richard Guenther <rguenther@suse.de> PR lto/48703 * tree.c (free_lang_data_in_decl): Do not zero TREE_TYPE of DECL_NAME. * g++.dg/lto/pr48207-2_0.C: New testcase. * g++.dg/lto/pr48207-3_0.C: Likewise. Added: branches/gcc-4_6-branch/gcc/testsuite/g++.dg/lto/pr48207-2_0.C branches/gcc-4_6-branch/gcc/testsuite/g++.dg/lto/pr48207-3_0.C branches/gcc-4_6-branch/gcc/testsuite/g++.dg/lto/pr48207_0.C Modified: branches/gcc-4_6-branch/gcc/ChangeLog branches/gcc-4_6-branch/gcc/testsuite/ChangeLog branches/gcc-4_6-branch/gcc/tree.c
Fixed for 4.6.1.
*** Bug 49056 has been marked as a duplicate of this bug. ***
*** Bug 49424 has been marked as a duplicate of this bug. ***