From aa1eac0c9f723a4f344956a6718f05f8ad932f76 Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Fri, 28 Jan 2000 04:56:59 +0000 Subject: [PATCH] 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 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/optimize.c | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index fbe15656410..de265acf04b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +Thu Jan 27 20:53:36 2000 Jim Wilson + + * 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 * decl.c (pushdecl): Fix up shadow warnings with respect to implicit diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c index 60ccbbddee2..c2cb029b900 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,