diff options
author | Richard Guenther <rguenther@suse.de> | 2012-06-11 14:14:09 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2012-06-11 14:14:09 +0000 |
commit | e3b127e818dd591031a9cee6fbccd55c612cd643 (patch) | |
tree | 340e42ba07e8192d447a2f10a933a3b9b418dd7d /gcc/tree.c | |
parent | 5a20ffcb3afa4c44d0518d30010f002a32a8f7b2 (diff) | |
download | gcc-e3b127e818dd591031a9cee6fbccd55c612cd643.zip gcc-e3b127e818dd591031a9cee6fbccd55c612cd643.tar.gz gcc-e3b127e818dd591031a9cee6fbccd55c612cd643.tar.bz2 |
re PR debug/53470 (ICE when linking with -g in splice_child_die, at dwarf2out.c:4264)
2012-06-11 Richard Guenther <rguenther@suse.de>
PR middle-end/53470
* tree.c (free_lang_data_in_type): Do not clear TYPE_CONTEXT but
replace it with the first non-BLOCK context.
* g++.dg/lto/pr53470_0.C: New testcase.
* gcc.dg/lto/pr53470_0.c: Likewise.
From-SVN: r188387
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -4575,11 +4575,17 @@ free_lang_data_in_type (tree type) free_lang_data_in_one_sizepos (&TYPE_SIZE (type)); free_lang_data_in_one_sizepos (&TYPE_SIZE_UNIT (type)); - 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 (TYPE_CONTEXT (type) + && TREE_CODE (TYPE_CONTEXT (type)) == BLOCK) + { + tree ctx = TYPE_CONTEXT (type); + do + { + ctx = BLOCK_SUPERCONTEXT (ctx); + } + while (ctx && TREE_CODE (ctx) == BLOCK); + TYPE_CONTEXT (type) = ctx; + } } |