This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch: Fix for PR java/2216


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. */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]