This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: Fix for PR java/2216
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Subject: Patch: Fix for PR java/2216
- From: Tom Tromey <tromey at redhat dot com>
- Date: 12 Mar 2001 13:31:28 -0700
- Cc: Java Patch List <java-patches at gcc dot gnu dot org>
- Reply-To: tromey at redhat dot com
This patch fixes PR java/2216.
I tested it by rebuilding libgcj and then running the test suite.
This worked fine (no regressions).
This might not be the best fix. I don't understand what we are
looking for when we decide not to emit the `goto'. I also don't know
when try_block is a BLOCK and when it is a TRY_EXPR.
Ok to commit? If not, any hints for how to improve the patch?
2001-03-10 Tom Tromey <tromey@redhat.com>
* jcf-write.c (generate_bytecode_insns): Also generate `goto' when
try clause is a TRY_EXPR block. Fixes PR java/2216.
Tom
Index: jcf-write.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/jcf-write.c,v
retrieving revision 1.72
diff -u -r1.72 jcf-write.c
--- jcf-write.c 2001/02/04 22:44:03 1.72
+++ jcf-write.c 2001/03/12 19:22:56
@@ -2372,8 +2372,9 @@
}
if (CAN_COMPLETE_NORMALLY (try_block)
- && TREE_CODE (try_block) == BLOCK
- && BLOCK_EXPR_BODY (try_block) != empty_stmt_node)
+ && ((TREE_CODE (try_block) == BLOCK
+ && BLOCK_EXPR_BODY (try_block) != empty_stmt_node)
+ || TREE_CODE (try_block) == TRY_EXPR))
emit_goto (finished_label, state);
/* Handle exceptions. */