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 | |
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
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/optimize.c | 10 |
2 files changed, 15 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index fbe1565..de265ac 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +Thu Jan 27 20:53:36 2000 Jim Wilson <wilson@cygnus.com> + + * cp/optimize.c (remap_decl): Add walk_tree calls for DECL_SIZE (t) + and TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (t))). + Thu Jan 27 13:54:12 2000 Mike Stump <mrs@wrs.com> * decl.c (pushdecl): Fix up shadow warnings with respect to implicit 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, |