On Thu, Dec 06, 2012 at 09:12:48PM +0100, Jan Hubicka wrote: > > 2012-12-06 Jakub Jelinek <ja...@redhat.com> > > > > PR fortran/55395 > > * varpool.c (varpool_remove_node): Don't drop DECL_INITIAL > > if -g and emitting DWARF2+. > > OK. How we want to handle this with LTO streaming?
Don't know. From debug info quality POV right now, LTO has lots of other more important issues first. And from the invalid error POV, that only matters if the initializer changes in between RTL expansion of some function and end of compilation, so could be fine for now. If not C++-style const, the DECL_INITIAL is used only in the CUs where the definition of the symbol is emitted or would be emitted anyway. > There we also put in error_mark_node: > if (TREE_CODE (expr) == VAR_DECL > && (TREE_STATIC (expr) || DECL_EXTERNAL (expr)) > && initial) > { > lto_symtab_encoder_t encoder; > struct varpool_node *vnode; > > encoder = ob->decl_state->symtab_node_encoder; > vnode = varpool_get_node (expr); > if (!vnode > || !lto_symtab_encoder_encode_initializer_p (encoder, > vnode)) > initial = error_mark_node; > } > > stream_write_tree (ob, initial, ref_p); Jakub