From 4a6e5cc885d6592194ff7e0c884d0bb802251c73 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 14 Sep 2010 11:48:04 +0200 Subject: re PR debug/45660 (ICE in dwarf2out_finish) PR debug/45660 * dwarf2out.c (gen_decl_die): Call gen_type_die for origin before gen_type_die for function/method return type. * g++.dg/debug/pr45660.C: New test. From-SVN: r164271 --- gcc/dwarf2out.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'gcc/dwarf2out.c') diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 52632da..5ee14ee 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -20602,16 +20602,20 @@ gen_decl_die (tree decl, tree origin, dw_die_ref context_die) else if (debug_info_level > DINFO_LEVEL_TERSE) { /* Before we describe the FUNCTION_DECL itself, make sure that we - have described its return type. */ + have its containing type. */ + if (!origin) + origin = decl_class_context (decl); + if (origin != NULL_TREE) + gen_type_die (origin, context_die); + + /* And its return type. */ gen_type_die (TREE_TYPE (TREE_TYPE (decl)), context_die); /* And its virtual context. */ if (DECL_VINDEX (decl) != NULL_TREE) gen_type_die (DECL_CONTEXT (decl), context_die); - /* And its containing type. */ - if (!origin) - origin = decl_class_context (decl); + /* Make sure we have a member DIE for decl. */ if (origin != NULL_TREE) gen_type_die_for_member (origin, decl, context_die); -- cgit v1.1