This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch: misc. gcj fixes from Andrew
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Subject: Patch: misc. gcj fixes from Andrew
- From: Tom Tromey <tromey at cygnus dot com>
- Date: 03 May 2000 12:09:17 -0600
- Reply-To: tromey at cygnus dot com
I'm checking in this patch for Andrew. It fixes various gcj bugs.
2000-05-03 Andrew Haley <aph@cygnus.com>
* expr.c (build_java_jsr): Use emit_jump, not expand_goto.
* javaop.h (WORD_TO_INT): New function.
(IMMEDIATE_s4): Use WORD_TO_INT.
* jcf.h (JPOOL_INT): Ditto.
* gjavah.c (decode_signature_piece): Don't treat `$' as namespace
separator.
Tom
Index: expr.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/expr.c,v
retrieving revision 1.72
diff -u -r1.72 expr.c
--- expr.c 2000/05/02 20:32:30 1.72
+++ expr.c 2000/05/03 18:06:09
@@ -560,7 +560,7 @@
tree ret_label = fold (build1 (ADDR_EXPR, return_address_type_node, ret));
push_value (ret_label);
flush_quick_stack ();
- expand_goto (where);
+ emit_jump (label_rtx (where));
expand_label (ret);
}
Index: gjavah.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/gjavah.c,v
retrieving revision 1.55
diff -u -r1.55 gjavah.c
--- gjavah.c 2000/04/19 16:05:03 1.55
+++ gjavah.c 2000/05/03 18:06:31
@@ -990,8 +990,7 @@
while (*signature && *signature != ';')
{
int ch = UTF8_GET (signature, limit);
- /* `$' is the separator for an inner class. */
- if (ch == '/' || ch == '$')
+ if (ch == '/')
fputs ("::", stream);
else
jcf_print_char (stream, ch);
Index: javaop.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/javaop.h,v
retrieving revision 1.7
diff -u -r1.7 javaop.h
--- javaop.h 2000/02/03 18:45:45 1.7
+++ javaop.h 2000/05/03 18:06:35
@@ -98,7 +98,7 @@
#endif
#ifndef IMMEDIATE_s4
#define IMMEDIATE_s4 (PC+=4, CHECK_PC_IN_RANGE(PC), \
- ((jint)((BCODE[PC-4] << 24) | (BCODE[PC-3] << 16) \
+ (WORD_TO_INT((BCODE[PC-4] << 24) | (BCODE[PC-3] << 16) \
| (BCODE[PC-2] << 8) | (BCODE[PC-1]))))
#endif
@@ -107,6 +107,16 @@
{ union Word wu;
wu.i = w;
return wu.f;
+}
+
+/* Sign extend w. */
+static inline jint
+WORD_TO_INT(jword w)
+{
+ jint n = w;
+ n ^= (jint)1 << 31;
+ n -= (jint)1 << 31;
+ return n;
}
static inline jlong
Index: jcf.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/jcf.h,v
retrieving revision 1.16
diff -u -r1.16 jcf.h
--- jcf.h 2000/02/26 19:56:23 1.16
+++ jcf.h 2000/05/03 18:06:35
@@ -131,7 +131,7 @@
#define JPOOL_UTF_DATA(JCF, INDEX) \
((JCF)->buffer+JPOOL_UINT(JCF, INDEX)+2)
#endif
-#define JPOOL_INT(JCF, INDEX) ((jint) JPOOL_UINT (JCF, INDEX))
+#define JPOOL_INT(JCF, INDEX) (WORD_TO_INT(JPOOL_UINT (JCF, INDEX)))
#define JPOOL_FLOAT(JCF, INDEX) WORD_TO_FLOAT (JPOOL_UINT (JCF, INDEX))
#define CPOOL_INDEX_IN_RANGE(CPOOL, INDEX) \