This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/22034] New: [4.1 regression, ICE on valid] dwarf2
- From: "jan at etpmod dot phys dot tue dot nl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Jun 2005 13:11:07 -0000
- Subject: [Bug c++/22034] New: [4.1 regression, ICE on valid] dwarf2
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Consider the following reduction from a wxWidgets source module:
const char* GetAssertStackTrace()
{
struct StackDump
{
virtual void OnStackFrame() {}
const char* GetStackTrace() const;
};
StackDump dump;
return dump.GetStackTrace();
}
const char* stackTrace = GetAssertStackTrace();
Compiled with today's trunk with debugging enabled (-g), this gives:
jan@nbelvis:~/src/gcc-head $ g++ -g appbase.cpp
appbase.cpp:12: internal compiler error: tree check: expected class
?declaration?, have?type? (record_type) in lookup_decl_die, at dwarf2out.c:5457
Strangely enough, almost any change to the code above also fixes this problem:
removing the class declaration outside the function body, removing the empty
body of OnStackFrame, making that function non-virtual, adding a virtual
destructor (as one should), ...
--
Summary: [4.1 regression, ICE on valid] dwarf2
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jan at etpmod dot phys dot tue dot nl
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-suse-linux
GCC host triplet: i686-suse-linux
GCC target triplet: i686-suse-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22034