This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch: Java patch for PR 4189
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Subject: Patch: Java patch for PR 4189
- From: Tom Tromey <tromey at redhat dot com>
- Date: 16 Sep 2001 18:54:22 -0600
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Reply-To: tromey at redhat dot com
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);
}