aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2018-06-19 17:56:27 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2018-06-19 15:56:27 +0000
commit694dc72ebe8701bbf6ed4cd6cf846dc80367aee9 (patch)
treef420db30ee3e8c8765599066414b33f045511ed5 /gcc/tree.c
parent583d09f3653e12a895fbe6c86ce4bfbae0abc2cc (diff)
downloadgcc-694dc72ebe8701bbf6ed4cd6cf846dc80367aee9.zip
gcc-694dc72ebe8701bbf6ed4cd6cf846dc80367aee9.tar.gz
gcc-694dc72ebe8701bbf6ed4cd6cf846dc80367aee9.tar.bz2
tree.c (find_decls_types_r): Remove all non-VAR_DECLs from blocks.
* tree.c (find_decls_types_r): Remove all non-VAR_DECLs from blocks. * g++.dg/lto/pr84805_0.C: Update template. * g++.dg/lto/pr84805_1.C: Update template. From-SVN: r261748
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 889d88c..3f75f7f 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -5173,7 +5173,10 @@ free_lang_data_in_type (tree type)
/* Drop TYPE_DECLs in TYPE_NAME in favor of the identifier in the
TYPE_DECL if the type doesn't have linkage. */
if (! type_with_linkage_p (type))
- TYPE_NAME (type) = TYPE_IDENTIFIER (type);
+ {
+ TYPE_NAME (type) = TYPE_IDENTIFIER (type);
+ TYPE_STUB_DECL (type) = NULL;
+ }
}
@@ -5556,10 +5559,22 @@ find_decls_types_r (tree *tp, int *ws, void *data)
}
else if (TREE_CODE (t) == BLOCK)
{
- tree tem;
- for (tem = BLOCK_VARS (t); tem; tem = TREE_CHAIN (tem))
- fld_worklist_push (tem, fld);
- for (tem = BLOCK_SUBBLOCKS (t); tem; tem = BLOCK_CHAIN (tem))
+ for (tree *tem = &BLOCK_VARS (t); *tem; )
+ {
+ if (TREE_CODE (*tem) != VAR_DECL
+ || !auto_var_in_fn_p (*tem, DECL_CONTEXT (*tem)))
+ {
+ gcc_assert (TREE_CODE (*tem) != RESULT_DECL
+ && TREE_CODE (*tem) != PARM_DECL);
+ *tem = TREE_CHAIN (*tem);
+ }
+ else
+ {
+ fld_worklist_push (*tem, fld);
+ tem = &TREE_CHAIN (*tem);
+ }
+ }
+ for (tree tem = BLOCK_SUBBLOCKS (t); tem; tem = BLOCK_CHAIN (tem))
fld_worklist_push (tem, fld);
fld_worklist_push (BLOCK_ABSTRACT_ORIGIN (t), fld);
}