From 1ae3075b79bad398cb152bef6d4431536aa6bde1 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Mon, 26 Apr 2010 09:13:00 +0000 Subject: re PR debug/42425 (ICE declaring local class) 2010-04-26 Richard Guenther PR lto/42425 * tree.c (free_lang_data_in_type): Do not free TYPE_CONTEXT if emitting debug information and it is either a function or a namespace decl. * g++.dg/lto/20100423-2_0.C: New testcase. From-SVN: r158722 --- gcc/tree.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gcc/tree.c') diff --git a/gcc/tree.c b/gcc/tree.c index 561367b..8eeecff 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -4258,7 +4258,12 @@ free_lang_data_in_type (tree type) TYPE_LANG_SLOT_1 (type) = NULL_TREE; } - TYPE_CONTEXT (type) = NULL_TREE; + if (debug_info_level < DINFO_LEVEL_TERSE + || (TYPE_CONTEXT (type) + && TREE_CODE (TYPE_CONTEXT (type)) != FUNCTION_DECL + && TREE_CODE (TYPE_CONTEXT (type)) != NAMESPACE_DECL)) + TYPE_CONTEXT (type) = NULL_TREE; + if (debug_info_level < DINFO_LEVEL_TERSE) TYPE_STUB_DECL (type) = NULL_TREE; } -- cgit v1.1