http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53780

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu.org

--- Comment #7 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-29 
13:45:50 UTC ---
Hmm.  Does

Index: gcc/tree.c
===================================================================
--- gcc/tree.c  (revision 189046)
+++ gcc/tree.c  (working copy)
@@ -4852,7 +4852,15 @@ find_decls_types_r (tree *tp, int *ws, v
       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.  */

fix it?

Reply via email to