diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-04-26 09:13:00 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-04-26 09:13:00 +0000 |
commit | be9d48ea44a0bf260a2384f5fb44607266119851 (patch) | |
tree | 1bcc92a1e332646dc08a56c785a3b7e88f594313 /gcc/tree.c | |
parent | 6ea6a380355ec8324844a76243c61db77eab2b8b (diff) | |
download | gcc-be9d48ea44a0bf260a2384f5fb44607266119851.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158722 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/tree.c b/gcc/tree.c index 561367bdd43..8eeecff7122 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; } |