This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug debug/33429] debug info for class2 in g++.dg/other/unused1.C requires -femit-class-debug-always
- From: "jason at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Oct 2008 18:28:56 -0000
- Subject: [Bug debug/33429] debug info for class2 in g++.dg/other/unused1.C requires -femit-class-debug-always
- References: <bug-33429-507@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from jason at gcc dot gnu dot org 2008-10-15 18:28 -------
Contra Mark, this seems like a WONTFIX to me.
g++ assumes that if a class has a vtable, if we're going to do anything with it
we'll create an object of that type at some point, which will use the vtable,
and so we'll get the debug info.
This seems like a reasonable assumption to me; the only time it will be invalid
is with trivial examples like this. No real code would try to cast to class2*
when nothing in the program ever creates a class2. And if the user is doing
something funny, there's the -femit-class-debug-always flag.
In this case, we aren't omitting debug info for class2 because it's unused,
we're omitting it because we know we'll emit it elsewhere.
I think adding the -femit-class-debug-always flag to the testcase is the
correct fix for the testsuite failure; changing the compiler to emit debug
information more frequently would create a regression in debug info size.
--
jason at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33429