[Bug debug/33429] debug info for class2 in g++.dg/other/unused1.C requires -femit-class-debug-always

jason at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Oct 15 18:30:00 GMT 2008



------- 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



More information about the Gcc-bugs mailing list