diff options
author | Mark Mitchell <mark@codesourcery.com> | 2000-04-11 17:29:54 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2000-04-11 17:29:54 +0000 |
commit | cba6a0b29f3a543c4249edd018cdda26ec2c7cf1 (patch) | |
tree | 33504eefc0ca206c9ae61a381f72dcb8b027fd09 /gcc | |
parent | 454fa7a7dbd0aee93b1db23e3d7047b35897e6c6 (diff) | |
download | gcc-cba6a0b29f3a543c4249edd018cdda26ec2c7cf1.zip gcc-cba6a0b29f3a543c4249edd018cdda26ec2c7cf1.tar.gz gcc-cba6a0b29f3a543c4249edd018cdda26ec2c7cf1.tar.bz2 |
optimize.c (remap_decl): Avoid sharing structure for arrays whose size is only known at run-time.
* 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.
From-SVN: r33081
Diffstat (limited to 'gcc')
-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 95077ca..c3b2d479 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 63ec81a..b12a2ff 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 77973d6..fe175f0 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 0000000..9256c5f --- /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 (); +} + |