diff options
-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, |