summaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2004-04-12 21:25:55 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2004-04-12 17:25:55 -0400
commit1c9766da11d71cb57f8962a2eb88833c1ca966f5 (patch)
treefc6c6b14412060a9d6d90d3f45c768a4648b7f4b /gcc/tree-inline.c
parent040e098a5de9115501bd76ce0ea7adc9a0eded21 (diff)
downloadgcc-1c9766da11d71cb57f8962a2eb88833c1ca966f5.tar.gz
c-decl.c (finish_decl): Make a decl_stmt for a variable-sized TYPE_DECL.
* c-decl.c (finish_decl): Make a decl_stmt for a variable-sized TYPE_DECL. * c-semantics.c (genrtl_decl_stmt): Handle TYPE_DECL. * stmt.c (expand_decl): Remove redundant expansion of TYPE_DOMAIN. * stor-layout.c (variable_size): Don't check for MINUS_EXPR. Use skip_simple_arithmetic to find SAVE_EXPR. (force_type_save_exprs, force_type_save_exprs_1): New functions. * tree-inline.c (remap_type, case POINTER_TYPE, case REFERENCE_TYPE): Properly chain multiple pointers. (copy_tree_r): Copy a TYPE_DECL. * tree.c (variably_modified_type_p): Add some missing tests and make some other minor changes. * tree.h (force_type_save_exprs): New declaration. * gcc.c-torture/execute/20040411-1.c: New test. From-SVN: r80629
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index d9aeefe14db..622ae18a548 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -271,6 +271,7 @@ remap_type (tree type, inline_data *id)
t = TYPE_MIN_VALUE (new);
if (t && TREE_CODE (t) != INTEGER_CST)
walk_tree (&TYPE_MIN_VALUE (new), copy_body_r, id, NULL);
+
t = TYPE_MAX_VALUE (new);
if (t && TREE_CODE (t) != INTEGER_CST)
walk_tree (&TYPE_MAX_VALUE (new), copy_body_r, id, NULL);
@@ -278,14 +279,14 @@ remap_type (tree type, inline_data *id)
case POINTER_TYPE:
TREE_TYPE (new) = t = remap_type (TREE_TYPE (new), id);
- if (TYPE_MODE (new) == ptr_mode)
- TYPE_POINTER_TO (t) = new;
+ TYPE_NEXT_PTR_TO (new) = TYPE_POINTER_TO (t);
+ TYPE_POINTER_TO (t) = new;
return new;
case REFERENCE_TYPE:
TREE_TYPE (new) = t = remap_type (TREE_TYPE (new), id);
- if (TYPE_MODE (new) == ptr_mode)
- TYPE_REFERENCE_TO (t) = new;
+ TYPE_NEXT_REF_TO (new) = TYPE_REFERENCE_TO (t);
+ TYPE_REFERENCE_TO (t) = new;
return new;
case METHOD_TYPE:
@@ -2082,6 +2083,7 @@ copy_tree_r (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
|| TREE_CODE_CLASS (code) == 'c'
|| code == TREE_LIST
|| code == TREE_VEC
+ || code == TYPE_DECL
|| lang_hooks.tree_inlining.tree_chain_matters_p (*tp))
{
/* Because the chain gets clobbered when we make a copy, we save it