This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
patch for java/5812
- From: Per Bothner <per at bothner dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: adam at medovina dot org, gcc-gnats at gcc dot gnu dot org
- Date: Fri, 08 Mar 2002 15:52:13 -0800
- Subject: patch for java/5812
I checked in this patch, into both the trunk and the gcc3.1 branch.
Tom, could you could close the PR? (I'm leaving on a trip, and I'll
worry about retrieving/getting a gnats password some other time.)
--
--Per Bothner
per@bothner.com http://www.bothner.com/per/
2002-03-08 Per Bothner <per@bothner.com>
Fix for PR java/5812.
* expr.c (build_java_jsr): Take pc arguments, and do lookup_label
gere instead of in JSR macro. Likewise with load_type_state call.
Do the latter on if the return_pc has been verified (the jsr returns).
(JSR): No just call build_java_jsr.
Index: expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/expr.c,v
retrieving revision 1.134
diff -u -p -r1.134 expr.c
--- expr.c 2002/02/28 23:27:09 1.134
+++ expr.c 2002/03/05 19:32:15
@@ -48,7 +48,7 @@ static tree pop_value PARAMS ((tree));
static void java_stack_swap PARAMS ((void));
static void java_stack_dup PARAMS ((int, int));
static void build_java_athrow PARAMS ((tree));
-static void build_java_jsr PARAMS ((tree, tree));
+static void build_java_jsr PARAMS ((int, int));
static void build_java_ret PARAMS ((tree));
static void expand_java_multianewarray PARAMS ((tree, int));
static void expand_java_arraystore PARAMS ((tree));
@@ -607,15 +607,18 @@ build_java_athrow (node)
/* Implementation for jsr/ret */
static void
-build_java_jsr (where, ret)
- tree where;
- tree ret;
+build_java_jsr (target_pc, return_pc)
+ int target_pc, return_pc;
{
+ tree where = lookup_label (target_pc);
+ tree ret = lookup_label (return_pc);
tree ret_label = fold (build1 (ADDR_EXPR, return_address_type_node, ret));
push_value (ret_label);
flush_quick_stack ();
emit_jump (label_rtx (where));
expand_label (ret);
+ if (instruction_bits [return_pc] & BCODE_VERIFIED)
+ load_type_state (ret);
}
static void
@@ -2972,13 +2975,8 @@ process_jvm_instruction (PC, byte_ops, l
build_java_ret (find_local_variable (index, ptr_type_node, oldpc)); \
}
-#define JSR(OPERAND_TYPE, OPERAND_VALUE) \
- { \
- tree where = lookup_label (oldpc+OPERAND_VALUE); \
- tree ret = lookup_label (PC); \
- build_java_jsr (where, ret); \
- load_type_state (ret); \
- }
+#define JSR(OPERAND_TYPE, OPERAND_VALUE) \
+ build_java_jsr (oldpc+OPERAND_VALUE, PC);
/* Push a constant onto the stack. */
#define PUSHC(OPERAND_TYPE, OPERAND_VALUE) \