------- Comment #8 from drow at gcc dot gnu dot org 2006-08-26 03:48 ------- My fix was completely wrong. I'll try again.
The problem is that we have function f class s static function g We never walk into f. So we never find out that it contains g, and g needs a DIE. Normally, if there's a function in a class and we generate a definition, the body is outside of that class. But that transformation is deliberately suppressed for function local classes, in gen_subprogram_die (search for context_die == NULL). We need to walk into classes looking for definitions which were emitted. I think that skipping class member variables and declarations would suffice, but that requires a bit of a rewrite of the marking code, which currently doesn't do attribute checks. We wouldn't want to do the declaration check outside of classes. There seem to be no tests in the testsuite which cover omitting unused structure types from debug information. My first test patch broke eliminating unused structures completely and nothing caught that except hand checking. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27017