------- Comment #8 from geoffk at gcc dot gnu dot org 2006-08-28 20:44 -------
(In reply to comment #3) > Created an attachment (id=12037) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12037&action=view) [edit] > patch > > It looks like we should bite the bullet and let cgraph code to output the > debug > info.... I am testing the attached patch > It looks like this patch will prevent the output of debug information for variables that are optimized out, but that's wrong; the variables should be visible to the user in the debugger even if they are optimized away. I think the actual problem is that reference_to_unused in dwarf2out.c is checking TREE_USED and expecting all used variables to be output, but that doesn't seem to be happening in this case. Perhaps there is something in cgraph which can be called to ask if a variable is *really* going to be output? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27657