[Bug middle-end/64937] [5 Regression] compare debug failure with -fsanitize=address

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Feb 5 12:00:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64937

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I think the problem is that cgraph etc. uses the DECL_ABSTRACT_P flag, which is
set in two different places:
1) in the C++ FE
2) in dwarf2out
In the latter, it does:
  was_abstract = DECL_ABSTRACT_P (decl);
  set_decl_abstract_flags (decl, 1);
  dwarf2out_decl (decl);
  if (! was_abstract)
    set_decl_abstract_flags (decl, 0);
So, if the decl was already abstract, it doesn't reset anything.  But,
unfortunately, the set_decl_abstract_flags call is recursive, and not all the
vars in there necessary have DECL_ABSTRACT_P flag already set.
Thus, I think either we should make sure that when the C++ FE sets
DECL_ABSTRACT_P flag on something, it is always set on all the contained decls
too (but how to ensure this if we e.g. further decls are added in various
passes to those functions?), or we should change dwarf2out.c to reset it always
to the previous state, rather than sometimes clearing it (despite it might be
set already before) and sometimes setting it and not clearing it afterwards.
For the latter, guess we could just add a vec<tree> into which we'd push the
decls on which we set the flag, and reversion would be performed by walking the
vector and clearing DECL_ABSTRACT_P flags.  I guess I'll try to implement the
dwarf2out.c change.



More information about the Gcc-bugs mailing list