aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/expr.c
diff options
context:
space:
mode:
authorAndrew Haley <aph@redhat.com>2004-07-21 16:03:43 +0000
committerAndrew Haley <aph@gcc.gnu.org>2004-07-21 16:03:43 +0000
commit00150bf9f31d6a0ec576ead73a315f26b1c31749 (patch)
tree1785e3e0f34d4daf27613e8a698fd2c59ee721f3 /gcc/java/expr.c
parent5d16533a079388246d53311790a4a4b2a16aa6c6 (diff)
downloadgcc-00150bf9f31d6a0ec576ead73a315f26b1c31749.zip
gcc-00150bf9f31d6a0ec576ead73a315f26b1c31749.tar.gz
gcc-00150bf9f31d6a0ec576ead73a315f26b1c31749.tar.bz2
verify.c (verify_jvm_instructions): Comment change only.
2004-07-20 Andrew Haley <aph@redhat.com> * verify.c (verify_jvm_instructions): Comment change only. * typeck.c (build_java_array_type): Add size field to array name. * java-tree.h (LOCAL_SLOT_P): New. (update_aliases): Add PC argument. (pushdecl_function_level): New function. * java-gimplify.c (java_gimplify_expr): Handle VAR_DECL, MODIFY_EXPR, and SAVE_EXPR. (java_gimplify_modify_expr): New function. * expr.c (push_type_0): Call find_stack_slot() to create temporary. (expand_iinc): Pass PC to update_aliases(). (STORE_INTERNAL): Likewise. (process_jvm_instruction): Likewise. * decl.c (base_decl_map): New variable. (uniq): New variable. (update_aliases): Rewrite with more thorough checking. (debug_variable_p): New function. (push_jvm_slot): Don't initialize local variable. Don't pushdecl. (check_local_named_variable): Delete whole function. (initialize_local_variable): New function. (check_local_unnamed_variable): Add checks and comments. (find_local_variable): Rewrite. (java_replace_reference): New function. (function_binding_level): New variable. (pushdecl_function_level): New function. (maybe_pushlevels): Set DECL_LOCAL_END_PC. (maybe_pushlevels): Call pushdecl() on each of the new decls. (start_java_method): Reset uniq. Create base_decl_map. Set function_binding_level. (end_java_method): Null unused fields to save memory. From-SVN: r85009
Diffstat (limited to 'gcc/java/expr.c')
-rw-r--r--gcc/java/expr.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index 228c1d1..73e3e81 100644
--- a/gcc/java/expr.c
+++ b/gcc/java/expr.c
@@ -255,6 +255,9 @@ push_type_0 (tree type)
n_words = 1 + TYPE_IS_WIDE (type);
if (stack_pointer + n_words > DECL_MAX_STACK (current_function_decl))
return 0;
+ /* Allocate decl for this variable now, so we get a temporary that
+ survives the whole method. */
+ find_stack_slot (stack_pointer, type);
stack_type_map[stack_pointer++] = type;
n_words--;
while (--n_words >= 0)
@@ -368,7 +371,7 @@ pop_type (tree type)
return type;
}
-/* Return 1f if SOURCE_TYPE can be safely widened to TARGET_TYPE.
+/* Return 1 if SOURCE_TYPE can be safely widened to TARGET_TYPE.
Handles array types and interfaces. */
int
@@ -1289,7 +1292,7 @@ expand_iinc (unsigned int local_var_index, int ival, int pc)
constant_value = build_int_2 (ival, ival < 0 ? -1 : 0);
res = fold (build2 (PLUS_EXPR, int_type_node, local_var, constant_value));
java_add_stmt (build2 (MODIFY_EXPR, TREE_TYPE (local_var), local_var, res));
- update_aliases (local_var, local_var_index);
+ update_aliases (local_var, local_var_index, pc);
}
@@ -2758,7 +2761,8 @@ process_jvm_instruction (int PC, const unsigned char* byte_ops,
{ \
int saw_index = 0; \
int index = OPERAND_VALUE; \
- build_java_ret (find_local_variable (index, ptr_type_node, oldpc)); \
+ build_java_ret \
+ (find_local_variable (index, return_address_type_node, oldpc)); \
}
#define JSR(OPERAND_TYPE, OPERAND_VALUE) \
@@ -2937,7 +2941,7 @@ process_jvm_instruction (int PC, const unsigned char* byte_ops,
decl = find_local_variable (index, type, oldpc); \
set_local_type (index, type); \
java_add_stmt (build2 (MODIFY_EXPR, type, decl, value)); \
- update_aliases (decl, index); \
+ update_aliases (decl, index, PC); \
}
#define STORE(OPERAND_TYPE, OPERAND_VALUE) \