diff options
author | Zack Weinberg <zack@codesourcery.com> | 2002-10-25 17:26:52 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2002-10-25 17:26:52 +0000 |
commit | f3763a442e854320fd233fd63b7871f301f723be (patch) | |
tree | f4aabed9d6786dc267e9c2ce167b8defec608eb0 /gcc/tree-inline.c | |
parent | 6eb359685e52f13a7c6236184300b43e5a4d7ca6 (diff) | |
download | gcc-f3763a442e854320fd233fd63b7871f301f723be.zip gcc-f3763a442e854320fd233fd63b7871f301f723be.tar.gz gcc-f3763a442e854320fd233fd63b7871f301f723be.tar.bz2 |
re PR c++/6994 (ICE in find_function_data)
PR middle-end/6994
* c-objc-common.c (inline_forbidden_p): Can not inline
functions containing structures or unions containing VLAs.
* tree-inline.c (walk_tree): For all class 't' nodes, walk
TYPE_SIZE and TYPE_SIZE_UNIT.
(copy_tree_r): Copy types if they are variably modified.
* g++.dg/ext/vla1.C, gcc.dg/vla-2.c: New tests.
From-SVN: r58535
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r-- | gcc/tree-inline.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 505f0a5..898dacb 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -1543,6 +1543,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); @@ -1711,8 +1717,8 @@ copy_tree_r (tp, walk_subtrees, data) TREE_CHAIN (*tp) = chain; #endif /* INLINER_FOR_JAVA */ } - 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; |