From 78abf7bba09468349761da8f1ef24b4ae8f13e34 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Thu, 28 Oct 2004 18:36:41 +0000 Subject: [PATCH] avoid ICEing when encountering a (template-related) problem during generation of debug-info. This is highly experimental and has a good chance of being removed at a later stage. git-svn-id: file:///srv/svn/repos/haiku/trunk/buildtools@9621 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- gcc/gcc/dwarf2out.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/gcc/gcc/dwarf2out.c b/gcc/gcc/dwarf2out.c index 3fd0f7b820..8878b6ee7a 100644 --- a/gcc/gcc/dwarf2out.c +++ b/gcc/gcc/dwarf2out.c @@ -7797,11 +7797,13 @@ scope_die_for (t, context_die) if (i < 0) { - if (TREE_CODE_CLASS (TREE_CODE (containing_scope)) != 't') - abort (); - if (debug_info_level > DINFO_LEVEL_TERSE - && !TREE_ASM_WRITTEN (containing_scope)) - abort (); + if (TREE_CODE_CLASS (TREE_CODE (containing_scope)) != 't' + || (debug_info_level > DINFO_LEVEL_TERSE + && !TREE_ASM_WRITTEN (containing_scope))) + /* [zooey] avoid ICEing, return default instead: */ + if (pedantic) + warning ("Trapped ICE during generation of debug-info, expect problems in debugger!\n"); + // abort (); /* If none of the current dies are suitable, we get file scope. */ scope_die = comp_unit_die; @@ -8396,7 +8398,10 @@ gen_subprogram_die (decl, context_die) extern int errorcount; if (errorcount) return; - abort (); + // [zooey]: avoid ICEing, since we *should* have trapped all + // executions paths leading here... + // abort (); + return; } /* If the definition comes from the same place as the declaration,