> > This fixes the ICE seen in PR60060 which stems from us asking to > output debug-info for a function-scope global twice - once via > emitting the function and its BLOCK-associated vars and once > via the debug-hook through lto_write_globals -> > emit_debug_global_declarations. > > The list of "global" variables does not agree with those from > the frontends (that function-scope global is not in GFortrans list).
Yes, function scope statics are not supposed to be in the global list, only in the symbol table. > if (flag_wpa) > return; > > ! /* Output debug info for global variables. */ > varpool_node *vnode; > FOR_EACH_DEFINED_VARIABLE (vnode) > ! if (!decl_function_context (vnode->decl)) > ! debug_hooks->global_decl (vnode->decl); If it works, it looks OK to me :) Wrapup_global_decls does more than just debug output, but it is already done at compilation time, so we probably do not need to re-do it. Honza > } > > static tree