aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2010-04-26 09:13:00 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2010-04-26 09:13:00 +0000
commit1ae3075b79bad398cb152bef6d4431536aa6bde1 (patch)
tree1bcc92a1e332646dc08a56c785a3b7e88f594313 /gcc/tree.c
parent4b5caab7712abeb3e4e1fa0ce6f74484e5953079 (diff)
downloadgcc-1ae3075b79bad398cb152bef6d4431536aa6bde1.zip
gcc-1ae3075b79bad398cb152bef6d4431536aa6bde1.tar.gz
gcc-1ae3075b79bad398cb152bef6d4431536aa6bde1.tar.bz2
re PR debug/42425 (ICE declaring local class)
2010-04-26 Richard Guenther <rguenther@suse.de> 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
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c7
1 files changed, 6 insertions, 1 deletions
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;
}