Commit cba6a0b2 by Mark Mitchell Committed by Mark Mitchell

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
parent 454fa7a7
2000-04-11 Mark Mitchell <mark@codesourcery.com> 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 * cp-tree.h (lang_decl_flags): Rename constructor_for_vbase_attr
to has_in_charge_parm_p. to has_in_charge_parm_p.
(DECL_CONSTRUCTOR_FOR_VBASE_P): Rename to ... (DECL_CONSTRUCTOR_FOR_VBASE_P): Rename to ...
......
...@@ -109,8 +109,13 @@ remap_decl (decl, id) ...@@ -109,8 +109,13 @@ remap_decl (decl, id)
walk_tree (&DECL_SIZE_UNIT (t), copy_body_r, id); walk_tree (&DECL_SIZE_UNIT (t), copy_body_r, id);
if (TREE_TYPE (t) && TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE if (TREE_TYPE (t) && TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE
&& TYPE_DOMAIN (TREE_TYPE (t))) && 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 /* Remember it, so that if we encounter this local entity
again we can reuse this copy. */ again we can reuse this copy. */
......
...@@ -1439,7 +1439,6 @@ copy_tree_r (tp, walk_subtrees, data) ...@@ -1439,7 +1439,6 @@ copy_tree_r (tp, walk_subtrees, data)
|| TREE_CODE_CLASS (code) == 'r' || TREE_CODE_CLASS (code) == 'r'
|| TREE_CODE_CLASS (code) == 'c' || TREE_CODE_CLASS (code) == 'c'
|| TREE_CODE_CLASS (code) == 's' || TREE_CODE_CLASS (code) == 's'
|| code == PARM_DECL
|| code == TREE_LIST || code == TREE_LIST
|| code == TREE_VEC || code == TREE_VEC
|| code == OVERLOAD) || code == OVERLOAD)
......
// 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 ();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment