http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55608
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2012-12-06 Ever Confirmed|0 |1 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> 2012-12-06 09:05:12 UTC --- One might argue that not including unused static(!) const vars that might come from headers in all TUs is a good thing - for debug info size, for example. Definitely debug info is already way too large - and we don't include optimized out functions either (so you cannot do inferior calls to them from the debugging session). I don't really see the difference between functions and variables here. Functions even don't print <optimized out> but just (gdb) start Temporary breakpoint 1 at 0x4004c4: file t.c, line 5. Starting program: /tmp/t Temporary breakpoint 1, main () at t.c:5 5 } (gdb) p foo No symbol "foo" in current context. (gdb) p foo () No symbol "foo" in current context. testcase: static int foo (void) { return 1; } int main() { return 0; } at least can we emit this info on unused stuff with -g3 only?