http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46123
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-11-19
07:36:03 UTC ---
context_die == NULL happens exactly on the g++.old-deja/g++.other/mangle3.C
testcase, i.e. on an inline method of a type contained in another inline method
of another type.
The reason why context_die is NULL is because on this inner method
decl_function_scope returns non-NULL - while the inner method is contained in a
type, not in a function, that type is contained in a function.
The reusing happens only if is_cu_die (old_die->parent) or context_die == NULL
and for is_cu_die (old_die->parent) it should never be a problem.
I guess a different fix would be not to use decl_function_scope in deciding
whether to clear context_die, but use another function, which would return NULL
as soon as we switch from a FUNCTION_DECL to a type while traversing the
contexts.