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


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

Patch: Java patch for PR 4189


This patch fixes PR 4189.  In the case where a switch statement had a
single `case' branch, we failed to note the push of the constant.
Tested on x86 Red Hat Linux 6.2.

Ok to install?

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* jcf-write.c (generate_bytecode_insns) [SWITCH_EXPR]: Call
	NOTE_PUSH for single-case push.  Fixes PR java/4189.

Index: jcf-write.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/jcf-write.c,v
retrieving revision 1.88
diff -u -r1.88 jcf-write.c
--- jcf-write.c 2001/09/07 18:30:29 1.88
+++ jcf-write.c 2001/09/17 00:29:23
@@ -1720,6 +1720,7 @@
 	    else
 	      {
 		push_int_const (sw_state.cases->offset, state);
+		NOTE_PUSH (1);
 		emit_if (sw_state.cases->label,
 			 OPCODE_if_icmpeq, OPCODE_if_icmpne, state);
 	      }


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