From: Richard Biener Date: Fri, 13 Jul 2018 06:42:31 +0000 (+0000) Subject: re PR debug/86452 (ICE in force_decl_die, at dwarf2out.c:25922 with -g1 and -flto) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=77e61ab00f9d1731d94ad6595d86153afdb31604;p=gcc.git re PR debug/86452 (ICE in force_decl_die, at dwarf2out.c:25922 with -g1 and -flto) 2018-07-13 Richard Biener PR debug/86452 * dwarf2out.c (gen_type_die_with_usage): Use scope_die_for instead of get_context_die. From-SVN: r262624 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0cfa2309c61..07ff2b02e02 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-07-13 Richard Biener + + PR debug/86452 + * dwarf2out.c (gen_type_die_with_usage): Use scope_die_for + instead of get_context_die. + 2018-07-13 Kugan Vivekanandarajah Richard Biener diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index c2422e29658..ba5c63eaf0b 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -25388,11 +25388,8 @@ gen_type_die_with_usage (tree type, dw_die_ref context_die, generate debug info for the typedef. */ if (is_naming_typedef_decl (TYPE_NAME (type))) { - /* Use the DIE of the containing namespace as the parent DIE of - the type description DIE we want to generate. */ - if (DECL_CONTEXT (TYPE_NAME (type)) - && TREE_CODE (DECL_CONTEXT (TYPE_NAME (type))) == NAMESPACE_DECL) - context_die = get_context_die (DECL_CONTEXT (TYPE_NAME (type))); + /* Give typedefs the right scope. */ + context_die = scope_die_for (type, context_die); gen_decl_die (TYPE_NAME (type), NULL, NULL, context_die); return;