aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-07-02 17:15:50 -0700
committerRichard Henderson <rth@gcc.gnu.org>2004-07-02 17:15:50 -0700
commit82c8274320fcfdf2ce27d26c017a4d9d9cafa4b1 (patch)
tree1c3ed35626f7a5ec145a2aaec1364cd9a760a955 /gcc/c-decl.c
parenta7e4cdca852a596dffe4e7cd2a1b0bd887c5ebec (diff)
downloadgcc-82c8274320fcfdf2ce27d26c017a4d9d9cafa4b1.zip
gcc-82c8274320fcfdf2ce27d26c017a4d9d9cafa4b1.tar.gz
gcc-82c8274320fcfdf2ce27d26c017a4d9d9cafa4b1.tar.bz2
c-decl.c (grokdeclarator): Don't frob current_function_decl around variable_size.
* c-decl.c (grokdeclarator): Don't frob current_function_decl around variable_size. (set_decl_nonlocal): Remove. (store_parm_decls): Add stmts for pending sizes. * calls.c (calls_function, calls_function_1): Remove. (precompute_arguments): Don't call it. * cfgexpand.c (set_save_expr_context): Remove. (tree_expand_cfg): Don't call it. * dwarf2out.c (add_bound_info): Don't handle SAVE_EXPR. (dwarf2out_finish): Likewise. * expr.c (emit_block_move): Adjust addresses to BLKmode. (store_constructor): Don't pre-evaluate SAVE_EXPR. (safe_from_p): Don't queue SAVE_EXPRs. (expand_expr_real_1 <case SAVE_EXPR>): Rewrite to expect, or build plain VAR_DECLs. * fold-const.c (twoval_comparison_p): Don't look at SAVE_EXPR_RTL. (fold): Likewise. (fold_checksum_tree): Don't special-case SAVE_EXPR. * function.c (free_after_compilation): Don't clear x_save_expr_regs. (put_var_into_stack): Don't handle SAVE_EXPR. (gen_mem_addressof): Likewise. * function.h (struct function): Remove x_save_expr_regs. (save_expr_regs): Remove. * gengtype.c (adjust_field_tree_exp): Don't special-case SAVE_EXPR. * print-tree.c (print_node): Don't dump SAVE_EXPR_NOPLACEHOLDER. * stor-layout.c (variable_size): Don't set it. (force_type_save_exprs, force_type_save_exprs_1): Remove. * tree-inline.c (remap_save_expr): Remove fn argument. Update all callers. Don't set SAVE_EXPR_CONTEXT. * tree-inline.h (remap_save_expr): Update decl. * tree.c (save_expr): Update build size. (first_rtl_op): Don't handle SAVE_EXPR. (unsave_expr_1, contains_placeholder_p): Likewise. (decl_function_context): Likewise. * tree.def (SAVE_EXPR): Remove args 1 and 2. * tree.h (SAVE_EXPR_CONTEXT, SAVE_EXPR_RTL): Remove. (SAVE_EXPR_NOPLACEHOLDER, SAVE_EXPR_PERSISTENT_P): Remove. cp/ * tree.c (cp_unsave_r): Update remap_save_expr call. java/ * jcf-write.c (generate_bytecode_insns <case SAVE_EXPR>): Rewrite. From-SVN: r84036
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c66
1 files changed, 9 insertions, 57 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 00bb587..329c862 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -3990,20 +3990,7 @@ grokdeclarator (tree declarator, tree declspecs,
}
if (size_varies)
- {
- /* We must be able to distinguish the
- SAVE_EXPR_CONTEXT for the variably-sized type
- so that we can set it correctly in
- set_save_expr_context. The convention is
- that all SAVE_EXPRs that need to be reset
- have NULL_TREE for their SAVE_EXPR_CONTEXT. */
- tree cfd = current_function_decl;
- if (decl_context == PARM)
- current_function_decl = NULL_TREE;
- itype = variable_size (itype);
- if (decl_context == PARM)
- current_function_decl = cfd;
- }
+ itype = variable_size (itype);
itype = build_index_type (itype);
}
}
@@ -6065,25 +6052,6 @@ store_parm_decls_oldstyle (tree fndecl, tree arg_info)
}
}
-/* A subroutine of store_parm_decls called via walk_tree. Mark all
- decls non-local. */
-
-static tree
-set_decl_nonlocal (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
-{
- tree t = *tp;
-
- if (DECL_P (t))
- {
- DECL_NONLOCAL (t) = 1;
- *walk_subtrees = 0;
- }
- else if (TYPE_P (t))
- *walk_subtrees = 0;
-
- return NULL;
-}
-
/* Store the parameter declarations into the current function declaration.
This is called after parsing the parameter declarations, before
digesting the body of the function.
@@ -6096,9 +6064,6 @@ store_parm_decls (void)
{
tree fndecl = current_function_decl;
- /* The function containing FNDECL, if any. */
- tree context = decl_function_context (fndecl);
-
/* The argument information block for FNDECL. */
tree arg_info = DECL_ARGUMENTS (fndecl);
@@ -6129,27 +6094,14 @@ store_parm_decls (void)
/* Begin the statement tree for this function. */
DECL_SAVED_TREE (fndecl) = push_stmt_list ();
- /* If this is a nested function, save away the sizes of any
- variable-size types so that we can expand them when generating
- RTL. */
- if (context)
- {
- tree t;
-
- DECL_LANG_SPECIFIC (fndecl)->pending_sizes
- = nreverse (get_pending_sizes ());
- for (t = DECL_LANG_SPECIFIC (fndecl)->pending_sizes;
- t;
- t = TREE_CHAIN (t))
- {
- /* We will have a nonlocal use of whatever variables are
- buried inside here. */
- walk_tree (&TREE_OPERAND (TREE_VALUE (t), 0),
- set_decl_nonlocal, NULL, NULL);
-
- SAVE_EXPR_CONTEXT (TREE_VALUE (t)) = context;
- }
- }
+ /* ??? Insert the contents of the pending sizes list into the function
+ to be evaluated. This just changes mis-behaviour until assign_parms
+ phase ordering problems are resolved. */
+ {
+ tree t;
+ for (t = nreverse (get_pending_sizes ()); t ; t = TREE_CHAIN (t))
+ add_stmt (TREE_VALUE (t));
+ }
/* Even though we're inside a function body, we still don't want to
call expand_expr to calculate the size of a variable-sized array.