diff options
author | Jim Wilson <wilson@cygnus.com> | 2000-01-28 04:56:59 +0000 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 2000-01-27 20:56:59 -0800 |
commit | aa1eac0c9f723a4f344956a6718f05f8ad932f76 (patch) | |
tree | 64ade675d638cfa404be85c7b5880e69d5de8cd5 /gcc/cp/optimize.c | |
parent | 138eff91a262e1006e755e02eafd9c8ce5287721 (diff) | |
download | gcc-aa1eac0c9f723a4f344956a6718f05f8ad932f76.zip gcc-aa1eac0c9f723a4f344956a6718f05f8ad932f76.tar.gz gcc-aa1eac0c9f723a4f344956a6718f05f8ad932f76.tar.bz2 |
Fix winsup (cygwin) build failure with VLAs and inline functions.
* cp/optimize.c (remap_decl): Add walk_tree calls for DECL_SIZE (t)
and TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (t))).
From-SVN: r31663
Diffstat (limited to 'gcc/cp/optimize.c')
-rw-r--r-- | gcc/cp/optimize.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c index 60ccbbd..c2cb029 100644 --- a/gcc/cp/optimize.c +++ b/gcc/cp/optimize.c @@ -104,6 +104,16 @@ remap_decl (decl, id) /* Make a copy of the variable or label. */ t = copy_decl_for_inlining (decl, fn, VARRAY_TREE (id->fns, 0)); + + /* The decl T could be a dynamic array or other variable size type, + in which case some fields need to be remapped because they may + contain SAVE_EXPRs. */ + walk_tree (&DECL_SIZE (t), copy_body_r, id); + if (TREE_TYPE (t) && TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE + && TYPE_DOMAIN (TREE_TYPE (t))) + walk_tree (&TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (t))), + copy_body_r, id); + /* Remember it, so that if we encounter this local entity again we can reuse this copy. */ n = splay_tree_insert (id->decl_map, |