aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/jcf-write.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/java/jcf-write.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/java/jcf-write.c')
-rw-r--r--gcc/java/jcf-write.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c
index 42136c6..09b39da 100644
--- a/gcc/java/jcf-write.c
+++ b/gcc/java/jcf-write.c
@@ -2197,35 +2197,24 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state)
}
break;
case SAVE_EXPR:
- /* Because the state associated with a SAVE_EXPR tree node must
- be a RTL expression, we use it to store the DECL_LOCAL_INDEX
- of a temporary variable in a CONST_INT. */
- if (! SAVE_EXPR_RTL (exp))
+ /* The first time through, the argument of the SAVE_EXPR will be
+ something complex. Evaluate it, and replace the argument with
+ a VAR_DECL that holds the result. */
+ arg = TREE_OPERAND (exp, 0);
+ if (TREE_CODE (arg) != VAR_DECL || DECL_NAME (arg))
{
tree type = TREE_TYPE (exp);
tree decl = build_decl (VAR_DECL, NULL_TREE, type);
- generate_bytecode_insns (TREE_OPERAND (exp, 0),
- STACK_TARGET, state);
+ generate_bytecode_insns (arg, STACK_TARGET, state);
localvar_alloc (decl, state);
- SAVE_EXPR_RTL (exp) = GEN_INT (DECL_LOCAL_INDEX (decl));
+ TREE_OPERAND (exp, 0) = decl;
emit_dup (TYPE_IS_WIDE (type) ? 2 : 1, 0, state);
emit_store (decl, state);
}
else
{
- /* The following code avoids creating a temporary DECL just
- to pass to emit_load. This code could be factored with
- the similar implementation in emit_load_or_store. */
tree type = TREE_TYPE (exp);
- int kind = adjust_typed_op (type, 4);
- int index = (int) INTVAL (SAVE_EXPR_RTL (exp));
- if (index <= 3)
- {
- RESERVE (1); /* [ilfda]load_[0123] */
- OP1 (OPCODE_iload + 5 + 4*kind + index);
- }
- else /* [ilfda]load */
- maybe_wide (OPCODE_iload + kind, index, state);
+ emit_load (arg, state);
NOTE_PUSH (TYPE_IS_WIDE (type) ? 2 : 1);
}
break;