aboutsummaryrefslogtreecommitdiff
path: root/contrib/gcc/tree-inline.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/gcc/tree-inline.c')
-rw-r--r--contrib/gcc/tree-inline.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/contrib/gcc/tree-inline.c b/contrib/gcc/tree-inline.c
index 79f4c52f0b40..307c35c2bb1b 100644
--- a/contrib/gcc/tree-inline.c
+++ b/contrib/gcc/tree-inline.c
@@ -1224,6 +1224,12 @@ walk_tree (tp, func, data, htab_)
{
WALK_SUBTREE_TAIL (TREE_TYPE (*tp));
}
+ else if (TREE_CODE_CLASS (code) == 't')
+ {
+ WALK_SUBTREE (TYPE_SIZE (*tp));
+ WALK_SUBTREE (TYPE_SIZE_UNIT (*tp));
+ /* Also examine various special fields, below. */
+ }
result = (*lang_hooks.tree_inlining.walk_subtrees) (tp, &walk_subtrees, func,
data, htab);
@@ -1320,6 +1326,7 @@ walk_tree (tp, func, data, htab_)
return NULL_TREE;
#undef WALK_SUBTREE
+#undef WALK_SUBTREE_TAIL
}
/* Like walk_tree, but does not walk duplicate nodes more than
@@ -1378,8 +1385,8 @@ copy_tree_r (tp, walk_subtrees, data)
if (TREE_CODE (*tp) == SCOPE_STMT)
SCOPE_STMT_BLOCK (*tp) = NULL_TREE;
}
- else if (TREE_CODE_CLASS (code) == 't')
- /* There's no need to copy types, or anything beneath them. */
+ else if (TREE_CODE_CLASS (code) == 't' && !variably_modified_type_p (*tp))
+ /* Types only need to be copied if they are variably modified. */
*walk_subtrees = 0;
return NULL_TREE;