[Bug debug/54508] Wrong debug information emitted if data members not referenced

paul_koning at dell dot com gcc-bugzilla@gcc.gnu.org
Thu Sep 13 21:22:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54508

--- Comment #1 from Paul Koning <paul_koning at dell dot com> 2012-09-13 21:21:58 UTC ---
I spent some time trying to figure this out.  The offending code seems to be
the prune_unused_types machinery.  

If there is a reference to a static method, but no other references to parts of
the class, then the class is treated as unused.  However, the static method
does cause the class name to be emitted in the dwarf output.  But because of
the fact that it is treated as unused, nothing else about the class is emitted.

This messes up code that consumes the debug data, because it now looks like the
class IS defined there, but most of its substance is missing.

Meanwhile, I noticed a documentation bug: the documentation for
-feliminate-unused-debug-types says that this switch is off by default.  That
is no longer true, it is on by default.  If I turn it off, the
prune_unused_types machinery is suppressed and I get valid debug output. 
Unfortunately, it is also so much larger that my builds run very slowly and
some binaries grow by as much as a factor of 5.



More information about the Gcc-bugs mailing list