diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-04-11 17:29:54 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-04-11 17:29:54 +0000 |
commit | 6fb1df1221a00799bdcffbd34edd21b2d98f6866 (patch) | |
tree | 33504eefc0ca206c9ae61a381f72dcb8b027fd09 | |
parent | a23287c62821396c941dd3aa1949b9b8f1d187c5 (diff) |
* optimize.c (remap_decl): Avoid sharing structure for arrays
whose size is only known at run-time.
* tree.c (copy_tree_r): Don't copy PARM_DECLs.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33081 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/optimize.c | 9 | ||||
-rw-r--r-- | gcc/cp/tree.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/inline9.C | 20 |
4 files changed, 31 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 95077ca7b47..c3b2d4795f2 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2000-04-11 Mark Mitchell <mark@codesourcery.com> + * optimize.c (remap_decl): Avoid sharing structure for arrays + whose size is only known at run-time. + * tree.c (copy_tree_r): Don't copy PARM_DECLs. + * cp-tree.h (lang_decl_flags): Rename constructor_for_vbase_attr to has_in_charge_parm_p. (DECL_CONSTRUCTOR_FOR_VBASE_P): Rename to ... diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c index 63ec81a26ab..b12a2ff6362 100644 --- a/gcc/cp/optimize.c +++ b/gcc/cp/optimize.c @@ -109,8 +109,13 @@ remap_decl (decl, id) walk_tree (&DECL_SIZE_UNIT (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); + { + TREE_TYPE (t) = copy_node (TREE_TYPE (t)); + TYPE_DOMAIN (TREE_TYPE (t)) + = copy_node (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. */ diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 77973d6d59d..fe175f0a3ed 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -1439,7 +1439,6 @@ copy_tree_r (tp, walk_subtrees, data) || TREE_CODE_CLASS (code) == 'r' || TREE_CODE_CLASS (code) == 'c' || TREE_CODE_CLASS (code) == 's' - || code == PARM_DECL || code == TREE_LIST || code == TREE_VEC || code == OVERLOAD) diff --git a/gcc/testsuite/g++.old-deja/g++.other/inline9.C b/gcc/testsuite/g++.old-deja/g++.other/inline9.C new file mode 100644 index 00000000000..9256c5f9da5 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/inline9.C @@ -0,0 +1,20 @@ +// Build don't link: +// Origin: Mark Mitchell <mitchell@codesourcery.com> +// Special g++ Options: -O2 + +inline void f () +{ + int n; + int i[n]; +} + +void g () +{ + f (); +} + +void h () +{ + f (); +} + |