http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60060
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org --- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> --- wrapup_global_declarations looks like it's a no-op in LTO (DECL_DEFER_OUTPUT is always false). I am testing the following which avoids (re-)outputting debuginfo for local statics. Index: gcc/lto/lto-lang.c =================================================================== --- gcc/lto/lto-lang.c (revision 207658) +++ gcc/lto/lto-lang.c (working copy) @@ -1082,17 +1082,11 @@ lto_write_globals (void) if (flag_wpa) return; - /* Record the global variables. */ - vec<tree> lto_global_var_decls = vNULL; + /* Output debug info for global variables. */ varpool_node *vnode; FOR_EACH_DEFINED_VARIABLE (vnode) - lto_global_var_decls.safe_push (vnode->decl); - - tree *vec = lto_global_var_decls.address (); - int len = lto_global_var_decls.length (); - wrapup_global_declarations (vec, len); - emit_debug_global_declarations (vec, len); - lto_global_var_decls.release (); + if (!decl_function_context (vnode->decl)) + debug_hooks->global_decl (vnode->decl); } static tree