------- Additional Comments From dberlin at gcc dot gnu dot org 2004-12-31 22:46 ------- Okay. What really happens here is that the blocks aren't getting marked properly because we rearrange the block tree and then the used flags aren't set when the subblocks of a block are used (which is what we expect in the debug outputters).
However, marking the blocks properly (see the attached patch, which fixes dwarf-die-7) exposes bugs, and I really need someone like Jason to tell me what the heck is going on. The bug it exposes is as follows (and maybe the real bug is in the inliner, i've attached a testcase here). When we inline a C++ constructor that isn't going to be output, we get the following stuff: a block for the inlined constructor, with an abstract origin of: a decl named __comp_ctor with an abstract origin of: a decl named bad_typeid we call gen_inlined_subroutine_die on the block, which calls block_ultimate_origin. block_ultimate_origin returns *the __comp_ctor* decl. We call dwarf2out_abstract_function on the __comp_ctor decl, which outputs a die for the bad_typeid decl (which is the real origin). Then we try to add an abstract attribute for the *comp_ctor* decl, because that's what we think the ultimate origin of the block was. This aborts, because we have no die for that decl (because it's not the real ultimate origin of the block). When compiled with 3.4, we end up with a block for the inlined constructor, with an abstract origin of: a decl named bad_typeid Which works properly. I get the feeling that block_ultimate_origin of the block is supposed to be the same as it was in 3.4. But the documentation doesn't help me here. Jason, if you can tell me what the block_ultimate_origin of the block is supposed to really be (Ie is it correct or incorrect), i can fix this bug. You need to apply the patch to see the bug, because without the patch, we simply don't try to output an inlined subroutine die because the superblock isn't marked as used, etc. -- What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at redhat dot com Version|4.0.0 |3.4.4 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17924