aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-07-04 10:36:07 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2012-07-04 10:36:07 +0000
commitcef8c10098ffd48dec16db4a8a67e1cd542a1163 (patch)
tree7a48a54a715a9459604a848b2e41b9f42d17152b /gcc/tree.c
parentb60cc080f355e078c923537a0d759467d21d39c0 (diff)
downloadgcc-cef8c10098ffd48dec16db4a8a67e1cd542a1163.zip
gcc-cef8c10098ffd48dec16db4a8a67e1cd542a1163.tar.gz
gcc-cef8c10098ffd48dec16db4a8a67e1cd542a1163.tar.bz2
tree.c (find_decls_types_r): Handle TYPE_CONTEXT the same as in free_lang_data_in_type.
2012-07-04 Richard Guenther <rguenther@suse.de> * tree.c (find_decls_types_r): Handle TYPE_CONTEXT the same as in free_lang_data_in_type. From-SVN: r189252
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index f9942fb..9be0c9a 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -4910,7 +4910,15 @@ find_decls_types_r (tree *tp, int *ws, void *data)
fld_worklist_push (TYPE_MAIN_VARIANT (t), fld);
/* Do not walk TYPE_NEXT_VARIANT. We do not stream it and thus
do not and want not to reach unused variants this way. */
- fld_worklist_push (TYPE_CONTEXT (t), fld);
+ if (TYPE_CONTEXT (t))
+ {
+ tree ctx = TYPE_CONTEXT (t);
+ /* We adjust BLOCK TYPE_CONTEXTs to the innermost non-BLOCK one.
+ So push that instead. */
+ while (ctx && TREE_CODE (ctx) == BLOCK)
+ ctx = BLOCK_SUPERCONTEXT (ctx);
+ fld_worklist_push (ctx, fld);
+ }
/* Do not walk TYPE_CANONICAL. We do not stream it and thus do not
and want not to reach unused types this way. */