On Fri, Dec 07, 2012 at 09:38:06AM +0100, Richard Biener 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+.
> > 
> > --- gcc/varpool.c.jj        2012-11-19 14:41:27.000000000 +0100
> > +++ gcc/varpool.c   2012-12-04 17:42:41.228752645 +0100
> > @@ -65,7 +65,10 @@ varpool_remove_node (struct varpool_node
> >        && !DECL_VIRTUAL_P (node->symbol.decl)
> >        /* dbxout output constant initializers for readonly vars.  */
> >        && (!host_integerp (DECL_INITIAL (node->symbol.decl), 0)
> > -     || !TREE_READONLY (node->symbol.decl)))
> > +     || !TREE_READONLY (node->symbol.decl))
> > +      /* dwarf2out can use most of the initializers.  */
> > +      && write_symbols != DWARF2_DEBUG
> > +      && write_symbols != VMS_AND_DWARF2_DEBUG)
> 
> Eh, shouldn't we "abstract" this properly?  Like with a bool
> flag in debug_hooks?  Or with a hook?  I see now we special-case
> dbxout and dwarf2out ... (can all dwarf versions express the
> initializers?)

Debug hook for this sounds like overkill.  If you prefer, as debug info
formats other than dwarf2 are just legacy anyway, we could drop the dbxout
special case and just do && write_symbols == NO_DEBUG or
&& debug_info_level == DINFO_LEVEL_NONE.

And yes, all dwarf versions can express at least some of the initializers.

        Jakub

Reply via email to