re PR target/47822 (Multiple test suite failures due to revision 170321)
authorRichard Guenther <rguenther@suse.de>
Sun, 20 Feb 2011 17:15:53 +0000 (17:15 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Sun, 20 Feb 2011 17:15:53 +0000 (17:15 +0000)
2011-02-20  Richard Guenther  <rguenther@suse.de>

PR lto/47822
* tree.c (free_lang_data_in_decl): Clean builtins from
the TU decl BLOCK_VARS.

From-SVN: r170339

gcc/ChangeLog
gcc/tree.c

index f5885f8a9fbede86bc16f56fa47ccf24fe71591e..cfed6bdff2215b820e5b9ab4596a2e3384505c1c 100644 (file)
@@ -1,3 +1,9 @@
+2011-02-20  Richard Guenther  <rguenther@suse.de>
+
+       PR lto/47822
+       * tree.c (free_lang_data_in_decl): Clean builtins from
+       the TU decl BLOCK_VARS.
 2011-02-19  Alexandre Oliva  <aoliva@redhat.com>
 
        PR debug/47620
index f1f80053775dbd03463998bc93ecc540e52b19f3..c947072b215ccd80ff86c1a646277d438b2712d0 100644 (file)
@@ -4577,6 +4577,25 @@ free_lang_data_in_decl (tree decl)
     }
   else if (TREE_CODE (decl) == TYPE_DECL)
     DECL_INITIAL (decl) = NULL_TREE;
+  else if (TREE_CODE (decl) == TRANSLATION_UNIT_DECL
+           && DECL_INITIAL (decl)
+           && TREE_CODE (DECL_INITIAL (decl)) == BLOCK)
+    {
+      /* Strip builtins from the translation-unit BLOCK.  We still have
+        targets without builtin_decl support and also builtins are
+        shared nodes and thus we can't use TREE_CHAIN in multiple
+        lists.  */
+      tree *nextp = &BLOCK_VARS (DECL_INITIAL (decl));
+      while (*nextp)
+        {
+          tree var = *nextp;
+          if (TREE_CODE (var) == FUNCTION_DECL
+              && DECL_BUILT_IN (var))
+           *nextp = TREE_CHAIN (var);
+         else
+           nextp = &TREE_CHAIN (var);
+        }
+    }
 }