From: Richard Guenther Date: Sun, 20 Feb 2011 17:15:53 +0000 (+0000) Subject: re PR target/47822 (Multiple test suite failures due to revision 170321) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=77f846e9e22eb9a71a0318bd49257d0f31292e56;p=gcc.git re PR target/47822 (Multiple test suite failures due to revision 170321) 2011-02-20 Richard Guenther PR lto/47822 * tree.c (free_lang_data_in_decl): Clean builtins from the TU decl BLOCK_VARS. From-SVN: r170339 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f5885f8a9fb..cfed6bdff22 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-02-20 Richard Guenther + + PR lto/47822 + * tree.c (free_lang_data_in_decl): Clean builtins from + the TU decl BLOCK_VARS. + 2011-02-19 Alexandre Oliva PR debug/47620 diff --git a/gcc/tree.c b/gcc/tree.c index f1f80053775..c947072b215 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -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); + } + } }