This is introduced by the new type merging code jh@evans:~> /abuild/jh/trunk-install/bin/g++ -r -nostdlib -Os -g ~/d?.ii -fwhopr In file included from ../../../dist/include/nsThreadUtils.h:49:0, from /abuild/jh/mozilla-central/accessible/src/base/a11yGeneric.h:42, from /abuild/jh/mozilla-central/accessible/src/base/nsAccessNode.h:49, from /abuild/jh/mozilla-central/accessible/src/base/../atk/nsAccessNodeWrap.h:46, from /abuild/jh/mozilla-central/accessible/src/base/nsAccessible.h:42, from /abuild/jh/mozilla-central/accessible/src/base/../atk/nsAccessibleWrap.h:46, from /abuild/jh/mozilla-central/accessible/src/base/../html/nsHyperTextAccessible.h:48, from /abuild/jh/mozilla-central/accessible/src/base/../atk/nsHyperTextAccessibleWrap.h:42, from /abuild/jh/mozilla-central/accessible/src/base/nsARIAGridAccessible.h:44, from /abuild/jh/mozilla-central/accessible/src/base/nsARIAGridAccessible.cpp:39: ../../../dist/include/nsAutoPtr.h: In member function ‘void nsAutoPtr<T>::assign(T*) [with T = AccGroupInfo]’: ../../../dist/include/nsAutoPtr.h:134:11: instantiated from ‘nsAutoPtr<T>& nsAutoPtr<T>::operator=(T*) [with T = AccGroupInfo]’ /abuild/jh/mozilla-central/accessible/src/base/nsAccessible.h:332:18: instantiated from here ../../../dist/include/nsAutoPtr.h:71:11: warning: possible problem detected in invocation of delete operator: [enabled by default] ../../../dist/include/nsAutoPtr.h:69:14: warning: ‘oldPtr’ has incomplete type [enabled by default] /abuild/jh/mozilla-central/accessible/src/base/nsAccessible.h:55:7: warning: forward declaration of ‘struct AccGroupInfo’ [enabled by default] ../../../dist/include/nsAutoPtr.h:71:11: note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined. lto1: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. lto-wrapper: /abuild/jh/trunk-install/bin/g++ returned 1 exit status collect2: lto-wrapper returned 1 exit status
Created attachment 21321 [details] testcase
Trying to reduce ... it happens only with whopr. Program received signal SIGSEGV, Segmentation fault. 0x00000000005d33ba in prune_unused_types_mark (die=0x0, dokids=1) at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:21729 21729 if (die->die_mark == 0) #1 0x00000000005d3349 in prune_unused_types_walk_attribs (die=0x7ffff5a12d68) at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:21711 21711 prune_unused_types_mark (a->dw_attr_val.v.val_die_ref.die, 1); (gdb) p a->dw_attr_val.v.val_die_ref $1 = {die = 0x0, external = 0} so we created a dw_val_class_die_ref attr with a null DIE. Which we do here: #1 0x00000000005c9c14 in add_pure_or_virtual_attribute (die=0x7ffff5a12d68, func_decl=0x7ffff55cd300) at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:17409 17407 if (debug_info_level > DINFO_LEVEL_TERSE 17408 && DECL_CONTEXT (func_decl)) 17409 add_AT_die_ref (die, DW_AT_containing_type, 17410 lookup_type_die (DECL_CONTEXT (func_decl))); where DECL_CONTEXT is a RECORD_TYPE. Supposedly the type is unused and thus doesn't get output. Note that we're arriving here via #5 0x0000000000c74a47 in expand_call_inline (bb=0x7ffff54782d8, stmt=0x7ffff52c89b0, id=0x7fffffffd970) at /space/rguenther/src/svn/trunk/gcc/tree-inline.c:4024 4024 (*debug_hooks->outlining_inline_function) (cg_edge->callee->decl);
So the issue may be that the LTO FE doesn't announce any decls to the debug machinery. > grep debug_hooks cp/*.c cp/decl.c: debug_hooks->type_decl (tdecl, 0); cp/decl.c: /*debug_hooks->set_name (t, decl);*/ cp/name-lookup.c: (*debug_hooks->global_decl) (alias); cp/name-lookup.c: (*debug_hooks->imported_module_or_decl) (name_space, NULL_TREE, cp/name-lookup.c: (*debug_hooks->imported_module_or_decl) (t, NULL_TREE, context, false); cp/optimize.c: (*debug_hooks->deferred_inline_function) (fn);
Subject: Re: -Os -g -fwhopr dwarf2out ICE > So the issue may be that the LTO FE doesn't announce any decls to the debug > machinery. Because they are already announced before streaming ;). I am not at all familiar with this, can we just announce every type streamed in? Or do we need to stream whatever frontend did? deferred_inline_function should be all fine. Honza
Well - I have no idea ;) We can look at what the FE announces after I finished testcase reduction.
Created attachment 21325 [details] testcase > g++ -r -nostdlib -O[s23] -g -flto d2.3.3.C d3.3.3.C The key is that nsAccessible are not merged because one instance has a complete nsRoleMapEntry while the other one an incomplete one.
Reconfirmed. Probably major show stopper for mozilla now as there is no workaround.
I have a patch.
Excellent! If you send me this patch and path for the other Mozilla -g PR, I will give them a try on full Mozilla build.
See the URL.
Author: rguenth Date: Thu Nov 18 14:11:00 2010 New Revision: 166904 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=166904 Log: 2010-11-18 Richard Guenther <rguenther@suse.de> PR lto/45089 * dwarf2out.c (add_AT_die_ref): Work around LTO losing types when checking is not enabled. Modified: trunk/gcc/ChangeLog trunk/gcc/dwarf2out.c
Now ice-checking only.
Confirmed that mozilla now builds with debug info.
Would be interesting to see if (with checking enabled) the ICE still happens on trunk.
Assuming fixed.